diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 208af34382..d304652e1c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:fb7584f6adb3847ac480ed49a4bfe1463965026b2919a1be270e3174f3ce1191 -# created: 2023-10-26T23:22:21.357007231Z + digest: sha256:6f431774e11cc46619cf093fd1481193c4024031073697fa18f0099b943aab88 +# created: 2023-12-01T19:50:20.444857406Z diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e27b2c5756..ae66b1973b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [11, 17] + java: [11, 17, 21] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75139af008..4279169666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## [3.16.0](https://github.com/googleapis/java-firestore/compare/v3.15.7...v3.16.0) (2024-01-10) + + +### Features + +* Add DeleteDatabase API and delete protection ([#1508](https://github.com/googleapis/java-firestore/issues/1508)) ([81a1b48](https://github.com/googleapis/java-firestore/commit/81a1b48bae2398f13d0081ea203d8dbac2e74987)) +* Add new types QueryMode, QueryPlan, ResultSetStats ([#1516](https://github.com/googleapis/java-firestore/issues/1516)) ([3060e86](https://github.com/googleapis/java-firestore/commit/3060e868e467a9ef8399f9d15bd91cc819e7bf05)) +* Expose Firestore namespace ID fields in import/export APIs to stable ([21ad25f](https://github.com/googleapis/java-firestore/commit/21ad25f75f91527cf9152a0476af385717e5b111)) +* Expose Firestore PITR fields in Database to stable ([#1495](https://github.com/googleapis/java-firestore/issues/1495)) ([21ad25f](https://github.com/googleapis/java-firestore/commit/21ad25f75f91527cf9152a0476af385717e5b111)) +* Expose Firestore snapshot_time field in export API to stable ([21ad25f](https://github.com/googleapis/java-firestore/commit/21ad25f75f91527cf9152a0476af385717e5b111)) +* Logical termination for firestore.getAll(...). ([#1517](https://github.com/googleapis/java-firestore/issues/1517)) ([c6448fc](https://github.com/googleapis/java-firestore/commit/c6448fc6411de01b3453e58bcbfca633e0849166)) + + +### Bug Fixes + +* Better error message when Transaction/WriteBatch is modified after commit. ([#1503](https://github.com/googleapis/java-firestore/issues/1503)) ([9693c7b](https://github.com/googleapis/java-firestore/commit/9693c7b46dcb63b0348217ecb7c29b95ecd04191)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#1520](https://github.com/googleapis/java-firestore/issues/1520)) ([c4c5a0b](https://github.com/googleapis/java-firestore/commit/c4c5a0b5a5f0e428b041c0ace80c1bbed3872564)) + + +### Dependencies + +* Update beam.version to v2.53.0 ([#1514](https://github.com/googleapis/java-firestore/issues/1514)) ([7639e0d](https://github.com/googleapis/java-firestore/commit/7639e0d0eefb9df84ab535f61c836d0dfb0ef6cf)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.21.0 ([#1518](https://github.com/googleapis/java-firestore/issues/1518)) ([866b2b4](https://github.com/googleapis/java-firestore/commit/866b2b48ee7acf644dc6355054d7b2ae7e627c13)) + + +### Documentation + +* Assorted typo fixes and whitespace updates ([21ad25f](https://github.com/googleapis/java-firestore/commit/21ad25f75f91527cf9152a0476af385717e5b111)) +* Remove latin abbreviations from comments. ([#1457](https://github.com/googleapis/java-firestore/issues/1457)) ([1cfa03d](https://github.com/googleapis/java-firestore/commit/1cfa03d36a04f17fba91cc7b1f05a59ee149c7aa)) +* Tweak Count API docs ([#1522](https://github.com/googleapis/java-firestore/issues/1522)) ([e25ae13](https://github.com/googleapis/java-firestore/commit/e25ae1391893f26faac9938d49918fcad6a9d0ed)) + ## [3.15.7](https://github.com/googleapis/java-firestore/compare/v3.15.6...v3.15.7) (2023-12-01) diff --git a/README.md b/README.md index 185297aa0e..1422de48aa 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.27.0 + 26.29.0 pom import @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-firestore - 3.15.6 + 3.15.7 ``` @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.27.0') +implementation platform('com.google.cloud:libraries-bom:26.29.0') implementation 'com.google.cloud:google-cloud-firestore' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-firestore:3.15.6' +implementation 'com.google.cloud:google-cloud-firestore:3.15.7' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.15.6" +libraryDependencies += "com.google.cloud" % "google-cloud-firestore" % "3.15.7" ``` @@ -222,7 +222,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-firestore/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-firestore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.15.6 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-firestore/3.15.7 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/google-cloud-firestore-admin/pom.xml b/google-cloud-firestore-admin/pom.xml index 35ca647c0f..19d1d29730 100644 --- a/google-cloud-firestore-admin/pom.xml +++ b/google-cloud-firestore-admin/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-firestore-admin - 3.15.7 + 3.16.0 jar Google Cloud Firestore Admin Client https://github.com/googleapis/java-firestore @@ -14,7 +14,7 @@ com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java index d19ab16709..0ff74e0d53 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java @@ -37,6 +37,8 @@ import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -117,19 +119,290 @@ *

Note: close() needs to be called on the FirestoreAdminClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
CreateIndex

Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the creation. The metadata for the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createIndexAsync(CreateIndexRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createIndexAsync(CollectionGroupName parent, Index index) + *
  • createIndexAsync(String parent, Index index) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createIndexOperationCallable() + *
  • createIndexCallable() + *
+ *
ListIndexes

Lists composite indexes.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listIndexes(ListIndexesRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listIndexes(CollectionGroupName parent) + *
  • listIndexes(String parent) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listIndexesPagedCallable() + *
  • listIndexesCallable() + *
+ *
GetIndex

Gets a composite index.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIndex(GetIndexRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getIndex(IndexName name) + *
  • getIndex(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIndexCallable() + *
+ *
DeleteIndex

Deletes a composite index.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteIndex(DeleteIndexRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteIndex(IndexName name) + *
  • deleteIndex(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteIndexCallable() + *
+ *
GetField

Gets the metadata and configuration for a Field.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getField(GetFieldRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getField(FieldName name) + *
  • getField(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getFieldCallable() + *
+ *
UpdateField

Updates a field configuration. Currently, field updates apply only to single field index configuration. However, calls to [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid changing any configuration that the caller isn't aware of. The field mask should be specified as: `{ paths: "index_config" }`. + *

This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to track the status of the field update. The metadata for the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata]. + *

To configure the default field settings for the database, use the special `Field` with resource name: `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateFieldAsync(UpdateFieldRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateFieldAsync(Field field) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateFieldOperationCallable() + *
  • updateFieldCallable() + *
+ *
ListFields

Lists the field configuration and metadata for this database. + *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields that have been explicitly overridden. To issue this query, call [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listFields(ListFieldsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listFields(CollectionGroupName parent) + *
  • listFields(String parent) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listFieldsPagedCallable() + *
  • listFieldsCallable() + *
+ *
ExportDocuments

Exports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage. + *

For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • exportDocumentsAsync(ExportDocumentsRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • exportDocumentsAsync(DatabaseName name) + *
  • exportDocumentsAsync(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • exportDocumentsOperationCallable() + *
  • exportDocumentsCallable() + *
+ *
ImportDocuments

Imports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • importDocumentsAsync(ImportDocumentsRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • importDocumentsAsync(DatabaseName name) + *
  • importDocumentsAsync(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • importDocumentsOperationCallable() + *
  • importDocumentsCallable() + *
+ *
CreateDatabase

Create a database.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createDatabaseAsync(CreateDatabaseRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createDatabaseAsync(ProjectName parent, Database database, String databaseId) + *
  • createDatabaseAsync(String parent, Database database, String databaseId) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createDatabaseOperationCallable() + *
  • createDatabaseCallable() + *
+ *
GetDatabase

Gets information about a database.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getDatabase(GetDatabaseRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getDatabase(DatabaseName name) + *
  • getDatabase(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getDatabaseCallable() + *
+ *
ListDatabases

List all the databases in the project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listDatabases(ListDatabasesRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listDatabases(ProjectName parent) + *
  • listDatabases(String parent) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listDatabasesCallable() + *
+ *
UpdateDatabase

Updates a database.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateDatabaseAsync(UpdateDatabaseRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateDatabaseAsync(Database database, FieldMask updateMask) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateDatabaseOperationCallable() + *
  • updateDatabaseCallable() + *
+ *
DeleteDatabase

Deletes a database.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteDatabaseAsync(DeleteDatabaseRequest request) + *
+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteDatabaseAsync(DatabaseName name) + *
  • deleteDatabaseAsync(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteDatabaseOperationCallable() + *
  • deleteDatabaseCallable() + *
+ *
* *

See the individual methods for example code. * @@ -1106,7 +1379,7 @@ public final UnaryCallable updateFieldCallable() *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] * only supports listing fields that have been explicitly overridden. To issue this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the - * filter set to `indexConfig.usesAncestorConfig:false` . + * filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`. * *

Sample code: * @@ -1142,7 +1415,7 @@ public final ListFieldsPagedResponse listFields(CollectionGroupName parent) { *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] * only supports listing fields that have been explicitly overridden. To issue this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the - * filter set to `indexConfig.usesAncestorConfig:false` . + * filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`. * *

Sample code: * @@ -1176,7 +1449,7 @@ public final ListFieldsPagedResponse listFields(String parent) { *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] * only supports listing fields that have been explicitly overridden. To issue this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the - * filter set to `indexConfig.usesAncestorConfig:false` . + * filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`. * *

Sample code: * @@ -1215,7 +1488,7 @@ public final ListFieldsPagedResponse listFields(ListFieldsRequest request) { *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] * only supports listing fields that have been explicitly overridden. To issue this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the - * filter set to `indexConfig.usesAncestorConfig:false` . + * filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`. * *

Sample code: * @@ -1253,7 +1526,7 @@ public final UnaryCallable listField *

Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] * only supports listing fields that have been explicitly overridden. To issue this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the - * filter set to `indexConfig.usesAncestorConfig:false` . + * filter set to `indexConfig.usesAncestorConfig:false or `ttlConfig:*`. * *

Sample code: * @@ -1390,6 +1663,8 @@ public final UnaryCallable listFieldsCall * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setOutputUriPrefix("outputUriPrefix499858205") + * .addAllNamespaceIds(new ArrayList()) + * .setSnapshotTime(Timestamp.newBuilder().build()) * .build(); * ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(request).get(); * } @@ -1429,6 +1704,8 @@ public final UnaryCallable listFieldsCall * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setOutputUriPrefix("outputUriPrefix499858205") + * .addAllNamespaceIds(new ArrayList()) + * .setSnapshotTime(Timestamp.newBuilder().build()) * .build(); * OperationFuture future = * firestoreAdminClient.exportDocumentsOperationCallable().futureCall(request); @@ -1469,6 +1746,8 @@ public final UnaryCallable listFieldsCall * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setOutputUriPrefix("outputUriPrefix499858205") + * .addAllNamespaceIds(new ArrayList()) + * .setSnapshotTime(Timestamp.newBuilder().build()) * .build(); * ApiFuture future = * firestoreAdminClient.exportDocumentsCallable().futureCall(request); @@ -1564,6 +1843,7 @@ public final OperationFuture importDocumentsAsyn * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setInputUriPrefix("inputUriPrefix-97481100") + * .addAllNamespaceIds(new ArrayList()) * .build(); * firestoreAdminClient.importDocumentsAsync(request).get(); * } @@ -1598,6 +1878,7 @@ public final OperationFuture importDocumentsAsyn * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setInputUriPrefix("inputUriPrefix-97481100") + * .addAllNamespaceIds(new ArrayList()) * .build(); * OperationFuture future = * firestoreAdminClient.importDocumentsOperationCallable().futureCall(request); @@ -1632,6 +1913,7 @@ public final OperationFuture importDocumentsAsyn * .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) * .addAllCollectionIds(new ArrayList()) * .setInputUriPrefix("inputUriPrefix-97481100") + * .addAllNamespaceIds(new ArrayList()) * .build(); * ApiFuture future = * firestoreAdminClient.importDocumentsCallable().futureCall(request); @@ -1669,7 +1951,10 @@ public final UnaryCallable importDocumentsCal * @param database Required. The Database to create. * @param databaseId Required. The ID to use for the database, which will become the final * component of the database's resource name. - *

The value must be set to "(default)". + *

This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first + * character a letter and the last a letter or a number. Must not be UUID-like + * /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + *

"(default)" database id is also valid. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createDatabaseAsync( @@ -1708,7 +1993,10 @@ public final OperationFuture createDatabaseAsy * @param database Required. The Database to create. * @param databaseId Required. The ID to use for the database, which will become the final * component of the database's resource name. - *

The value must be set to "(default)". + *

This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ with first + * character a letter and the last a letter or a number. Must not be UUID-like + * /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + *

"(default)" database id is also valid. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture createDatabaseAsync( @@ -2152,6 +2440,149 @@ public final UnaryCallable updateDatabaseCalla return stub.updateDatabaseCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+   *   Database response = firestoreAdminClient.deleteDatabaseAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the form `projects/{project_id}/databases/{database_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteDatabaseAsync( + DatabaseName name) { + DeleteDatabaseRequest request = + DeleteDatabaseRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteDatabaseAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   String name = DatabaseName.of("[PROJECT]", "[DATABASE]").toString();
+   *   Database response = firestoreAdminClient.deleteDatabaseAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. A name of the form `projects/{project_id}/databases/{database_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteDatabaseAsync(String name) { + DeleteDatabaseRequest request = DeleteDatabaseRequest.newBuilder().setName(name).build(); + return deleteDatabaseAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteDatabaseRequest request =
+   *       DeleteDatabaseRequest.newBuilder()
+   *           .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   Database response = firestoreAdminClient.deleteDatabaseAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteDatabaseAsync( + DeleteDatabaseRequest request) { + return deleteDatabaseOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteDatabaseRequest request =
+   *       DeleteDatabaseRequest.newBuilder()
+   *           .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   OperationFuture future =
+   *       firestoreAdminClient.deleteDatabaseOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Database response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteDatabaseOperationCallable() { + return stub.deleteDatabaseOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a database. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+   *   DeleteDatabaseRequest request =
+   *       DeleteDatabaseRequest.newBuilder()
+   *           .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString())
+   *           .setEtag("etag3123477")
+   *           .build();
+   *   ApiFuture future =
+   *       firestoreAdminClient.deleteDatabaseCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteDatabaseCallable() { + return stub.deleteDatabaseCallable(); + } + @Override public final void close() { stub.close(); diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java index 5560d20d3a..cd4f0a14e1 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java @@ -37,6 +37,8 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -209,6 +211,17 @@ public UnaryCallSettings updateDatabaseSetting return ((FirestoreAdminStubSettings) getStubSettings()).updateDatabaseOperationSettings(); } + /** Returns the object with the settings used for calls to deleteDatabase. */ + public UnaryCallSettings deleteDatabaseSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).deleteDatabaseSettings(); + } + + /** Returns the object with the settings used for calls to deleteDatabase. */ + public OperationCallSettings + deleteDatabaseOperationSettings() { + return ((FirestoreAdminStubSettings) getStubSettings()).deleteDatabaseOperationSettings(); + } + public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub) throws IOException { return new FirestoreAdminSettings.Builder(stub.toBuilder()).build(); @@ -430,6 +443,17 @@ public UnaryCallSettings.Builder updateDatabas return getStubSettingsBuilder().updateDatabaseOperationSettings(); } + /** Returns the builder for the settings used for calls to deleteDatabase. */ + public UnaryCallSettings.Builder deleteDatabaseSettings() { + return getStubSettingsBuilder().deleteDatabaseSettings(); + } + + /** Returns the builder for the settings used for calls to deleteDatabase. */ + public OperationCallSettings.Builder + deleteDatabaseOperationSettings() { + return getStubSettingsBuilder().deleteDatabaseOperationSettings(); + } + @Override public FirestoreAdminSettings build() throws IOException { return new FirestoreAdminSettings(this); diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json index e6ec0f7a41..aaa8b74b82 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/gapic_metadata.json @@ -16,6 +16,9 @@ "CreateIndex": { "methods": ["createIndexAsync", "createIndexAsync", "createIndexAsync", "createIndexOperationCallable", "createIndexCallable"] }, + "DeleteDatabase": { + "methods": ["deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseAsync", "deleteDatabaseOperationCallable", "deleteDatabaseCallable"] + }, "DeleteIndex": { "methods": ["deleteIndex", "deleteIndex", "deleteIndex", "deleteIndexCallable"] }, diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java index 671aca4462..dc8279df50 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java @@ -26,6 +26,8 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -160,6 +162,15 @@ public UnaryCallable updateDatabaseCallable() throw new UnsupportedOperationException("Not implemented: updateDatabaseCallable()"); } + public OperationCallable + deleteDatabaseOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatabaseOperationCallable()"); + } + + public UnaryCallable deleteDatabaseCallable() { + throw new UnsupportedOperationException("Not implemented: deleteDatabaseCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java index 4eeebb19c3..2be7176acd 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java @@ -56,6 +56,8 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -160,6 +162,9 @@ public class FirestoreAdminStubSettings extends StubSettings updateDatabaseSettings; private final OperationCallSettings updateDatabaseOperationSettings; + private final UnaryCallSettings deleteDatabaseSettings; + private final OperationCallSettings + deleteDatabaseOperationSettings; private static final PagedListDescriptor LIST_INDEXES_PAGE_STR_DESC = @@ -371,6 +376,17 @@ public UnaryCallSettings updateDatabaseSetting return updateDatabaseOperationSettings; } + /** Returns the object with the settings used for calls to deleteDatabase. */ + public UnaryCallSettings deleteDatabaseSettings() { + return deleteDatabaseSettings; + } + + /** Returns the object with the settings used for calls to deleteDatabase. */ + public OperationCallSettings + deleteDatabaseOperationSettings() { + return deleteDatabaseOperationSettings; + } + public FirestoreAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -387,6 +403,12 @@ public FirestoreAdminStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "firestore"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); @@ -496,6 +518,8 @@ protected FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException listDatabasesSettings = settingsBuilder.listDatabasesSettings().build(); updateDatabaseSettings = settingsBuilder.updateDatabaseSettings().build(); updateDatabaseOperationSettings = settingsBuilder.updateDatabaseOperationSettings().build(); + deleteDatabaseSettings = settingsBuilder.deleteDatabaseSettings().build(); + deleteDatabaseOperationSettings = settingsBuilder.deleteDatabaseOperationSettings().build(); } /** Builder for FirestoreAdminStubSettings. */ @@ -539,6 +563,11 @@ public static class Builder extends StubSettings.Builder updateDatabaseOperationSettings; + private final UnaryCallSettings.Builder + deleteDatabaseSettings; + private final OperationCallSettings.Builder< + DeleteDatabaseRequest, Database, DeleteDatabaseMetadata> + deleteDatabaseOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -613,6 +642,8 @@ protected Builder(ClientContext clientContext) { listDatabasesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateDatabaseOperationSettings = OperationCallSettings.newBuilder(); + deleteDatabaseSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteDatabaseOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -628,7 +659,8 @@ protected Builder(ClientContext clientContext) { createDatabaseSettings, getDatabaseSettings, listDatabasesSettings, - updateDatabaseSettings); + updateDatabaseSettings, + deleteDatabaseSettings); initDefaults(this); } @@ -654,6 +686,8 @@ protected Builder(FirestoreAdminStubSettings settings) { listDatabasesSettings = settings.listDatabasesSettings.toBuilder(); updateDatabaseSettings = settings.updateDatabaseSettings.toBuilder(); updateDatabaseOperationSettings = settings.updateDatabaseOperationSettings.toBuilder(); + deleteDatabaseSettings = settings.deleteDatabaseSettings.toBuilder(); + deleteDatabaseOperationSettings = settings.deleteDatabaseOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -669,7 +703,8 @@ protected Builder(FirestoreAdminStubSettings settings) { createDatabaseSettings, getDatabaseSettings, listDatabasesSettings, - updateDatabaseSettings); + updateDatabaseSettings, + deleteDatabaseSettings); } private static Builder createDefault() { @@ -764,6 +799,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .deleteDatabaseSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createIndexOperationSettings() .setInitialCallSettings( @@ -906,6 +946,30 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder + .deleteDatabaseOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Database.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteDatabaseMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -1042,6 +1106,19 @@ public UnaryCallSettings.Builder updateDatabas return updateDatabaseOperationSettings; } + /** Returns the builder for the settings used for calls to deleteDatabase. */ + public UnaryCallSettings.Builder deleteDatabaseSettings() { + return deleteDatabaseSettings; + } + + /** Returns the builder for the settings used for calls to deleteDatabase. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteDatabaseOperationSettings() { + return deleteDatabaseOperationSettings; + } + @Override public FirestoreAdminStubSettings build() throws IOException { return new FirestoreAdminStubSettings(this); diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java index 31ffc3e889..54fdfbd6e8 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java @@ -31,6 +31,8 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -188,6 +190,16 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor + deleteDatabaseMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteDatabaseRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private final UnaryCallable createIndexCallable; private final OperationCallable createIndexOperationCallable; @@ -217,6 +229,9 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable updateDatabaseCallable; private final OperationCallable updateDatabaseOperationCallable; + private final UnaryCallable deleteDatabaseCallable; + private final OperationCallable + deleteDatabaseOperationCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -392,6 +407,16 @@ protected GrpcFirestoreAdminStub( return builder.build(); }) .build(); + GrpcCallSettings deleteDatabaseTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteDatabaseMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -474,6 +499,15 @@ protected GrpcFirestoreAdminStub( settings.updateDatabaseOperationSettings(), clientContext, operationsStub); + this.deleteDatabaseCallable = + callableFactory.createUnaryCallable( + deleteDatabaseTransportSettings, settings.deleteDatabaseSettings(), clientContext); + this.deleteDatabaseOperationCallable = + callableFactory.createOperationCallable( + deleteDatabaseTransportSettings, + settings.deleteDatabaseOperationSettings(), + clientContext, + operationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -594,6 +628,17 @@ public UnaryCallable updateDatabaseCallable() return updateDatabaseOperationCallable; } + @Override + public UnaryCallable deleteDatabaseCallable() { + return deleteDatabaseCallable; + } + + @Override + public OperationCallable + deleteDatabaseOperationCallable() { + return deleteDatabaseOperationCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java index 337934e2a9..7cbf5aecd5 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/HttpJsonFirestoreAdminStub.java @@ -41,6 +41,8 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseMetadata; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsMetadata; import com.google.firestore.admin.v1.ExportDocumentsRequest; @@ -96,6 +98,7 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { .add(FieldOperationMetadata.getDescriptor()) .add(ExportDocumentsMetadata.getDescriptor()) .add(IndexOperationMetadata.getDescriptor()) + .add(DeleteDatabaseMetadata.getDescriptor()) .build(); private static final ApiMethodDescriptor @@ -584,6 +587,44 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { HttpJsonOperationSnapshot.create(response)) .build(); + private static final ApiMethodDescriptor + deleteDatabaseMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/databases/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteDatabaseRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + private final UnaryCallable createIndexCallable; private final OperationCallable createIndexOperationCallable; @@ -613,6 +654,9 @@ public class HttpJsonFirestoreAdminStub extends FirestoreAdminStub { private final UnaryCallable updateDatabaseCallable; private final OperationCallable updateDatabaseOperationCallable; + private final UnaryCallable deleteDatabaseCallable; + private final OperationCallable + deleteDatabaseOperationCallable; private final BackgroundResource backgroundResources; private final HttpJsonOperationsStub httpJsonOperationsStub; @@ -828,6 +872,17 @@ protected HttpJsonFirestoreAdminStub( return builder.build(); }) .build(); + HttpJsonCallSettings deleteDatabaseTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteDatabaseMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.createIndexCallable = callableFactory.createUnaryCallable( @@ -910,6 +965,15 @@ protected HttpJsonFirestoreAdminStub( settings.updateDatabaseOperationSettings(), clientContext, httpJsonOperationsStub); + this.deleteDatabaseCallable = + callableFactory.createUnaryCallable( + deleteDatabaseTransportSettings, settings.deleteDatabaseSettings(), clientContext); + this.deleteDatabaseOperationCallable = + callableFactory.createOperationCallable( + deleteDatabaseTransportSettings, + settings.deleteDatabaseOperationSettings(), + clientContext, + httpJsonOperationsStub); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -931,6 +995,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(getDatabaseMethodDescriptor); methodDescriptors.add(listDatabasesMethodDescriptor); methodDescriptors.add(updateDatabaseMethodDescriptor); + methodDescriptors.add(deleteDatabaseMethodDescriptor); return methodDescriptors; } @@ -1049,6 +1114,17 @@ public UnaryCallable updateDatabaseCallable() return updateDatabaseOperationCallable; } + @Override + public UnaryCallable deleteDatabaseCallable() { + return deleteDatabaseCallable; + } + + @Override + public OperationCallable + deleteDatabaseOperationCallable() { + return deleteDatabaseOperationCallable; + } + @Override public final void close() { try { diff --git a/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json b/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json index 7cf220dc54..2ecb98209b 100644 --- a/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json +++ b/google-cloud-firestore-admin/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json @@ -548,6 +548,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.admin.v1.Database$DeleteProtectionState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.Database$PointInTimeRecoveryEnablement", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteDatabaseMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteDatabaseMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteDatabaseRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.admin.v1.DeleteDatabaseRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.admin.v1.DeleteIndexRequest", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java index d28441c58c..d5009b3303 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientHttpJsonTest.java @@ -44,8 +44,10 @@ import com.google.firestore.admin.v1.ProjectName; import com.google.longrunning.Operation; import com.google.protobuf.Any; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -926,7 +928,12 @@ public void createDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -982,7 +989,12 @@ public void createDatabaseTest2() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1038,7 +1050,12 @@ public void getDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1085,7 +1102,12 @@ public void getDatabaseTest2() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1130,7 +1152,10 @@ public void getDatabaseExceptionTest2() throws Exception { @Test public void listDatabasesTest() throws Exception { ListDatabasesResponse expectedResponse = - ListDatabasesResponse.newBuilder().addAllDatabases(new ArrayList()).build(); + ListDatabasesResponse.newBuilder() + .addAllDatabases(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); mockService.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); @@ -1172,7 +1197,10 @@ public void listDatabasesExceptionTest() throws Exception { @Test public void listDatabasesTest2() throws Exception { ListDatabasesResponse expectedResponse = - ListDatabasesResponse.newBuilder().addAllDatabases(new ArrayList()).build(); + ListDatabasesResponse.newBuilder() + .addAllDatabases(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); mockService.addResponse(expectedResponse); String parent = "projects/project-2353"; @@ -1216,7 +1244,12 @@ public void updateDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1231,7 +1264,12 @@ public void updateDatabaseTest() throws Exception { Database database = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1266,7 +1304,12 @@ public void updateDatabaseExceptionTest() throws Exception { Database database = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1276,4 +1319,118 @@ public void updateDatabaseExceptionTest() throws Exception { } catch (ExecutionException e) { } } + + @Test + public void deleteDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]"); + + Database actualResponse = client.deleteDatabaseAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDatabaseExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]"); + client.deleteDatabaseAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteDatabaseTest2() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-2580/databases/database-2580"; + + Database actualResponse = client.deleteDatabaseAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteDatabaseExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-2580/databases/database-2580"; + client.deleteDatabaseAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } } diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java index e6f31ed915..10081fa8c1 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/FirestoreAdminClientTest.java @@ -33,6 +33,7 @@ import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; import com.google.firestore.admin.v1.DatabaseName; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsRequest; import com.google.firestore.admin.v1.ExportDocumentsResponse; @@ -56,8 +57,10 @@ import com.google.longrunning.Operation; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; @@ -844,7 +847,12 @@ public void createDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -899,7 +907,12 @@ public void createDatabaseTest2() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -954,7 +967,12 @@ public void getDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -995,7 +1013,12 @@ public void getDatabaseTest2() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1034,7 +1057,10 @@ public void getDatabaseExceptionTest2() throws Exception { @Test public void listDatabasesTest() throws Exception { ListDatabasesResponse expectedResponse = - ListDatabasesResponse.newBuilder().addAllDatabases(new ArrayList()).build(); + ListDatabasesResponse.newBuilder() + .addAllDatabases(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); mockFirestoreAdmin.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); @@ -1070,7 +1096,10 @@ public void listDatabasesExceptionTest() throws Exception { @Test public void listDatabasesTest2() throws Exception { ListDatabasesResponse expectedResponse = - ListDatabasesResponse.newBuilder().addAllDatabases(new ArrayList()).build(); + ListDatabasesResponse.newBuilder() + .addAllDatabases(new ArrayList()) + .addAllUnreachable(new ArrayList()) + .build(); mockFirestoreAdmin.addResponse(expectedResponse); String parent = "parent-995424086"; @@ -1108,7 +1137,12 @@ public void updateDatabaseTest() throws Exception { Database expectedResponse = Database.newBuilder() .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) .setKeyPrefix("keyPrefix-2076395055") .setEtag("etag3123477") .build(); @@ -1154,4 +1188,112 @@ public void updateDatabaseExceptionTest() throws Exception { Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } + + @Test + public void deleteDatabaseTest() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFirestoreAdmin.addResponse(resultOperation); + + DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]"); + + Database actualResponse = client.deleteDatabaseAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatabaseRequest actualRequest = ((DeleteDatabaseRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatabaseExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]"); + client.deleteDatabaseAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteDatabaseTest2() throws Exception { + Database expectedResponse = + Database.newBuilder() + .setName(DatabaseName.of("[PROJECT]", "[DATABASE]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setLocationId("locationId1541836720") + .setVersionRetentionPeriod(Duration.newBuilder().build()) + .setEarliestVersionTime(Timestamp.newBuilder().build()) + .setKeyPrefix("keyPrefix-2076395055") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteDatabaseTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFirestoreAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Database actualResponse = client.deleteDatabaseAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFirestoreAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteDatabaseRequest actualRequest = ((DeleteDatabaseRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteDatabaseExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFirestoreAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteDatabaseAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } } diff --git a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java index a099136f75..f35d442c49 100644 --- a/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java +++ b/google-cloud-firestore-admin/src/test/java/com/google/cloud/firestore/v1/MockFirestoreAdminImpl.java @@ -20,6 +20,7 @@ import com.google.firestore.admin.v1.CreateDatabaseRequest; import com.google.firestore.admin.v1.CreateIndexRequest; import com.google.firestore.admin.v1.Database; +import com.google.firestore.admin.v1.DeleteDatabaseRequest; import com.google.firestore.admin.v1.DeleteIndexRequest; import com.google.firestore.admin.v1.ExportDocumentsRequest; import com.google.firestore.admin.v1.Field; @@ -345,4 +346,25 @@ public void updateDatabase( Exception.class.getName()))); } } + + @Override + public void deleteDatabase( + DeleteDatabaseRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteDatabase, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/google-cloud-firestore-bom/pom.xml b/google-cloud-firestore-bom/pom.xml index 55f24e4792..26ae50a2d9 100644 --- a/google-cloud-firestore-bom/pom.xml +++ b/google-cloud-firestore-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-firestore-bom - 3.15.7 + 3.16.0 pom com.google.cloud google-cloud-shared-config - 1.6.0 + 1.7.1 Google Cloud Firestore BOM @@ -52,37 +52,37 @@ com.google.cloud google-cloud-firestore - 3.15.7 + 3.16.0 com.google.cloud google-cloud-firestore-admin - 3.15.7 + 3.16.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.15.7 + 3.16.0
diff --git a/google-cloud-firestore/pom.xml b/google-cloud-firestore/pom.xml index 5e49823cfe..49e6c74c4a 100644 --- a/google-cloud-firestore/pom.xml +++ b/google-cloud-firestore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-firestore - 3.15.7 + 3.16.0 jar Google Cloud Firestore https://github.com/googleapis/java-firestore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 google-cloud-firestore diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateField.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateField.java index ee3af88cae..f0cc99aac1 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateField.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateField.java @@ -137,7 +137,7 @@ String getAlias() { /** * Returns the field on which the aggregation takes place. Returns an empty string if there's no - * field (e.g. for count). + * field (this applies to count). */ @Nonnull String getFieldPath() { diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateQuery.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateQuery.java index d513c39d11..1613b74dd4 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateQuery.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/AggregateQuery.java @@ -210,7 +210,8 @@ RunAggregationQueryRequest toProto(@Nullable final ByteString transactionId) { request.getStructuredAggregationQueryBuilder(); structuredAggregationQuery.setStructuredQuery(runQueryRequest.getStructuredQuery()); - // We use this set to remove duplicate aggregates. e.g. `aggregate(sum("foo"), sum("foo"))` + // We use this set to remove duplicate aggregates. + // For example, `aggregate(sum("foo"), sum("foo"))` HashSet uniqueAggregates = new HashSet<>(); List aggregations = new ArrayList<>(); int aggregationNum = 0; diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CollectionReference.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CollectionReference.java index 3b771fdb86..215153ac75 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CollectionReference.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/CollectionReference.java @@ -59,8 +59,8 @@ public class CollectionReference extends Query { } /** - * The id of a collection refers to the last component of path pointing to a collection, e.g. - * "collection-id" in "projects/project-id/databases/database-id/documents/collection-id". + * The id of a collection refers to the last component of path pointing to a collection, for + * example "collection-id" in "projects/project-id/databases/database-id/documents/collection-id". * * @return The ID of the collection. */ @@ -121,10 +121,10 @@ public DocumentReference document(@Nonnull String childPath) { /** * Retrieves the list of documents in this collection. * - *

The document references returned may include references to "missing documents", i.e. + *

The document references returned may include references to "missing documents", specifically * document locations that have no document present but which contain subcollections with - * documents. Attempting to read such a document reference (e.g. via `get()` or `onSnapshot()`) - * will return a `DocumentSnapshot` whose `exists()` method returns false. + * documents. Attempting to read such a document reference (for example via `get()` or + * `onSnapshot()`) will return a `DocumentSnapshot` whose `exists()` method returns false. * * @return The list of documents in this collection. */ diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentChange.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentChange.java index 668865946a..cb2e8e0d5b 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentChange.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentChange.java @@ -73,17 +73,17 @@ public QueryDocumentSnapshot getDocument() { /** * The index of the changed document in the result set immediately prior to this DocumentChange - * (i.e. supposing that all prior DocumentChange objects have been applied). Returns -1 for - * 'added' events. + * (specifically, supposing that all prior DocumentChange objects have been applied). Returns -1 + * for 'added' events. */ public int getOldIndex() { return oldIndex; } /** - * The index of the changed document in the result set immediately after this DocumentChange (i.e. - * supposing that all prior DocumentChange objects and the current DocumentChange object have been - * applied). Returns -1 for 'removed' events. + * The index of the changed document in the result set immediately after this DocumentChange + * (specifically, supposing that all prior DocumentChange objects and the current DocumentChange + * object have been applied). Returns -1 for 'removed' events. */ public int getNewIndex() { return newIndex; diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentReference.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentReference.java index 5841bdcf7d..7a80571a7b 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentReference.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentReference.java @@ -68,7 +68,7 @@ public Firestore getFirestore() { } /** - * The id of a document refers to the last component of path pointing to a document, e.g. + * The id of a document refers to the last component of path pointing to a document, for example * "document-id" in "projects/project-id/databases/database-id/document-id". * * @return The ID of the document. diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java index 38e037b33d..4b54f7dcb0 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java @@ -222,6 +222,7 @@ void getAll( ResponseObserver responseObserver = new ResponseObserver() { int numResponses; + boolean hasCompleted = false; @Override public void onStart(StreamController streamController) {} @@ -265,6 +266,13 @@ public void onResponse(BatchGetDocumentsResponse response) { return; } apiStreamObserver.onNext(documentSnapshot); + + // Logical termination: if we have already received as many documents as we had + // requested, we can + // raise the results without waiting for the termination from the server. + if (numResponses == documentReferences.length) { + onComplete(); + } } @Override @@ -277,6 +285,8 @@ public void onError(Throwable throwable) { @Override public void onComplete() { + if (hasCompleted) return; + hasCompleted = true; tracer .getCurrentSpan() .addAnnotation(TraceUtil.SPAN_NAME_BATCHGETDOCUMENTS + ": Complete"); diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java index 9b9ede8593..7fb6856b88 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java @@ -934,7 +934,8 @@ public Query where(com.google.cloud.firestore.Filter filter) { + "startAfter(), endBefore() or endAt()."); FilterInternal parsedFilter = parseFilter(filter); if (parsedFilter.getFilters().isEmpty()) { - // Return the existing query if not adding any more filters (e.g. an empty composite filter). + // Return the existing query if not adding any more filters (for example an empty composite + // filter). return this; } Builder newOptions = options.toBuilder(); @@ -1922,8 +1923,8 @@ boolean shouldRetryQuery( * without actually downloading the documents. * *

Using the returned query to count the documents is efficient because only the final count, - * not the documents' data, is downloaded. The returned query can even count the documents if the - * result set would be prohibitively large to download entirely (e.g. thousands of documents). + * not the documents' data, is downloaded. The returned query can count the documents in cases + * where the result set is prohibitively large to download entirely (thousands of documents). * * @return a query that counts the documents in the result set of this query. */ @@ -1933,13 +1934,13 @@ public AggregateQuery count() { } /** - * Calculates the specified aggregations over the documents in the result set of the given query, - * without actually downloading the documents. + * Calculates the specified aggregations over the documents in the result set of the given query + * without actually downloading the documents. * - *

Using this function to perform aggregations is efficient because only the final aggregation - * values, not the documents' data, is downloaded. This function can even perform aggregations of - * the documents if the result set would be prohibitively large to download entirely (e.g. - * thousands of documents). + *

Using the returned query to perform aggregations is efficient because only the final + * aggregation values, not the documents' data, is downloaded. The returned query can perform + * aggregations of the documents in cases where the result set is prohibitively large to download + * entirely (thousands of documents). * * @return an {@link AggregateQuery} that performs aggregations on the documents in the result set * of this query. diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java index 69216bce2d..fdfb09231e 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/QuerySnapshot.java @@ -206,9 +206,9 @@ public Iterator iterator() { */ @Nonnull public List toObjects(@Nonnull Class clazz) { - List results = new ArrayList<>(); - - for (DocumentSnapshot documentSnapshot : getDocuments()) { + List documents = getDocuments(); + List results = new ArrayList<>(documents.size()); + for (DocumentSnapshot documentSnapshot : documents) { results.add( CustomClassMapper.convertToCustomClass( documentSnapshot.getData(), clazz, documentSnapshot.getReference())); diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/TransactionRunner.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/TransactionRunner.java index c247b1bed5..6ab4fecd2a 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/TransactionRunner.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/TransactionRunner.java @@ -16,8 +16,6 @@ package com.google.cloud.firestore; -import com.google.api.core.ApiAsyncFunction; -import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutureCallback; import com.google.api.core.ApiFutures; @@ -33,7 +31,6 @@ import io.opencensus.trace.Span; import io.opencensus.trace.Tracer; import io.opencensus.trace.Tracing; -import java.util.List; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -107,9 +104,9 @@ ApiFuture run() { return ApiFutures.catchingAsync( ApiFutures.transformAsync( - maybeRollback(), new RollbackCallback(), MoreExecutors.directExecutor()), + maybeRollback(), this::rollbackCallback, MoreExecutors.directExecutor()), Throwable.class, - new RestartTransactionCallback(), + this::restartTransactionCallback, MoreExecutors.directExecutor()); } @@ -120,20 +117,17 @@ private ApiFuture maybeRollback() { } /** A callback that invokes the BeginTransaction callback. */ - private class RollbackCallback implements ApiAsyncFunction { - @Override - public ApiFuture apply(Void input) { - final SettableApiFuture backoff = SettableApiFuture.create(); - // Add a backoff delay. At first, this is 0. - firestoreExecutor.schedule( - () -> backoff.set(null), - nextBackoffAttempt.getRandomizedRetryDelay().toMillis(), - TimeUnit.MILLISECONDS); + private ApiFuture rollbackCallback(Void input) { + final SettableApiFuture backoff = SettableApiFuture.create(); + // Add a backoff delay. At first, this is 0. + firestoreExecutor.schedule( + () -> backoff.set(null), + nextBackoffAttempt.getRandomizedRetryDelay().toMillis(), + TimeUnit.MILLISECONDS); - nextBackoffAttempt = backoffAlgorithm.createNextAttempt(nextBackoffAttempt); - return ApiFutures.transformAsync( - backoff, new BackoffCallback(), MoreExecutors.directExecutor()); - } + nextBackoffAttempt = backoffAlgorithm.createNextAttempt(nextBackoffAttempt); + return ApiFutures.transformAsync( + backoff, TransactionRunner.this::backoffCallback, MoreExecutors.directExecutor()); } /** @@ -169,125 +163,103 @@ public void onSuccess(T result) { } /** A callback that invokes the BeginTransaction callback. */ - private class BackoffCallback implements ApiAsyncFunction { - @Override - public ApiFuture apply(Void input) { - return ApiFutures.transformAsync( - transaction.begin(), new BeginTransactionCallback(), MoreExecutors.directExecutor()); - } + private ApiFuture backoffCallback(Void input) { + return ApiFutures.transformAsync( + transaction.begin(), this::beginTransactionCallback, MoreExecutors.directExecutor()); } /** * The callback for the BeginTransaction RPC, which invokes the user callback and handles all * errors thereafter. */ - private class BeginTransactionCallback implements ApiAsyncFunction { - public ApiFuture apply(Void ignored) { - return ApiFutures.transformAsync( - invokeUserCallback(), new UserFunctionCallback(), MoreExecutors.directExecutor()); - } + private ApiFuture beginTransactionCallback(Void input) { + return ApiFutures.transformAsync( + invokeUserCallback(), this::userFunctionCallback, MoreExecutors.directExecutor()); } /** * The callback that is invoked after the user function finishes execution. It invokes the Commit * RPC. */ - private class UserFunctionCallback implements ApiAsyncFunction { - @Override - public ApiFuture apply(T userFunctionResult) { - return ApiFutures.transform( - transaction.commit(), - new CommitTransactionCallback(userFunctionResult), - MoreExecutors.directExecutor()); - } - } - - /** The callback that is invoked after the Commit RPC returns. It returns the user result. */ - private class CommitTransactionCallback implements ApiFunction, T> { - private final T userFunctionResult; - - CommitTransactionCallback(T userFunctionResult) { - this.userFunctionResult = userFunctionResult; - } - - @Override - public T apply(List input) { - span.setStatus(io.opencensus.trace.Status.OK); - span.end(); - return userFunctionResult; - } + private ApiFuture userFunctionCallback(T userFunctionResult) { + return ApiFutures.transform( + transaction.commit(), + // The callback that is invoked after the Commit RPC returns. It returns the user result. + input -> { + span.setStatus(io.opencensus.trace.Status.OK); + span.end(); + return userFunctionResult; + }, + MoreExecutors.directExecutor()); } /** A callback that restarts a transaction after an ApiException. It invokes the Rollback RPC. */ - private class RestartTransactionCallback implements ApiAsyncFunction { - public ApiFuture apply(Throwable throwable) { - if (!(throwable instanceof ApiException)) { - // This is likely a failure in the user callback. - span.setStatus(USER_CALLBACK_FAILED); - return rollbackAndReject(throwable); - } + private ApiFuture restartTransactionCallback(Throwable throwable) { + if (!(throwable instanceof ApiException)) { + // This is likely a failure in the user callback. + span.setStatus(USER_CALLBACK_FAILED); + return rollbackAndReject(throwable); + } - ApiException apiException = (ApiException) throwable; - if (transaction.hasTransactionId() && isRetryableTransactionError(apiException)) { - if (attemptsRemaining > 0) { - span.addAnnotation("retrying"); - return run(); - } else { - span.setStatus(TOO_MANY_RETRIES_STATUS); - final FirestoreException firestoreException = - FirestoreException.forApiException( - apiException, "Transaction was cancelled because of too many retries."); - return rollbackAndReject(firestoreException); - } + ApiException apiException = (ApiException) throwable; + if (transaction.hasTransactionId() && isRetryableTransactionError(apiException)) { + if (attemptsRemaining > 0) { + span.addAnnotation("retrying"); + return run(); } else { - span.setStatus(TraceUtil.statusFromApiException(apiException)); + span.setStatus(TOO_MANY_RETRIES_STATUS); final FirestoreException firestoreException = FirestoreException.forApiException( - apiException, "Transaction failed with non-retryable error"); + apiException, "Transaction was cancelled because of too many retries."); return rollbackAndReject(firestoreException); } + } else { + span.setStatus(TraceUtil.statusFromApiException(apiException)); + final FirestoreException firestoreException = + FirestoreException.forApiException( + apiException, "Transaction failed with non-retryable error"); + return rollbackAndReject(firestoreException); } + } - /** Determines whether the provided error is considered retryable. */ - private boolean isRetryableTransactionError(ApiException exception) { - switch (exception.getStatusCode().getCode()) { - // This list is based on - // https://github.com/firebase/firebase-js-sdk/blob/c822e78b00dd3420dcc749beb2f09a947aa4a344/packages/firestore/src/core/transaction_runner.ts#L112 - case ABORTED: - case CANCELLED: - case UNKNOWN: - case DEADLINE_EXCEEDED: - case INTERNAL: - case UNAVAILABLE: - case UNAUTHENTICATED: - case RESOURCE_EXHAUSTED: - return true; - case INVALID_ARGUMENT: - // The Firestore backend uses "INVALID_ARGUMENT" for transactions IDs that have expired. - // While INVALID_ARGUMENT is generally not retryable, we retry this specific case. - return exception.getMessage().contains("transaction has expired"); - default: - return false; - } + /** Determines whether the provided error is considered retryable. */ + private static boolean isRetryableTransactionError(ApiException exception) { + switch (exception.getStatusCode().getCode()) { + // This list is based on + // https://github.com/firebase/firebase-js-sdk/blob/c822e78b00dd3420dcc749beb2f09a947aa4a344/packages/firestore/src/core/transaction_runner.ts#L112 + case ABORTED: + case CANCELLED: + case UNKNOWN: + case DEADLINE_EXCEEDED: + case INTERNAL: + case UNAVAILABLE: + case UNAUTHENTICATED: + case RESOURCE_EXHAUSTED: + return true; + case INVALID_ARGUMENT: + // The Firestore backend uses "INVALID_ARGUMENT" for transactions IDs that have expired. + // While INVALID_ARGUMENT is generally not retryable, we retry this specific case. + return exception.getMessage().contains("transaction has expired"); + default: + return false; } + } + /** Rolls the transaction back and returns the error. */ + private ApiFuture rollbackAndReject(final Throwable throwable) { + final SettableApiFuture failedTransaction = SettableApiFuture.create(); - /** Rolls the transaction back and returns the error. */ - private ApiFuture rollbackAndReject(final Throwable throwable) { - final SettableApiFuture failedTransaction = SettableApiFuture.create(); - - if (transaction.hasTransactionId()) { - // We use `addListener()` since we want to return the original exception regardless of - // whether rollback() succeeds. - transaction - .rollback() - .addListener( - () -> failedTransaction.setException(throwable), MoreExecutors.directExecutor()); - } else { - failedTransaction.setException(throwable); - } - - span.end(); - return failedTransaction; + if (transaction.hasTransactionId()) { + // We use `addListener()` since we want to return the original exception regardless of + // whether rollback() succeeds. + transaction + .rollback() + .addListener( + () -> failedTransaction.setException(throwable), MoreExecutors.directExecutor()); + } else { + failedTransaction.setException(throwable); } + + span.end(); + return failedTransaction; } } diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java index d7f98808a1..87cf833079 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/UpdateBuilder.java @@ -161,7 +161,10 @@ private T performCreate( private void verifyNotCommitted() { Preconditions.checkState( - !isCommitted(), "Cannot modify a WriteBatch that has already been committed."); + !isCommitted(), + String.format( + "Cannot modify a %s that has already been committed.", + this.getClass().getSimpleName())); } /** diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java index b0c30d9d74..5e472ac97b 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java @@ -99,19 +99,250 @@ *

Note: close() needs to be called on the FirestoreClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
GetDocument

Gets a single document.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getDocument(GetDocumentRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getDocumentCallable() + *
+ *
ListDocuments

Lists documents.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listDocuments(ListDocumentsRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listDocumentsPagedCallable() + *
  • listDocumentsCallable() + *
+ *
UpdateDocument

Updates or inserts a document.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateDocument(UpdateDocumentRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateDocument(Document document, DocumentMask updateMask) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateDocumentCallable() + *
+ *
DeleteDocument

Deletes a document.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteDocument(DeleteDocumentRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteDocument(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteDocumentCallable() + *
+ *
BatchGetDocuments

Gets multiple documents. + *

Documents returned by this method are not guaranteed to be returned in the same order that they were requested.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • batchGetDocumentsCallable() + *
+ *
BeginTransaction

Starts a new transaction.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • beginTransaction(BeginTransactionRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • beginTransaction(String database) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • beginTransactionCallable() + *
+ *
Commit

Commits a transaction, while optionally updating documents.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • commit(CommitRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • commit(String database, List<Write> writes) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • commitCallable() + *
+ *
Rollback

Rolls back a transaction.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • rollback(RollbackRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • rollback(String database, ByteString transaction) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • rollbackCallable() + *
+ *
RunQuery

Runs a query.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • runQueryCallable() + *
+ *
RunAggregationQuery

Runs an aggregation query. + *

Rather than producing [Document][google.firestore.v1.Document] results like [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery], this API allows running an aggregation to produce a series of [AggregationResult][google.firestore.v1.AggregationResult] server-side. + *

High-Level Example: + *

``` -- Return the number of documents in table given a filter. SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ```

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • runAggregationQueryCallable() + *
+ *
PartitionQuery

Partitions a query by returning partition cursors that can be used to run the query in parallel. The returned partition cursors are split points that can be used by RunQuery as starting/end points for the query results.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • partitionQuery(PartitionQueryRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • partitionQueryPagedCallable() + *
  • partitionQueryCallable() + *
+ *
Write

Streams batches of document updates and deletes, in order. This method is only available via gRPC or WebChannel (not REST).

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • writeCallable() + *
+ *
Listen

Listens to changes. This method is only available via gRPC or WebChannel (not REST).

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listenCallable() + *
+ *
ListCollectionIds

Lists all the collection IDs underneath a document.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listCollectionIds(ListCollectionIdsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listCollectionIds(String parent) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listCollectionIdsPagedCallable() + *
  • listCollectionIdsCallable() + *
+ *
BatchWrite

Applies a batch of write operations. + *

The BatchWrite method does not apply the write operations atomically and can apply them out of order. Method does not allow more than one write per document. Each write succeeds or fails independently. See the [BatchWriteResponse][google.firestore.v1.BatchWriteResponse] for the success status of each write. + *

If you require an atomically applied set of writes, use [Commit][google.firestore.v1.Firestore.Commit] instead.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • batchWrite(BatchWriteRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • batchWriteCallable() + *
+ *
CreateDocument

Creates a new document.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createDocument(CreateDocumentRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createDocumentCallable() + *
+ *
* *

See the individual methods for example code. * @@ -875,7 +1106,11 @@ public final UnaryCallable rollbackCallable() { * // - It may require specifying regional endpoints when creating the service client as shown in * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { - * RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunQueryRequest request = + * RunQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setMode(QueryMode.forNumber(0)) + * .build(); * ServerStream stream = firestoreClient.runQueryCallable().call(request); * for (RunQueryResponse response : stream) { * // Do something when a response is received. @@ -911,7 +1146,10 @@ public final ServerStreamingCallable runQuery * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * RunAggregationQueryRequest request = - * RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + * RunAggregationQueryRequest.newBuilder() + * .setParent("parent-995424086") + * .setMode(QueryMode.forNumber(0)) + * .build(); * ServerStream stream = * firestoreClient.runAggregationQueryCallable().call(request); * for (RunAggregationQueryResponse response : stream) { diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java index a9548229bc..65345559b0 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java @@ -426,6 +426,12 @@ public FirestoreStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "firestore"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); diff --git a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json index c7df9f03cc..75027fdfc9 100644 --- a/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json +++ b/google-cloud-firestore/src/main/resources/META-INF/native-image/com.google.cloud.firestore.v1/reflect-config.json @@ -1070,6 +1070,51 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.firestore.v1.QueryMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.QueryPlan", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.QueryPlan$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ResultSetStats", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.firestore.v1.ResultSetStats$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.firestore.v1.RollbackRequest", "queryAllDeclaredConstructors": true, diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java index c8f8875f92..90e29d50f5 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/BulkWriterTest.java @@ -57,6 +57,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import javax.annotation.Nonnull; +import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -121,6 +122,8 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) private DocumentReference doc1; private DocumentReference doc2; + private ScheduledExecutorService timeoutExecutor; + public static ApiFuture successResponse(int updateTimeSeconds) { BatchWriteResponse.Builder response = BatchWriteResponse.newBuilder(); response.addWriteResultsBuilder().getUpdateTimeBuilder().setSeconds(updateTimeSeconds).build(); @@ -155,7 +158,7 @@ public void before() { lenient().doReturn(immediateExecutor).when(firestoreRpc).getExecutor(); testExecutor = Executors.newSingleThreadScheduledExecutor(); - final ScheduledExecutorService timeoutExecutor = + timeoutExecutor = new ScheduledThreadPoolExecutor(1) { @Override @Nonnull @@ -170,6 +173,21 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) doc2 = firestoreMock.document("coll/doc2"); } + @After + public void after() throws InterruptedException { + shutdownScheduledExecutorService(timeoutExecutor); + } + + void shutdownScheduledExecutorService(ScheduledExecutorService executorService) + throws InterruptedException { + // Wait for the executor to finish after each test. + // + // This ensures the executor service is shut down properly within the given timeout, and thereby + // avoids potential hangs caused by lingering threads. Note that if a given thread is terminated + // because of the timeout, the associated test will fail, which is what we want. + executorService.awaitTermination(100, TimeUnit.MILLISECONDS); + } + @Test public void hasSetMethod() throws Exception { ResponseStubber responseStubber = @@ -968,7 +986,7 @@ public void doesNotSendBatchesIfDoingSoExceedsRateLimit() throws Exception { // future at the end of the test to ensure that the timeout was called. final SettableApiFuture timeoutCalledFuture = SettableApiFuture.create(); - final ScheduledExecutorService timeoutExecutor = + final ScheduledExecutorService customExecutor = new ScheduledThreadPoolExecutor(1) { @Override @Nonnull @@ -994,7 +1012,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) firestoreMock.bulkWriter( BulkWriterOptions.builder() .setInitialOpsPerSecond(5) - .setExecutor(timeoutExecutor) + .setExecutor(customExecutor) .build()); for (int i = 0; i < 600; ++i) { @@ -1002,6 +1020,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) } bulkWriter.flush(); timeoutCalledFuture.get(); + shutdownScheduledExecutorService(customExecutor); } @Test @@ -1097,7 +1116,7 @@ public void retriesWritesWhenBatchWriteFailsWithRetryableError() throws Exceptio public void failsWritesAfterAllRetryAttemptsFail() throws Exception { final int[] retryAttempts = {0}; final int[] scheduleWithDelayCount = {0}; - final ScheduledExecutorService timeoutExecutor = + final ScheduledExecutorService customExecutor = new ScheduledThreadPoolExecutor(1) { @Override @Nonnull @@ -1127,7 +1146,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) ArgumentMatchers.>any()); bulkWriter = - firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(timeoutExecutor).build()); + firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(customExecutor).build()); ApiFuture result = bulkWriter.set(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); bulkWriter.flush().get(); @@ -1139,6 +1158,8 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) assertEquals(BulkWriter.MAX_RETRY_ATTEMPTS + 1, retryAttempts[0]); // The first attempt should not have a delay. assertEquals(BulkWriter.MAX_RETRY_ATTEMPTS, scheduleWithDelayCount[0]); + } finally { + shutdownScheduledExecutorService(customExecutor); } } @@ -1146,7 +1167,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) public void appliesMaxBackoffOnRetriesForResourceExhausted() throws Exception { final int[] retryAttempts = {0}; final int[] scheduleWithDelayCount = {0}; - final ScheduledExecutorService timeoutExecutor = + final ScheduledExecutorService customExecutor = new ScheduledThreadPoolExecutor(1) { @Override @Nonnull @@ -1177,7 +1198,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) ArgumentMatchers.>any()); bulkWriter = - firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(timeoutExecutor).build()); + firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(customExecutor).build()); bulkWriter.addWriteErrorListener(error -> error.getFailedAttempts() < 5); ApiFuture result = bulkWriter.create(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); @@ -1191,6 +1212,8 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) assertEquals(5, retryAttempts[0]); // The first attempt should not have a delay. assertEquals(4, scheduleWithDelayCount[0]); + } finally { + shutdownScheduledExecutorService(customExecutor); } } @@ -1203,7 +1226,7 @@ public void usesHighestBackoffFoundInBatch() throws Exception { * BulkWriterOperation.DEFAULT_BACKOFF_FACTOR) }; final int[] retryAttempts = {0}; - final ScheduledExecutorService timeoutExecutor = + final ScheduledExecutorService customExecutor = new ScheduledThreadPoolExecutor(1) { @Override @Nonnull @@ -1244,7 +1267,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) responseStubber.initializeStub(batchWriteCapture, firestoreMock); bulkWriter = - firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(timeoutExecutor).build()); + firestoreMock.bulkWriter(BulkWriterOptions.builder().setExecutor(customExecutor).build()); bulkWriter.addWriteErrorListener(error -> error.getFailedAttempts() < 5); bulkWriter.create(doc1, LocalFirestoreHelper.SINGLE_FIELD_MAP); @@ -1252,6 +1275,7 @@ public ScheduledFuture schedule(Runnable command, long delay, TimeUnit unit) bulkWriter.close(); responseStubber.verifyAllRequestsSent(); assertEquals(2, retryAttempts[0]); + shutdownScheduledExecutorService(customExecutor); } @Test diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java index d4df6220b4..638fa19ba0 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/FirestoreTest.java @@ -23,7 +23,7 @@ import static com.google.cloud.firestore.LocalFirestoreHelper.arrayUnion; import static com.google.cloud.firestore.LocalFirestoreHelper.commit; import static com.google.cloud.firestore.LocalFirestoreHelper.commitResponse; -import static com.google.cloud.firestore.LocalFirestoreHelper.getAllResponse; +import static com.google.cloud.firestore.LocalFirestoreHelper.getAllResponseWithoutOnComplete; import static com.google.cloud.firestore.LocalFirestoreHelper.transform; import static com.google.cloud.firestore.LocalFirestoreHelper.update; import static org.junit.Assert.assertEquals; @@ -80,7 +80,7 @@ public void encodeFieldPath() { @Test public void illegalFieldPath() throws Exception { - doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) + doAnswer(getAllResponseWithoutOnComplete(SINGLE_FIELD_PROTO)) .when(firestoreMock) .streamRequest( getAllCapture.capture(), @@ -110,7 +110,7 @@ public void exposesOptions() { @Test public void getAll() throws Exception { doAnswer( - getAllResponse( + getAllResponseWithoutOnComplete( SINGLE_FIELD_PROTO, SINGLE_FIELD_PROTO, SINGLE_FIELD_PROTO, SINGLE_FIELD_PROTO)) .when(firestoreMock) .streamRequest( @@ -132,7 +132,7 @@ public void getAll() throws Exception { @Test public void getAllWithFieldMask() throws Exception { - doAnswer(getAllResponse(SINGLE_FIELD_PROTO)) + doAnswer(getAllResponseWithoutOnComplete(SINGLE_FIELD_PROTO)) .when(firestoreMock) .streamRequest( getAllCapture.capture(), diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java index b86cc0bc95..a871884020 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/LocalFirestoreHelper.java @@ -262,6 +262,16 @@ public static Map map() { public static Answer getAllResponse( final Map... fields) { + return getAllResponseImpl(true, fields); + } + + public static Answer getAllResponseWithoutOnComplete( + final Map... fields) { + return getAllResponseImpl(false, fields); + } + + public static Answer getAllResponseImpl( + boolean withOnComplete, final Map... fields) { BatchGetDocumentsResponse[] responses = new BatchGetDocumentsResponse[fields.length]; for (int i = 0; i < fields.length; ++i) { @@ -281,7 +291,13 @@ public static Answer getAllResponse( responses[i] = response.build(); } - return streamingResponse(responses, null); + if (withOnComplete) { + return streamingResponse(responses, null); + } else { + // Verify with logical termination, the return of results no longer depends on calling + // OnComplete. + return streamingResponseWithoutOnComplete(responses); + } } public static ApiFuture rollbackResponse() { @@ -1242,4 +1258,20 @@ public static List bundleToElementList(ByteBuffer bundle) { return result; } + + @FunctionalInterface + interface VoidFunction { + void apply(); + } + + static void assertException(VoidFunction voidFunction, String expectedErrorMessage) { + String errorMessage = ""; + try { + voidFunction.apply(); + } catch (Exception e) { + errorMessage = e.getMessage(); + } finally { + assertEquals(errorMessage, expectedErrorMessage); + } + } } diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java index 5d485c32b3..19b3107ae8 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/RecursiveDeleteTest.java @@ -86,7 +86,7 @@ @RunWith(MockitoJUnitRunner.class) public class RecursiveDeleteTest { - @Rule public Timeout timeout = new Timeout(5, TimeUnit.SECONDS); + @Rule public Timeout timeout = new Timeout(10, TimeUnit.SECONDS); @Spy private final FirestoreRpc firestoreRpc = Mockito.mock(FirestoreRpc.class); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java index eeef59e0c8..df9c72cedb 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/TransactionTest.java @@ -36,6 +36,7 @@ import static com.google.cloud.firestore.LocalFirestoreHelper.rollbackResponse; import static com.google.cloud.firestore.LocalFirestoreHelper.set; import static com.google.cloud.firestore.LocalFirestoreHelper.update; +import static com.google.cloud.firestore.it.ITQueryTest.map; import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -959,6 +960,43 @@ public void getShouldThrowWhenInvokedAfterAWriteWithAnAggregateQuery() throws Ex assertThat(executionException.getCause()).isInstanceOf(IllegalStateException.class); } + @Test + public void givesProperErrorMessageForCommittedTransaction() throws Exception { + doReturn(beginResponse()) + .doReturn(commitResponse(0, 0)) + .when(firestoreMock) + .sendRequest( + requestCapture.capture(), ArgumentMatchers.>any()); + String expectedErrorMessage = "Cannot modify a Transaction that has already been committed."; + + DocumentReference docRef = firestoreMock.collection("foo").document("bar"); + + // Commit a transaction. + Transaction t = firestoreMock.runTransaction(transaction -> transaction).get(); + + // Then run other operations in the same transaction. + LocalFirestoreHelper.assertException( + () -> { + t.set(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + t.update(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + t.create(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + t.delete(docRef); + }, + expectedErrorMessage); + } + private ApiException exception(Status.Code code, boolean shouldRetry) { return exception(code, "Test exception", shouldRetry); } diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java index 92ca905c79..1fec528406 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/WriteBatchTest.java @@ -341,4 +341,43 @@ public void deleteDocument() throws Exception { CommitRequest commitRequest = commitCapture.getValue(); assertEquals(commit(writes.toArray(new Write[] {})), commitRequest); } + + @Test + public void throwsWhenModifyingACommittedWriteBatch() throws Exception { + doReturn(commitResponse(0, 0)) + .when(firestoreMock) + .sendRequest( + commitCapture.capture(), + ArgumentMatchers.>any()); + + String expectedErrorMessage = "Cannot modify a WriteBatch that has already been committed."; + + DocumentReference docRef = firestoreMock.collection("foo").document("bar"); + + // Commit a batch. + WriteBatch batch = firestoreMock.batch(); + batch.commit().get(); + + // Then run other operations in the same batch. + LocalFirestoreHelper.assertException( + () -> { + batch.set(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + batch.update(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + batch.create(docRef, map("foo", "bar")); + }, + expectedErrorMessage); + LocalFirestoreHelper.assertException( + () -> { + batch.delete(docRef); + }, + expectedErrorMessage); + } } diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBaseTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBaseTest.java index 2a238bba2e..a9f0bfb2f3 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBaseTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBaseTest.java @@ -16,10 +16,17 @@ package com.google.cloud.firestore.it; +import static com.google.cloud.firestore.LocalFirestoreHelper.autoId; +import static com.google.cloud.firestore.it.ITQueryTest.map; + +import com.google.cloud.firestore.DocumentReference; import com.google.cloud.firestore.Firestore; import com.google.cloud.firestore.FirestoreOptions; import com.google.cloud.firestore.FirestoreSpy; +import com.google.cloud.firestore.ListenerRegistration; import com.google.common.base.Preconditions; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; import org.junit.After; @@ -29,13 +36,22 @@ @RunWith(JUnit4.class) public abstract class ITBaseTest { + + /** + * Firestore databases can be subject to a ~30s "cold start" delay if they have not been used + * recently, so before any tests run we "prime" the backend. + */ + private static final long PRIMING_TIMEOUT_MS = 45000; + private static final Logger logger = Logger.getLogger(ITBaseTest.class.getName()); + protected Firestore firestore; protected FirestoreSpy firestoreSpy; private FirestoreOptions firestoreOptions; + private boolean backendPrimed = false; @Before - public void before() { + public void before() throws Exception { FirestoreOptions.Builder optionsBuilder = FirestoreOptions.newBuilder(); String namedDb = System.getProperty("FIRESTORE_NAMED_DATABASE"); @@ -48,6 +64,53 @@ public void before() { firestoreOptions = optionsBuilder.build(); firestore = firestoreOptions.getService(); + primeBackend(); + } + + public void primeBackend() throws Exception { + if (backendPrimed) return; + + backendPrimed = true; + CompletableFuture watchInitialized = new CompletableFuture<>(); + CompletableFuture watchUpdateReceived = new CompletableFuture<>(); + DocumentReference docRef = firestore.collection(autoId()).document(); + ListenerRegistration listenerRegistration = + docRef.addSnapshotListener( + (snapshot, error) -> { + if (error != null) { + logger.log( + Level.SEVERE, "Prime backend received error in snapshot listener.", error); + if (!watchInitialized.isDone()) { + watchInitialized.completeExceptionally(error); + } else if (!watchUpdateReceived.isDone()) { + watchUpdateReceived.completeExceptionally(error); + } + } + if (snapshot != null) { + if ("done".equals(snapshot.get("value"))) { + watchUpdateReceived.complete(null); + } else { + watchInitialized.complete(null); + } + } + }); + + // Wait for watch to initialize and deliver first event. + watchInitialized.get(PRIMING_TIMEOUT_MS, TimeUnit.MILLISECONDS); + + // Use a transaction to perform a write without triggering any local events. + docRef + .getFirestore() + .runTransaction( + transaction -> { + transaction.set(docRef, map("value", "done")); + return null; + }); + + // Wait to see the write on the watch stream. + watchUpdateReceived.get(PRIMING_TIMEOUT_MS, TimeUnit.MILLISECONDS); + + listenerRegistration.remove(); } @After diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBulkWriterTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBulkWriterTest.java index b71067ac8b..8e51d798e4 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBulkWriterTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITBulkWriterTest.java @@ -48,7 +48,7 @@ public class ITBulkWriterTest extends ITBaseTest { @Rule public TestName testName = new TestName(); @Before - public void before() { + public void before() throws Exception { super.before(); randomColl = firestore.collection( diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryAggregationsTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryAggregationsTest.java index 2651514464..7659d46562 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryAggregationsTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryAggregationsTest.java @@ -28,6 +28,7 @@ import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; +import com.google.api.core.ApiFuture; import com.google.cloud.firestore.*; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -1081,4 +1082,29 @@ public void aggregateInequalityFilterNoOrderByDocumentSnapshotReference2() throw AggregateQuerySnapshot snapshot = query.get().get(); assertThat(snapshot.get(sum("num"))).isEqualTo(7); } + + @Test + public void aggregateQueryShouldFailWithMessageWithConsoleLinkIfMissingIndex() { + assumeFalse( + "Skip this test when running against the Firestore emulator because the Firestore emulator " + + "does not use indexes and never fails with a 'missing index' error", + isRunningAgainstFirestoreEmulator(firestore)); + + CollectionReference collection = testCollection(); + Query compositeIndexQuery = collection.whereEqualTo("field1", 42).whereLessThan("field2", 99); + AggregateQuery compositeIndexAggregateQuery = + compositeIndexQuery.aggregate( + AggregateField.count(), AggregateField.sum("pages"), AggregateField.average("pages")); + ApiFuture future = compositeIndexAggregateQuery.get(); + + ExecutionException executionException = assertThrows(ExecutionException.class, future::get); + + Throwable throwable = executionException.getCause(); + assertThat(throwable).hasMessageThat().ignoringCase().contains("index"); + // TODO(b/316359394) Remove this check for the default databases once cl/582465034 is rolled out + // to production. + if (collection.getFirestore().getOptions().getDatabaseId().equals("(default)")) { + assertThat(throwable).hasMessageThat().contains("https://console.firebase.google.com"); + } + } } diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryCountTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryCountTest.java index 22e371ca22..fce1d87d6a 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryCountTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryCountTest.java @@ -22,6 +22,7 @@ import static com.google.common.truth.Truth.assertThat; import static java.util.Collections.singletonMap; import static org.junit.Assert.assertThrows; +import static org.junit.Assume.assumeFalse; import static org.junit.Assume.assumeTrue; import com.google.api.core.ApiFuture; @@ -369,6 +370,29 @@ public void aggregateQueryInATransactionShouldRespectReadTime() throws Exception assertThat(transactionCount).isEqualTo(5); } + @Test + public void countQueryShouldFailWithMessageWithConsoleLinkIfMissingIndex() { + assumeFalse( + "Skip this test when running against the Firestore emulator because the Firestore emulator " + + "does not use indexes and never fails with a 'missing index' error", + isRunningAgainstFirestoreEmulator(firestore)); + + CollectionReference collection = createEmptyCollection(); + Query compositeIndexQuery = collection.whereEqualTo("field1", 42).whereLessThan("field2", 99); + AggregateQuery compositeIndexCountQuery = compositeIndexQuery.count(); + ApiFuture future = compositeIndexCountQuery.get(); + + ExecutionException executionException = assertThrows(ExecutionException.class, future::get); + + Throwable throwable = executionException.getCause(); + assertThat(throwable).hasMessageThat().ignoringCase().contains("index"); + // TODO(b/316359394) Remove this check for the default databases once cl/582465034 is rolled out + // to production. + if (collection.getFirestore().getOptions().getDatabaseId().equals("(default)")) { + assertThat(throwable).hasMessageThat().contains("https://console.firebase.google.com"); + } + } + private CollectionReference createEmptyCollection() { String collectionPath = "java-" + testName.getMethodName() + "-" + autoId(); return firestore.collection(collectionPath); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryWatchTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryWatchTest.java index bded062ff4..544ec0c70a 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryWatchTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITQueryWatchTest.java @@ -65,13 +65,12 @@ @RunWith(JUnit4.class) public final class ITQueryWatchTest extends ITBaseTest { - @Rule public TestName testName = new TestName(); private CollectionReference randomColl; @Before - public void before() { + public void before() throws Exception { super.before(); useFirestoreSpy(); String autoId = LocalFirestoreHelper.autoId(); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java index a7d84d4418..2c092918b6 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java @@ -126,7 +126,7 @@ public class ITSystemTest extends ITBaseTest { private DocumentReference randomDoc; @Before - public void before() { + public void before() throws Exception { super.before(); randomColl = @@ -368,6 +368,77 @@ public void defaultQuery() throws Exception { assertEquals("bar", documents.next().get("foo")); } + @Test + public void defaultQueryStream() throws Exception { + addDocument("foo", "bar"); + addDocument("foo", "bar"); + + final Semaphore semaphore = new Semaphore(0); + final Iterator iterator = Arrays.asList("bar", "bar").iterator(); + randomColl.stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iterator.next(), documentSnapshot.get("foo")); + } + + @Override + public void onError(Throwable throwable) {} + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iterator.hasNext()); + } + + @Test + public void largeQuery() throws Exception { + int count = 100; + while (count-- > 0) { + addDocument("foo", "bar"); + } + + QuerySnapshot querySnapshot = randomColl.get().get(); + assertEquals(100, querySnapshot.size()); + } + + @Test + public void largeQueryStream() throws Exception { + int count = 100; + while (count-- > 0) { + addDocument("foo", "bar"); + } + + final Semaphore semaphore = new Semaphore(0); + final int[] docCount = {0}; + randomColl.stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + docCount[0]++; + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertEquals(100, docCount[0]); + } + @Test public void noResults() throws Exception { QuerySnapshot querySnapshot = randomColl.get().get(); @@ -375,6 +446,33 @@ public void noResults() throws Exception { assertNotNull(querySnapshot.getReadTime()); } + @Test + public void noResultsStream() throws Exception { + final Semaphore semaphore = new Semaphore(0); + final int[] docCount = {0}; + randomColl.stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + docCount[0]++; + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertEquals(0, docCount[0]); + } + @Test public void queryWithMicrosecondPrecision() throws Exception { Timestamp microsecondTimestamp = Timestamp.ofTimeSecondsAndNanos(0, 123000); @@ -412,6 +510,37 @@ public void limitQuery() throws Exception { assertEquals(asList("doc1", "doc2"), querySnapshotToIds(querySnapshot)); } + @Test + public void limitQueryStream() throws Exception { + setDocument("doc1", Collections.singletonMap("counter", 1)); + setDocument("doc2", Collections.singletonMap("counter", 2)); + setDocument("doc3", Collections.singletonMap("counter", 3)); + + final Semaphore semaphore = new Semaphore(0); + final Iterator iterator = Arrays.asList("doc1", "doc2").iterator(); + randomColl.orderBy("counter").limit(2).stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iterator.next(), documentSnapshot.getId()); + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iterator.hasNext()); + } + @Test public void limitToLastQuery() throws Exception { setDocument("doc1", Collections.singletonMap("counter", 1)); @@ -422,6 +551,47 @@ public void limitToLastQuery() throws Exception { assertEquals(asList("doc2", "doc3"), querySnapshotToIds(querySnapshot)); } + @Test + public void largerLimitQuery() throws Exception { + setDocument("doc1", Collections.singletonMap("counter", 1)); + setDocument("doc2", Collections.singletonMap("counter", 2)); + setDocument("doc3", Collections.singletonMap("counter", 3)); + + QuerySnapshot querySnapshot = randomColl.orderBy("counter").limit(4).get().get(); + assertEquals(asList("doc1", "doc2", "doc3"), querySnapshotToIds(querySnapshot)); + } + + @Test + public void largerLimitQueryStream() throws Exception { + setDocument("doc1", Collections.singletonMap("counter", 1)); + setDocument("doc2", Collections.singletonMap("counter", 2)); + setDocument("doc3", Collections.singletonMap("counter", 3)); + + final Semaphore semaphore = new Semaphore(0); + final Iterator iterator = Arrays.asList("doc1", "doc2", "doc3").iterator(); + randomColl.orderBy("counter").limit(4).stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iterator.next(), documentSnapshot.getId()); + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iterator.hasNext()); + } + @Test public void offsetQuery() throws Exception { addDocument("foo", "bar"); @@ -432,6 +602,75 @@ public void offsetQuery() throws Exception { assertEquals("bar", querySnapshot.getDocuments().get(0).get("foo")); } + @Test + public void offsetQueryStream() throws Exception { + addDocument("foo", "bar"); + addDocument("foo", "bar"); + + final Semaphore semaphore = new Semaphore(0); + final Iterator iterator = Collections.singletonList("bar").iterator(); + randomColl.offset(1).stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iterator.next(), documentSnapshot.get("foo")); + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iterator.hasNext()); + } + + @Test + public void largerOffsetQuery() throws Exception { + addDocument("foo", "bar"); + addDocument("foo", "bar"); + + QuerySnapshot querySnapshot = randomColl.offset(3).get().get(); + assertEquals(0, querySnapshot.size()); + } + + @Test + public void largerOffsetQueryStream() throws Exception { + addDocument("foo", "bar"); + addDocument("foo", "bar"); + + final Semaphore semaphore = new Semaphore(0); + final int[] docCount = {0}; + randomColl.offset(3).stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + docCount[0]++; + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertEquals(0, docCount[0]); + } + @Test public void orderByQuery() throws Exception { addDocument("foo", 1); @@ -448,6 +687,59 @@ public void orderByQuery() throws Exception { assertEquals(1L, documents.next().get("foo")); } + @Test + public void orderByQueryStream() throws Exception { + addDocument("foo", 1); + addDocument("foo", 2); + + final Semaphore semaphore = new Semaphore(0); + final Iterator iteratorAscending = Arrays.asList(1L, 2L).iterator(); + randomColl.orderBy("foo").stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iteratorAscending.next(), documentSnapshot.get("foo")); + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iteratorAscending.hasNext()); + + final Iterator iteratorDescending = Arrays.asList(2L, 1L).iterator(); + randomColl.orderBy("foo", Query.Direction.DESCENDING).stream( + new ApiStreamObserver() { + @Override + public void onNext(DocumentSnapshot documentSnapshot) { + assertEquals(iteratorDescending.next(), documentSnapshot.get("foo")); + } + + @Override + public void onError(Throwable throwable) { + fail(); + } + + @Override + public void onCompleted() { + semaphore.release(); + } + }); + + semaphore.acquire(); + // Verify the number of response + assertFalse(iteratorDescending.hasNext()); + } + @Test public void selectQuery() throws Exception { addDocument("foo", 1, "bar", 2); diff --git a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java index a0c3ecd534..4664d4c9d9 100644 --- a/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java +++ b/google-cloud-firestore/src/test/java/com/google/cloud/firestore/v1/FirestoreClientTest.java @@ -56,6 +56,8 @@ import com.google.firestore.v1.ListenResponse; import com.google.firestore.v1.PartitionQueryRequest; import com.google.firestore.v1.PartitionQueryResponse; +import com.google.firestore.v1.QueryMode; +import com.google.firestore.v1.ResultSetStats; import com.google.firestore.v1.RollbackRequest; import com.google.firestore.v1.RunAggregationQueryRequest; import com.google.firestore.v1.RunAggregationQueryResponse; @@ -505,9 +507,14 @@ public void runQueryTest() throws Exception { .setDocument(Document.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setSkippedResults(880286183) + .setStats(ResultSetStats.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setMode(QueryMode.forNumber(0)) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -523,7 +530,11 @@ public void runQueryTest() throws Exception { public void runQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); - RunQueryRequest request = RunQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunQueryRequest request = + RunQueryRequest.newBuilder() + .setParent("parent-995424086") + .setMode(QueryMode.forNumber(0)) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -547,10 +558,14 @@ public void runAggregationQueryTest() throws Exception { .setResult(AggregationResult.newBuilder().build()) .setTransaction(ByteString.EMPTY) .setReadTime(Timestamp.newBuilder().build()) + .setStats(ResultSetStats.newBuilder().build()) .build(); mockFirestore.addResponse(expectedResponse); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setMode(QueryMode.forNumber(0)) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -568,7 +583,10 @@ public void runAggregationQueryExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFirestore.addException(exception); RunAggregationQueryRequest request = - RunAggregationQueryRequest.newBuilder().setParent("parent-995424086").build(); + RunAggregationQueryRequest.newBuilder() + .setParent("parent-995424086") + .setMode(QueryMode.forNumber(0)) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); diff --git a/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml b/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml index 6eb076a38b..f5e990727d 100644 --- a/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml +++ b/grpc-google-cloud-firestore-admin-v1/clirr-ignored-differences.xml @@ -4,6 +4,6 @@ 7012 com/google/firestore/admin/v1/FirestoreAdminGrpc* - *createDatabase(com.google.firestore.admin.v1.CreateDatabaseRequest, io.grpc.stub.StreamObserver) + *deleteDatabase(com.google.firestore.admin.v1.DeleteDatabaseRequest, io.grpc.stub.StreamObserver) diff --git a/grpc-google-cloud-firestore-admin-v1/pom.xml b/grpc-google-cloud-firestore-admin-v1/pom.xml index b74964aac2..b979af7393 100644 --- a/grpc-google-cloud-firestore-admin-v1/pom.xml +++ b/grpc-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 grpc-google-cloud-firestore-admin-v1 GRPC library for grpc-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java b/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java index baa79e6544..a12330a38e 100644 --- a/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java +++ b/grpc-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminGrpc.java @@ -619,6 +619,49 @@ private FirestoreAdminGrpc() {} return getUpdateDatabaseMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteDatabaseRequest, com.google.longrunning.Operation> + getDeleteDatabaseMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteDatabase", + requestType = com.google.firestore.admin.v1.DeleteDatabaseRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteDatabaseRequest, com.google.longrunning.Operation> + getDeleteDatabaseMethod() { + io.grpc.MethodDescriptor< + com.google.firestore.admin.v1.DeleteDatabaseRequest, com.google.longrunning.Operation> + getDeleteDatabaseMethod; + if ((getDeleteDatabaseMethod = FirestoreAdminGrpc.getDeleteDatabaseMethod) == null) { + synchronized (FirestoreAdminGrpc.class) { + if ((getDeleteDatabaseMethod = FirestoreAdminGrpc.getDeleteDatabaseMethod) == null) { + FirestoreAdminGrpc.getDeleteDatabaseMethod = + getDeleteDatabaseMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDatabase")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.firestore.admin.v1.DeleteDatabaseRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FirestoreAdminMethodDescriptorSupplier("DeleteDatabase")) + .build(); + } + } + } + return getDeleteDatabaseMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static FirestoreAdminStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -798,7 +841,8 @@ default void updateField( * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` . + * with the filter set to `indexConfig.usesAncestorConfig:false or + * `ttlConfig:*`. * */ default void listFields( @@ -905,6 +949,20 @@ default void updateDatabase( io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getUpdateDatabaseMethod(), responseObserver); } + + /** + * + * + *

+     * Deletes a database.
+     * 
+ */ + default void deleteDatabase( + com.google.firestore.admin.v1.DeleteDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteDatabaseMethod(), responseObserver); + } } /** @@ -1099,7 +1157,8 @@ public void updateField( * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` . + * with the filter set to `indexConfig.usesAncestorConfig:false or + * `ttlConfig:*`. * */ public void listFields( @@ -1219,6 +1278,22 @@ public void updateDatabase( request, responseObserver); } + + /** + * + * + *
+     * Deletes a database.
+     * 
+ */ + public void deleteDatabase( + com.google.firestore.admin.v1.DeleteDatabaseRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteDatabaseMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -1364,7 +1439,8 @@ public com.google.longrunning.Operation updateField( * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` . + * with the filter set to `indexConfig.usesAncestorConfig:false or + * `ttlConfig:*`. * */ public com.google.firestore.admin.v1.ListFieldsResponse listFields( @@ -1463,6 +1539,19 @@ public com.google.longrunning.Operation updateDatabase( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getUpdateDatabaseMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Deletes a database.
+     * 
+ */ + public com.google.longrunning.Operation deleteDatabase( + com.google.firestore.admin.v1.DeleteDatabaseRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteDatabaseMethod(), getCallOptions(), request); + } } /** @@ -1609,7 +1698,8 @@ protected FirestoreAdminFutureStub build( * only supports listing fields that have been explicitly overridden. To issue * this query, call * [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - * with the filter set to `indexConfig.usesAncestorConfig:false` . + * with the filter set to `indexConfig.usesAncestorConfig:false or + * `ttlConfig:*`. * */ public com.google.common.util.concurrent.ListenableFuture< @@ -1711,6 +1801,19 @@ protected FirestoreAdminFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateDatabaseMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Deletes a database.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteDatabase(com.google.firestore.admin.v1.DeleteDatabaseRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteDatabaseMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_INDEX = 0; @@ -1726,6 +1829,7 @@ protected FirestoreAdminFutureStub build( private static final int METHODID_GET_DATABASE = 10; private static final int METHODID_LIST_DATABASES = 11; private static final int METHODID_UPDATE_DATABASE = 12; + private static final int METHODID_DELETE_DATABASE = 13; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1813,6 +1917,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.firestore.admin.v1.UpdateDatabaseRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_DELETE_DATABASE: + serviceImpl.deleteDatabase( + (com.google.firestore.admin.v1.DeleteDatabaseRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -1912,6 +2021,12 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.firestore.admin.v1.UpdateDatabaseRequest, com.google.longrunning.Operation>(service, METHODID_UPDATE_DATABASE))) + .addMethod( + getDeleteDatabaseMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.firestore.admin.v1.DeleteDatabaseRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_DATABASE))) .build(); } @@ -1976,6 +2091,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetDatabaseMethod()) .addMethod(getListDatabasesMethod()) .addMethod(getUpdateDatabaseMethod()) + .addMethod(getDeleteDatabaseMethod()) .build(); } } diff --git a/grpc-google-cloud-firestore-v1/pom.xml b/grpc-google-cloud-firestore-v1/pom.xml index 6b03a133fd..cb1b195683 100644 --- a/grpc-google-cloud-firestore-v1/pom.xml +++ b/grpc-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 grpc-google-cloud-firestore-v1 GRPC library for grpc-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/pom.xml b/pom.xml index ef1e72a9d1..5001fae837 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-firestore-parent pom - 3.15.7 + 3.16.0 Google Cloud Firestore Parent https://github.com/googleapis/java-firestore @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.6.0 + 1.7.1 @@ -150,38 +150,38 @@ com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 com.google.cloud google-cloud-firestore - 3.15.7 + 3.16.0 com.google.cloud proto-google-cloud-firestore-bundle-v1 - 3.15.7 + 3.16.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 com.google.api.grpc grpc-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 com.google.api.grpc grpc-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 com.google.cloud google-cloud-shared-dependencies - 3.20.0 + 3.21.0 pom import diff --git a/proto-google-cloud-firestore-admin-v1/pom.xml b/proto-google-cloud-firestore-admin-v1/pom.xml index c51498ca98..ba1e334c7f 100644 --- a/proto-google-cloud-firestore-admin-v1/pom.xml +++ b/proto-google-cloud-firestore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-admin-v1 - 3.15.7 + 3.16.0 proto-google-cloud-firestore-admin-v1 PROTO library for proto-google-cloud-firestore-admin-v1 com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequest.java index 7532f2a50f..ebc3fd6028 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequest.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequest.java @@ -188,7 +188,11 @@ public com.google.firestore.admin.v1.DatabaseOrBuilder getDatabaseOrBuilder() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -214,7 +218,11 @@ public java.lang.String getDatabaseId() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -962,7 +970,11 @@ public com.google.firestore.admin.v1.DatabaseOrBuilder getDatabaseOrBuilder() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -987,7 +999,11 @@ public java.lang.String getDatabaseId() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1012,7 +1028,11 @@ public com.google.protobuf.ByteString getDatabaseIdBytes() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1036,7 +1056,11 @@ public Builder setDatabaseId(java.lang.String value) { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -1056,7 +1080,11 @@ public Builder clearDatabaseId() { * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequestOrBuilder.java index 0161cfbf0f..c86d9ba923 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequestOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/CreateDatabaseRequestOrBuilder.java @@ -102,7 +102,11 @@ public interface CreateDatabaseRequestOrBuilder * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -117,7 +121,11 @@ public interface CreateDatabaseRequestOrBuilder * Required. The ID to use for the database, which will become the final * component of the database's resource name. * - * The value must be set to "(default)". + * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. * * * string database_id = 3 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Database.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Database.java index 9cb562e2a1..2578830110 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Database.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Database.java @@ -23,8 +23,6 @@ * *
  * A Cloud Firestore Database.
- * Currently only one database is allowed per cloud project; this database
- * must have a `database_id` of '(default)'.
  * 
* * Protobuf type {@code google.firestore.admin.v1.Database} @@ -41,11 +39,14 @@ private Database(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Database() { name_ = ""; + uid_ = ""; locationId_ = ""; type_ = 0; concurrencyMode_ = 0; + pointInTimeRecoveryEnablement_ = 0; appEngineIntegrationMode_ = 0; keyPrefix_ = ""; + deleteProtectionState_ = 0; etag_ = ""; } @@ -430,6 +431,182 @@ private ConcurrencyMode(int value) { // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Database.ConcurrencyMode) } + /** + * + * + *
+   * Point In Time Recovery feature enablement.
+   * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement} + */ + public enum PointInTimeRecoveryEnablement implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not used.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; + */ + POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED(0), + /** + * + * + *
+     * Reads are supported on selected versions of the data from within the past
+     * 7 days:
+     *
+     * * Reads against any timestamp within the past hour
+     * * Reads against 1-minute snapshots beyond 1 hour and within 7 days
+     *
+     * `version_retention_period` and `earliest_version_time` can be
+     * used to determine the supported versions.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_ENABLED = 1; + */ + POINT_IN_TIME_RECOVERY_ENABLED(1), + /** + * + * + *
+     * Reads are supported on any version of the data from within the past 1
+     * hour.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_DISABLED = 2; + */ + POINT_IN_TIME_RECOVERY_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not used.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; + */ + public static final int POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Reads are supported on selected versions of the data from within the past
+     * 7 days:
+     *
+     * * Reads against any timestamp within the past hour
+     * * Reads against 1-minute snapshots beyond 1 hour and within 7 days
+     *
+     * `version_retention_period` and `earliest_version_time` can be
+     * used to determine the supported versions.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_ENABLED = 1; + */ + public static final int POINT_IN_TIME_RECOVERY_ENABLED_VALUE = 1; + /** + * + * + *
+     * Reads are supported on any version of the data from within the past 1
+     * hour.
+     * 
+ * + * POINT_IN_TIME_RECOVERY_DISABLED = 2; + */ + public static final int POINT_IN_TIME_RECOVERY_DISABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PointInTimeRecoveryEnablement valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PointInTimeRecoveryEnablement forNumber(int value) { + switch (value) { + case 0: + return POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED; + case 1: + return POINT_IN_TIME_RECOVERY_ENABLED; + case 2: + return POINT_IN_TIME_RECOVERY_DISABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PointInTimeRecoveryEnablement findValueByNumber(int number) { + return PointInTimeRecoveryEnablement.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.firestore.admin.v1.Database.getDescriptor().getEnumTypes().get(2); + } + + private static final PointInTimeRecoveryEnablement[] VALUES = values(); + + public static PointInTimeRecoveryEnablement valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PointInTimeRecoveryEnablement(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement) + } + /** * * @@ -467,8 +644,10 @@ public enum AppEngineIntegrationMode implements com.google.protobuf.ProtocolMess * * *
-     * Appengine has no affect on the ability of this database to serve
+     * App Engine has no effect on the ability of this database to serve
      * requests.
+     *
+     * This is the default setting for databases created with the Firestore API.
      * 
* * DISABLED = 2; @@ -504,8 +683,10 @@ public enum AppEngineIntegrationMode implements com.google.protobuf.ProtocolMess * * *
-     * Appengine has no affect on the ability of this database to serve
+     * App Engine has no effect on the ability of this database to serve
      * requests.
+     *
+     * This is the default setting for databases created with the Firestore API.
      * 
* * DISABLED = 2; @@ -573,7 +754,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.firestore.admin.v1.Database.getDescriptor().getEnumTypes().get(2); + return com.google.firestore.admin.v1.Database.getDescriptor().getEnumTypes().get(3); } private static final AppEngineIntegrationMode[] VALUES = values(); @@ -598,68 +779,386 @@ private AppEngineIntegrationMode(int value) { // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Database.AppEngineIntegrationMode) } - public static final int NAME_FIELD_NUMBER = 1; - - @SuppressWarnings("serial") - private volatile java.lang.Object name_ = ""; /** * * *
-   * The resource name of the Database.
-   * Format: `projects/{project}/databases/{database}`
+   * The delete protection state of the database.
    * 
* - * string name = 1; - * - * @return The name. + * Protobuf enum {@code google.firestore.admin.v1.Database.DeleteProtectionState} */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; + public enum DeleteProtectionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The default value. Delete protection type is not specified
+     * 
+ * + * DELETE_PROTECTION_STATE_UNSPECIFIED = 0; + */ + DELETE_PROTECTION_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Delete protection is disabled
+     * 
+ * + * DELETE_PROTECTION_DISABLED = 1; + */ + DELETE_PROTECTION_DISABLED(1), + /** + * + * + *
+     * Delete protection is enabled
+     * 
+ * + * DELETE_PROTECTION_ENABLED = 2; + */ + DELETE_PROTECTION_ENABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The default value. Delete protection type is not specified
+     * 
+ * + * DELETE_PROTECTION_STATE_UNSPECIFIED = 0; + */ + public static final int DELETE_PROTECTION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Delete protection is disabled
+     * 
+ * + * DELETE_PROTECTION_DISABLED = 1; + */ + public static final int DELETE_PROTECTION_DISABLED_VALUE = 1; + /** + * + * + *
+     * Delete protection is enabled
+     * 
+ * + * DELETE_PROTECTION_ENABLED = 2; + */ + public static final int DELETE_PROTECTION_ENABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; } - } - /** - * - * - *
-   * The resource name of the Database.
-   * Format: `projects/{project}/databases/{database}`
-   * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DeleteProtectionState valueOf(int value) { + return forNumber(value); } - } - public static final int LOCATION_ID_FIELD_NUMBER = 9; + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DeleteProtectionState forNumber(int value) { + switch (value) { + case 0: + return DELETE_PROTECTION_STATE_UNSPECIFIED; + case 1: + return DELETE_PROTECTION_DISABLED; + case 2: + return DELETE_PROTECTION_ENABLED; + default: + return null; + } + } - @SuppressWarnings("serial") - private volatile java.lang.Object locationId_ = ""; - /** - * - * - *
-   * The location of the database. Available databases are listed at
+    public static com.google.protobuf.Internal.EnumLiteMap
+        internalGetValueMap() {
+      return internalValueMap;
+    }
+
+    private static final com.google.protobuf.Internal.EnumLiteMap
+        internalValueMap =
+            new com.google.protobuf.Internal.EnumLiteMap() {
+              public DeleteProtectionState findValueByNumber(int number) {
+                return DeleteProtectionState.forNumber(number);
+              }
+            };
+
+    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
+      if (this == UNRECOGNIZED) {
+        throw new java.lang.IllegalStateException(
+            "Can't get the descriptor of an unrecognized enum value.");
+      }
+      return getDescriptor().getValues().get(ordinal());
+    }
+
+    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
+      return getDescriptor();
+    }
+
+    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
+      return com.google.firestore.admin.v1.Database.getDescriptor().getEnumTypes().get(4);
+    }
+
+    private static final DeleteProtectionState[] VALUES = values();
+
+    public static DeleteProtectionState valueOf(
+        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+      if (desc.getType() != getDescriptor()) {
+        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
+      }
+      if (desc.getIndex() == -1) {
+        return UNRECOGNIZED;
+      }
+      return VALUES[desc.getIndex()];
+    }
+
+    private final int value;
+
+    private DeleteProtectionState(int value) {
+      this.value = value;
+    }
+
+    // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Database.DeleteProtectionState)
+  }
+
+  public static final int NAME_FIELD_NUMBER = 1;
+
+  @SuppressWarnings("serial")
+  private volatile java.lang.Object name_ = "";
+  /**
+   *
+   *
+   * 
+   * The resource name of the Database.
+   * Format: `projects/{project}/databases/{database}`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the Database.
+   * Format: `projects/{project}/databases/{database}`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. The system-generated UUID4 for this Database.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The system-generated UUID4 for this Database.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LOCATION_ID_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationId_ = ""; + /** + * + * + *
+   * The location of the database. Available locations are listed at
    * https://cloud.google.com/firestore/docs/locations.
    * 
* @@ -683,7 +1182,7 @@ public java.lang.String getLocationId() { * * *
-   * The location of the database. Available databases are listed at
+   * The location of the database. Available locations are listed at
    * https://cloud.google.com/firestore/docs/locations.
    * 
* @@ -782,96 +1281,299 @@ public com.google.firestore.admin.v1.Database.ConcurrencyMode getConcurrencyMode : result; } - public static final int APP_ENGINE_INTEGRATION_MODE_FIELD_NUMBER = 19; - private int appEngineIntegrationMode_ = 0; + public static final int VERSION_RETENTION_PERIOD_FIELD_NUMBER = 17; + private com.google.protobuf.Duration versionRetentionPeriod_; /** * * *
-   * The App Engine integration mode to use for this database.
+   * Output only. The period during which past versions of data are retained in
+   * the database.
+   *
+   * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+   * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+   * a `read_time` within this window, and will read the state of the database
+   * at that time.
+   *
+   * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+   * the retention period is 1 hour.
    * 
* * - * .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * - * @return The enum numeric value on the wire for appEngineIntegrationMode. + * @return Whether the versionRetentionPeriod field is set. */ @java.lang.Override - public int getAppEngineIntegrationModeValue() { - return appEngineIntegrationMode_; + public boolean hasVersionRetentionPeriod() { + return versionRetentionPeriod_ != null; } /** * * *
-   * The App Engine integration mode to use for this database.
+   * Output only. The period during which past versions of data are retained in
+   * the database.
+   *
+   * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+   * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+   * a `read_time` within this window, and will read the state of the database
+   * at that time.
+   *
+   * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+   * the retention period is 1 hour.
    * 
* * - * .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * - * @return The appEngineIntegrationMode. + * @return The versionRetentionPeriod. */ @java.lang.Override - public com.google.firestore.admin.v1.Database.AppEngineIntegrationMode - getAppEngineIntegrationMode() { - com.google.firestore.admin.v1.Database.AppEngineIntegrationMode result = - com.google.firestore.admin.v1.Database.AppEngineIntegrationMode.forNumber( - appEngineIntegrationMode_); - return result == null - ? com.google.firestore.admin.v1.Database.AppEngineIntegrationMode.UNRECOGNIZED - : result; + public com.google.protobuf.Duration getVersionRetentionPeriod() { + return versionRetentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : versionRetentionPeriod_; } - - public static final int KEY_PREFIX_FIELD_NUMBER = 20; - - @SuppressWarnings("serial") - private volatile java.lang.Object keyPrefix_ = ""; /** * * *
-   * Output only. The key_prefix for this database. This key_prefix is used, in combination
-   * with the project id ("<key prefix>~<project id>") to construct the
-   * application id that is returned from the Cloud Datastore APIs in Google App
-   * Engine first generation runtimes.
+   * Output only. The period during which past versions of data are retained in
+   * the database.
    *
-   * This value may be empty in which case the appid to use for URL-encoded keys
-   * is the project_id (eg: foo instead of v~foo).
-   * 
+ * Any [read][google.firestore.v1.GetDocumentRequest.read_time] + * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + * a `read_time` within this window, and will read the state of the database + * at that time. * - * string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * If the PITR feature is enabled, the retention period is 7 days. Otherwise, + * the retention period is 1 hour. + *
* - * @return The keyPrefix. + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ @java.lang.Override - public java.lang.String getKeyPrefix() { - java.lang.Object ref = keyPrefix_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - keyPrefix_ = s; - return s; - } + public com.google.protobuf.DurationOrBuilder getVersionRetentionPeriodOrBuilder() { + return versionRetentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : versionRetentionPeriod_; } + + public static final int EARLIEST_VERSION_TIME_FIELD_NUMBER = 18; + private com.google.protobuf.Timestamp earliestVersionTime_; /** * * *
-   * Output only. The key_prefix for this database. This key_prefix is used, in combination
-   * with the project id ("<key prefix>~<project id>") to construct the
-   * application id that is returned from the Cloud Datastore APIs in Google App
-   * Engine first generation runtimes.
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
    *
-   * This value may be empty in which case the appid to use for URL-encoded keys
-   * is the project_id (eg: foo instead of v~foo).
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
    * 
* - * string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestVersionTime field is set. + */ + @java.lang.Override + public boolean hasEarliestVersionTime() { + return earliestVersionTime_ != null; + } + /** + * + * + *
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
+   *
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestVersionTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEarliestVersionTime() { + return earliestVersionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVersionTime_; + } + /** + * + * + *
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
+   *
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEarliestVersionTimeOrBuilder() { + return earliestVersionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVersionTime_; + } + + public static final int POINT_IN_TIME_RECOVERY_ENABLEMENT_FIELD_NUMBER = 21; + private int pointInTimeRecoveryEnablement_ = 0; + /** + * + * + *
+   * Whether to enable the PITR feature on this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * + * + * @return The enum numeric value on the wire for pointInTimeRecoveryEnablement. + */ + @java.lang.Override + public int getPointInTimeRecoveryEnablementValue() { + return pointInTimeRecoveryEnablement_; + } + /** + * + * + *
+   * Whether to enable the PITR feature on this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * + * + * @return The pointInTimeRecoveryEnablement. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + getPointInTimeRecoveryEnablement() { + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement result = + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement.forNumber( + pointInTimeRecoveryEnablement_); + return result == null + ? com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement.UNRECOGNIZED + : result; + } + + public static final int APP_ENGINE_INTEGRATION_MODE_FIELD_NUMBER = 19; + private int appEngineIntegrationMode_ = 0; + /** + * + * + *
+   * The App Engine integration mode to use for this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * + * + * @return The enum numeric value on the wire for appEngineIntegrationMode. + */ + @java.lang.Override + public int getAppEngineIntegrationModeValue() { + return appEngineIntegrationMode_; + } + /** + * + * + *
+   * The App Engine integration mode to use for this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.AppEngineIntegrationMode app_engine_integration_mode = 19; + * + * + * @return The appEngineIntegrationMode. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.AppEngineIntegrationMode + getAppEngineIntegrationMode() { + com.google.firestore.admin.v1.Database.AppEngineIntegrationMode result = + com.google.firestore.admin.v1.Database.AppEngineIntegrationMode.forNumber( + appEngineIntegrationMode_); + return result == null + ? com.google.firestore.admin.v1.Database.AppEngineIntegrationMode.UNRECOGNIZED + : result; + } + + public static final int KEY_PREFIX_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private volatile java.lang.Object keyPrefix_ = ""; + /** + * + * + *
+   * Output only. The key_prefix for this database. This key_prefix is used, in
+   * combination with the project id ("<key prefix>~<project id>") to construct
+   * the application id that is returned from the Cloud Datastore APIs in Google
+   * App Engine first generation runtimes.
+   *
+   * This value may be empty in which case the appid to use for URL-encoded keys
+   * is the project_id (eg: foo instead of v~foo).
+   * 
+ * + * string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The keyPrefix. + */ + @java.lang.Override + public java.lang.String getKeyPrefix() { + java.lang.Object ref = keyPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyPrefix_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The key_prefix for this database. This key_prefix is used, in
+   * combination with the project id ("<key prefix>~<project id>") to construct
+   * the application id that is returned from the Cloud Datastore APIs in Google
+   * App Engine first generation runtimes.
+   *
+   * This value may be empty in which case the appid to use for URL-encoded keys
+   * is the project_id (eg: foo instead of v~foo).
+   * 
+ * + * string key_prefix = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The bytes for keyPrefix. */ @@ -888,6 +1590,46 @@ public com.google.protobuf.ByteString getKeyPrefixBytes() { } } + public static final int DELETE_PROTECTION_STATE_FIELD_NUMBER = 22; + private int deleteProtectionState_ = 0; + /** + * + * + *
+   * State of delete protection for the database.
+   * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The enum numeric value on the wire for deleteProtectionState. + */ + @java.lang.Override + public int getDeleteProtectionStateValue() { + return deleteProtectionState_; + } + /** + * + * + *
+   * State of delete protection for the database.
+   * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The deleteProtectionState. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.DeleteProtectionState getDeleteProtectionState() { + com.google.firestore.admin.v1.Database.DeleteProtectionState result = + com.google.firestore.admin.v1.Database.DeleteProtectionState.forNumber( + deleteProtectionState_); + return result == null + ? com.google.firestore.admin.v1.Database.DeleteProtectionState.UNRECOGNIZED + : result; + } + public static final int ETAG_FIELD_NUMBER = 99; @SuppressWarnings("serial") @@ -960,6 +1702,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, uid_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 9, locationId_); } @@ -973,6 +1724,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(15, concurrencyMode_); } + if (versionRetentionPeriod_ != null) { + output.writeMessage(17, getVersionRetentionPeriod()); + } + if (earliestVersionTime_ != null) { + output.writeMessage(18, getEarliestVersionTime()); + } if (appEngineIntegrationMode_ != com.google.firestore.admin.v1.Database.AppEngineIntegrationMode .APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED @@ -982,6 +1739,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyPrefix_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 20, keyPrefix_); } + if (pointInTimeRecoveryEnablement_ + != com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + .POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED + .getNumber()) { + output.writeEnum(21, pointInTimeRecoveryEnablement_); + } + if (deleteProtectionState_ + != com.google.firestore.admin.v1.Database.DeleteProtectionState + .DELETE_PROTECTION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(22, deleteProtectionState_); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 99, etag_); } @@ -997,6 +1766,15 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, uid_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, locationId_); } @@ -1010,6 +1788,14 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(15, concurrencyMode_); } + if (versionRetentionPeriod_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(17, getVersionRetentionPeriod()); + } + if (earliestVersionTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(18, getEarliestVersionTime()); + } if (appEngineIntegrationMode_ != com.google.firestore.admin.v1.Database.AppEngineIntegrationMode .APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED @@ -1019,6 +1805,19 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyPrefix_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, keyPrefix_); } + if (pointInTimeRecoveryEnablement_ + != com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + .POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED + .getNumber()) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(21, pointInTimeRecoveryEnablement_); + } + if (deleteProtectionState_ + != com.google.firestore.admin.v1.Database.DeleteProtectionState + .DELETE_PROTECTION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, deleteProtectionState_); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(99, etag_); } @@ -1038,11 +1837,30 @@ public boolean equals(final java.lang.Object obj) { com.google.firestore.admin.v1.Database other = (com.google.firestore.admin.v1.Database) obj; if (!getName().equals(other.getName())) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } if (!getLocationId().equals(other.getLocationId())) return false; if (type_ != other.type_) return false; if (concurrencyMode_ != other.concurrencyMode_) return false; + if (hasVersionRetentionPeriod() != other.hasVersionRetentionPeriod()) return false; + if (hasVersionRetentionPeriod()) { + if (!getVersionRetentionPeriod().equals(other.getVersionRetentionPeriod())) return false; + } + if (hasEarliestVersionTime() != other.hasEarliestVersionTime()) return false; + if (hasEarliestVersionTime()) { + if (!getEarliestVersionTime().equals(other.getEarliestVersionTime())) return false; + } + if (pointInTimeRecoveryEnablement_ != other.pointInTimeRecoveryEnablement_) return false; if (appEngineIntegrationMode_ != other.appEngineIntegrationMode_) return false; if (!getKeyPrefix().equals(other.getKeyPrefix())) return false; + if (deleteProtectionState_ != other.deleteProtectionState_) return false; if (!getEtag().equals(other.getEtag())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -1057,16 +1875,38 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER; hash = (53 * hash) + getLocationId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + CONCURRENCY_MODE_FIELD_NUMBER; hash = (53 * hash) + concurrencyMode_; + if (hasVersionRetentionPeriod()) { + hash = (37 * hash) + VERSION_RETENTION_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + getVersionRetentionPeriod().hashCode(); + } + if (hasEarliestVersionTime()) { + hash = (37 * hash) + EARLIEST_VERSION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEarliestVersionTime().hashCode(); + } + hash = (37 * hash) + POINT_IN_TIME_RECOVERY_ENABLEMENT_FIELD_NUMBER; + hash = (53 * hash) + pointInTimeRecoveryEnablement_; hash = (37 * hash) + APP_ENGINE_INTEGRATION_MODE_FIELD_NUMBER; hash = (53 * hash) + appEngineIntegrationMode_; hash = (37 * hash) + KEY_PREFIX_FIELD_NUMBER; hash = (53 * hash) + getKeyPrefix().hashCode(); + hash = (37 * hash) + DELETE_PROTECTION_STATE_FIELD_NUMBER; + hash = (53 * hash) + deleteProtectionState_; hash = (37 * hash) + ETAG_FIELD_NUMBER; hash = (53 * hash) + getEtag().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); @@ -1174,8 +2014,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * A Cloud Firestore Database.
-   * Currently only one database is allowed per cloud project; this database
-   * must have a `database_id` of '(default)'.
    * 
* * Protobuf type {@code google.firestore.admin.v1.Database} @@ -1211,11 +2049,34 @@ public Builder clear() { super.clear(); bitField0_ = 0; name_ = ""; + uid_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } locationId_ = ""; type_ = 0; concurrencyMode_ = 0; + versionRetentionPeriod_ = null; + if (versionRetentionPeriodBuilder_ != null) { + versionRetentionPeriodBuilder_.dispose(); + versionRetentionPeriodBuilder_ = null; + } + earliestVersionTime_ = null; + if (earliestVersionTimeBuilder_ != null) { + earliestVersionTimeBuilder_.dispose(); + earliestVersionTimeBuilder_ = null; + } + pointInTimeRecoveryEnablement_ = 0; appEngineIntegrationMode_ = 0; keyPrefix_ = ""; + deleteProtectionState_ = 0; etag_ = ""; return this; } @@ -1257,21 +2118,48 @@ private void buildPartial0(com.google.firestore.admin.v1.Database result) { result.name_ = name_; } if (((from_bitField0_ & 0x00000002) != 0)) { - result.locationId_ = locationId_; + result.uid_ = uid_; } if (((from_bitField0_ & 0x00000004) != 0)) { - result.type_ = type_; + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000008) != 0)) { - result.concurrencyMode_ = concurrencyMode_; + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); } if (((from_bitField0_ & 0x00000010) != 0)) { - result.appEngineIntegrationMode_ = appEngineIntegrationMode_; + result.locationId_ = locationId_; } if (((from_bitField0_ & 0x00000020) != 0)) { - result.keyPrefix_ = keyPrefix_; + result.type_ = type_; } if (((from_bitField0_ & 0x00000040) != 0)) { + result.concurrencyMode_ = concurrencyMode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.versionRetentionPeriod_ = + versionRetentionPeriodBuilder_ == null + ? versionRetentionPeriod_ + : versionRetentionPeriodBuilder_.build(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.earliestVersionTime_ = + earliestVersionTimeBuilder_ == null + ? earliestVersionTime_ + : earliestVersionTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.pointInTimeRecoveryEnablement_ = pointInTimeRecoveryEnablement_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.appEngineIntegrationMode_ = appEngineIntegrationMode_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.keyPrefix_ = keyPrefix_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.deleteProtectionState_ = deleteProtectionState_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { result.etag_ = etag_; } } @@ -1326,9 +2214,20 @@ public Builder mergeFrom(com.google.firestore.admin.v1.Database other) { bitField0_ |= 0x00000001; onChanged(); } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } if (!other.getLocationId().isEmpty()) { locationId_ = other.locationId_; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000010; onChanged(); } if (other.type_ != 0) { @@ -1337,17 +2236,29 @@ public Builder mergeFrom(com.google.firestore.admin.v1.Database other) { if (other.concurrencyMode_ != 0) { setConcurrencyModeValue(other.getConcurrencyModeValue()); } + if (other.hasVersionRetentionPeriod()) { + mergeVersionRetentionPeriod(other.getVersionRetentionPeriod()); + } + if (other.hasEarliestVersionTime()) { + mergeEarliestVersionTime(other.getEarliestVersionTime()); + } + if (other.pointInTimeRecoveryEnablement_ != 0) { + setPointInTimeRecoveryEnablementValue(other.getPointInTimeRecoveryEnablementValue()); + } if (other.appEngineIntegrationMode_ != 0) { setAppEngineIntegrationModeValue(other.getAppEngineIntegrationModeValue()); } if (!other.getKeyPrefix().isEmpty()) { keyPrefix_ = other.keyPrefix_; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000800; onChanged(); } + if (other.deleteProtectionState_ != 0) { + setDeleteProtectionStateValue(other.getDeleteProtectionStateValue()); + } if (!other.getEtag().isEmpty()) { etag_ = other.etag_; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00002000; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1382,40 +2293,84 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 26: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 case 74: { locationId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000010; break; } // case 74 case 80: { type_ = input.readEnum(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000020; break; } // case 80 case 120: { concurrencyMode_ = input.readEnum(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000040; break; } // case 120 + case 138: + { + input.readMessage( + getVersionRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 138 + case 146: + { + input.readMessage( + getEarliestVersionTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 146 case 152: { appEngineIntegrationMode_ = input.readEnum(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000400; break; } // case 152 case 162: { keyPrefix_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000800; break; } // case 162 + case 168: + { + pointInTimeRecoveryEnablement_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 168 + case 176: + { + deleteProtectionState_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 176 case 794: { etag_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00002000; break; } // case 794 default: @@ -1548,25 +2503,24 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { return this; } - private java.lang.Object locationId_ = ""; + private java.lang.Object uid_ = ""; /** * * *
-     * The location of the database. Available databases are listed at
-     * https://cloud.google.com/firestore/docs/locations.
+     * Output only. The system-generated UUID4 for this Database.
      * 
* - * string location_id = 9; + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - * @return The locationId. + * @return The uid. */ - public java.lang.String getLocationId() { - java.lang.Object ref = locationId_; + public java.lang.String getUid() { + java.lang.Object ref = uid_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - locationId_ = s; + uid_ = s; return s; } else { return (java.lang.String) ref; @@ -1576,62 +2530,1188 @@ public java.lang.String getLocationId() { * * *
-     * The location of the database. Available databases are listed at
-     * https://cloud.google.com/firestore/docs/locations.
+     * Output only. The system-generated UUID4 for this Database.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for this Database.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for this Database.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The system-generated UUID4 for this Database.
+     * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp at which this database was created. Databases
+     * created before 2016 do not populate create_time.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp at which this database was most recently
+     * updated. Note this only includes updates to the database resource and not
+     * data contained by the database.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object locationId_ = ""; + /** + * + * + *
+     * The location of the database. Available locations are listed at
+     * https://cloud.google.com/firestore/docs/locations.
+     * 
+ * + * string location_id = 9; + * + * @return The locationId. + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location of the database. Available locations are listed at
+     * https://cloud.google.com/firestore/docs/locations.
+     * 
+ * + * string location_id = 9; + * + * @return The bytes for locationId. + */ + public com.google.protobuf.ByteString getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location of the database. Available locations are listed at
+     * https://cloud.google.com/firestore/docs/locations.
+     * 
+ * + * string location_id = 9; + * + * @param value The locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + locationId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the database. Available locations are listed at
+     * https://cloud.google.com/firestore/docs/locations.
+     * 
+ * + * string location_id = 9; + * + * @return This builder for chaining. + */ + public Builder clearLocationId() { + locationId_ = getDefaultInstance().getLocationId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the database. Available locations are listed at
+     * https://cloud.google.com/firestore/docs/locations.
+     * 
+ * + * string location_id = 9; + * + * @param value The bytes for locationId to set. + * @return This builder for chaining. + */ + public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + locationId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * The type of the database.
+     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
+     * information about how to choose.
+     * 
+ * + * .google.firestore.admin.v1.Database.DatabaseType type = 10; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * The type of the database.
+     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
+     * information about how to choose.
+     * 
+ * + * .google.firestore.admin.v1.Database.DatabaseType type = 10; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the database.
+     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
+     * information about how to choose.
+     * 
+ * + * .google.firestore.admin.v1.Database.DatabaseType type = 10; + * + * @return The type. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.DatabaseType getType() { + com.google.firestore.admin.v1.Database.DatabaseType result = + com.google.firestore.admin.v1.Database.DatabaseType.forNumber(type_); + return result == null + ? com.google.firestore.admin.v1.Database.DatabaseType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The type of the database.
+     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
+     * information about how to choose.
+     * 
+ * + * .google.firestore.admin.v1.Database.DatabaseType type = 10; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.firestore.admin.v1.Database.DatabaseType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the database.
+     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
+     * information about how to choose.
+     * 
+ * + * .google.firestore.admin.v1.Database.DatabaseType type = 10; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000020); + type_ = 0; + onChanged(); + return this; + } + + private int concurrencyMode_ = 0; + /** + * + * + *
+     * The concurrency control mode to use for this database.
+     * 
+ * + * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * @return The enum numeric value on the wire for concurrencyMode. + */ + @java.lang.Override + public int getConcurrencyModeValue() { + return concurrencyMode_; + } + /** + * + * + *
+     * The concurrency control mode to use for this database.
+     * 
+ * + * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * @param value The enum numeric value on the wire for concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyModeValue(int value) { + concurrencyMode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The concurrency control mode to use for this database.
+     * 
+ * + * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * @return The concurrencyMode. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.ConcurrencyMode getConcurrencyMode() { + com.google.firestore.admin.v1.Database.ConcurrencyMode result = + com.google.firestore.admin.v1.Database.ConcurrencyMode.forNumber(concurrencyMode_); + return result == null + ? com.google.firestore.admin.v1.Database.ConcurrencyMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The concurrency control mode to use for this database.
+     * 
+ * + * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * @param value The concurrencyMode to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyMode( + com.google.firestore.admin.v1.Database.ConcurrencyMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + concurrencyMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The concurrency control mode to use for this database.
+     * 
+ * + * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * @return This builder for chaining. + */ + public Builder clearConcurrencyMode() { + bitField0_ = (bitField0_ & ~0x00000040); + concurrencyMode_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration versionRetentionPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + versionRetentionPeriodBuilder_; + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the versionRetentionPeriod field is set. + */ + public boolean hasVersionRetentionPeriod() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The versionRetentionPeriod. + */ + public com.google.protobuf.Duration getVersionRetentionPeriod() { + if (versionRetentionPeriodBuilder_ == null) { + return versionRetentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : versionRetentionPeriod_; + } else { + return versionRetentionPeriodBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVersionRetentionPeriod(com.google.protobuf.Duration value) { + if (versionRetentionPeriodBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versionRetentionPeriod_ = value; + } else { + versionRetentionPeriodBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVersionRetentionPeriod(com.google.protobuf.Duration.Builder builderForValue) { + if (versionRetentionPeriodBuilder_ == null) { + versionRetentionPeriod_ = builderForValue.build(); + } else { + versionRetentionPeriodBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeVersionRetentionPeriod(com.google.protobuf.Duration value) { + if (versionRetentionPeriodBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && versionRetentionPeriod_ != null + && versionRetentionPeriod_ != com.google.protobuf.Duration.getDefaultInstance()) { + getVersionRetentionPeriodBuilder().mergeFrom(value); + } else { + versionRetentionPeriod_ = value; + } + } else { + versionRetentionPeriodBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVersionRetentionPeriod() { + bitField0_ = (bitField0_ & ~0x00000080); + versionRetentionPeriod_ = null; + if (versionRetentionPeriodBuilder_ != null) { + versionRetentionPeriodBuilder_.dispose(); + versionRetentionPeriodBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Duration.Builder getVersionRetentionPeriodBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getVersionRetentionPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.DurationOrBuilder getVersionRetentionPeriodOrBuilder() { + if (versionRetentionPeriodBuilder_ != null) { + return versionRetentionPeriodBuilder_.getMessageOrBuilder(); + } else { + return versionRetentionPeriod_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : versionRetentionPeriod_; + } + } + /** + * + * + *
+     * Output only. The period during which past versions of data are retained in
+     * the database.
+     *
+     * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+     * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+     * a `read_time` within this window, and will read the state of the database
+     * at that time.
+     *
+     * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+     * the retention period is 1 hour.
+     * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getVersionRetentionPeriodFieldBuilder() { + if (versionRetentionPeriodBuilder_ == null) { + versionRetentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getVersionRetentionPeriod(), getParentForChildren(), isClean()); + versionRetentionPeriod_ = null; + } + return versionRetentionPeriodBuilder_; + } + + private com.google.protobuf.Timestamp earliestVersionTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + earliestVersionTimeBuilder_; + /** + * + * + *
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * string location_id = 9; + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The bytes for locationId. + * @return Whether the earliestVersionTime field is set. */ - public com.google.protobuf.ByteString getLocationIdBytes() { - java.lang.Object ref = locationId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - locationId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public boolean hasEarliestVersionTime() { + return ((bitField0_ & 0x00000100) != 0); } /** * * *
-     * The location of the database. Available databases are listed at
-     * https://cloud.google.com/firestore/docs/locations.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * string location_id = 9; + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The locationId to set. - * @return This builder for chaining. + * @return The earliestVersionTime. */ - public Builder setLocationId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public com.google.protobuf.Timestamp getEarliestVersionTime() { + if (earliestVersionTimeBuilder_ == null) { + return earliestVersionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVersionTime_; + } else { + return earliestVersionTimeBuilder_.getMessage(); } - locationId_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; } /** * * *
-     * The location of the database. Available databases are listed at
-     * https://cloud.google.com/firestore/docs/locations.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * string location_id = 9; - * - * @return This builder for chaining. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearLocationId() { - locationId_ = getDefaultInstance().getLocationId(); - bitField0_ = (bitField0_ & ~0x00000002); + public Builder setEarliestVersionTime(com.google.protobuf.Timestamp value) { + if (earliestVersionTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + earliestVersionTime_ = value; + } else { + earliestVersionTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -1639,61 +3719,89 @@ public Builder clearLocationId() { * * *
-     * The location of the database. Available databases are listed at
-     * https://cloud.google.com/firestore/docs/locations.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * string location_id = 9; - * - * @param value The bytes for locationId to set. - * @return This builder for chaining. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setLocationIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder setEarliestVersionTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (earliestVersionTimeBuilder_ == null) { + earliestVersionTime_ = builderForValue.build(); + } else { + earliestVersionTimeBuilder_.setMessage(builderForValue.build()); } - checkByteStringIsUtf8(value); - locationId_ = value; - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000100; onChanged(); return this; } - - private int type_ = 0; /** * * *
-     * The type of the database.
-     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
-     * information about how to choose.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * .google.firestore.admin.v1.Database.DatabaseType type = 10; - * - * @return The enum numeric value on the wire for type. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - @java.lang.Override - public int getTypeValue() { - return type_; + public Builder mergeEarliestVersionTime(com.google.protobuf.Timestamp value) { + if (earliestVersionTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && earliestVersionTime_ != null + && earliestVersionTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEarliestVersionTimeBuilder().mergeFrom(value); + } else { + earliestVersionTime_ = value; + } + } else { + earliestVersionTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; } /** * * *
-     * The type of the database.
-     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
-     * information about how to choose.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * .google.firestore.admin.v1.Database.DatabaseType type = 10; - * - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setTypeValue(int value) { - type_ = value; - bitField0_ |= 0x00000004; + public Builder clearEarliestVersionTime() { + bitField0_ = (bitField0_ & ~0x00000100); + earliestVersionTime_ = null; + if (earliestVersionTimeBuilder_ != null) { + earliestVersionTimeBuilder_.dispose(); + earliestVersionTimeBuilder_ = null; + } onChanged(); return this; } @@ -1701,97 +3809,122 @@ public Builder setTypeValue(int value) { * * *
-     * The type of the database.
-     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
-     * information about how to choose.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * .google.firestore.admin.v1.Database.DatabaseType type = 10; - * - * @return The type. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - @java.lang.Override - public com.google.firestore.admin.v1.Database.DatabaseType getType() { - com.google.firestore.admin.v1.Database.DatabaseType result = - com.google.firestore.admin.v1.Database.DatabaseType.forNumber(type_); - return result == null - ? com.google.firestore.admin.v1.Database.DatabaseType.UNRECOGNIZED - : result; + public com.google.protobuf.Timestamp.Builder getEarliestVersionTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getEarliestVersionTimeFieldBuilder().getBuilder(); } /** * * *
-     * The type of the database.
-     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
-     * information about how to choose.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * .google.firestore.admin.v1.Database.DatabaseType type = 10; - * - * @param value The type to set. - * @return This builder for chaining. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder setType(com.google.firestore.admin.v1.Database.DatabaseType value) { - if (value == null) { - throw new NullPointerException(); + public com.google.protobuf.TimestampOrBuilder getEarliestVersionTimeOrBuilder() { + if (earliestVersionTimeBuilder_ != null) { + return earliestVersionTimeBuilder_.getMessageOrBuilder(); + } else { + return earliestVersionTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : earliestVersionTime_; } - bitField0_ |= 0x00000004; - type_ = value.getNumber(); - onChanged(); - return this; } /** * * *
-     * The type of the database.
-     * See https://cloud.google.com/datastore/docs/firestore-or-datastore for
-     * information about how to choose.
+     * Output only. The earliest timestamp at which older versions of the data can
+     * be read from the database. See [version_retention_period] above; this field
+     * is populated with `now - version_retention_period`.
+     *
+     * This value is continuously updated, and becomes stale the moment it is
+     * queried. If you are using this value to recover data, make sure to account
+     * for the time from the moment when the value is queried to the moment when
+     * you initiate the recovery.
      * 
* - * .google.firestore.admin.v1.Database.DatabaseType type = 10; - * - * @return This builder for chaining. + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000004); - type_ = 0; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEarliestVersionTimeFieldBuilder() { + if (earliestVersionTimeBuilder_ == null) { + earliestVersionTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEarliestVersionTime(), getParentForChildren(), isClean()); + earliestVersionTime_ = null; + } + return earliestVersionTimeBuilder_; } - private int concurrencyMode_ = 0; + private int pointInTimeRecoveryEnablement_ = 0; /** * * *
-     * The concurrency control mode to use for this database.
+     * Whether to enable the PITR feature on this database.
      * 
* - * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * * - * @return The enum numeric value on the wire for concurrencyMode. + * @return The enum numeric value on the wire for pointInTimeRecoveryEnablement. */ @java.lang.Override - public int getConcurrencyModeValue() { - return concurrencyMode_; + public int getPointInTimeRecoveryEnablementValue() { + return pointInTimeRecoveryEnablement_; } /** * * *
-     * The concurrency control mode to use for this database.
+     * Whether to enable the PITR feature on this database.
      * 
* - * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * * - * @param value The enum numeric value on the wire for concurrencyMode to set. + * @param value The enum numeric value on the wire for pointInTimeRecoveryEnablement to set. * @return This builder for chaining. */ - public Builder setConcurrencyModeValue(int value) { - concurrencyMode_ = value; - bitField0_ |= 0x00000008; + public Builder setPointInTimeRecoveryEnablementValue(int value) { + pointInTimeRecoveryEnablement_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -1799,40 +3932,46 @@ public Builder setConcurrencyModeValue(int value) { * * *
-     * The concurrency control mode to use for this database.
+     * Whether to enable the PITR feature on this database.
      * 
* - * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * * - * @return The concurrencyMode. + * @return The pointInTimeRecoveryEnablement. */ @java.lang.Override - public com.google.firestore.admin.v1.Database.ConcurrencyMode getConcurrencyMode() { - com.google.firestore.admin.v1.Database.ConcurrencyMode result = - com.google.firestore.admin.v1.Database.ConcurrencyMode.forNumber(concurrencyMode_); + public com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + getPointInTimeRecoveryEnablement() { + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement result = + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement.forNumber( + pointInTimeRecoveryEnablement_); return result == null - ? com.google.firestore.admin.v1.Database.ConcurrencyMode.UNRECOGNIZED + ? com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement.UNRECOGNIZED : result; } /** * * *
-     * The concurrency control mode to use for this database.
+     * Whether to enable the PITR feature on this database.
      * 
* - * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * * - * @param value The concurrencyMode to set. + * @param value The pointInTimeRecoveryEnablement to set. * @return This builder for chaining. */ - public Builder setConcurrencyMode( - com.google.firestore.admin.v1.Database.ConcurrencyMode value) { + public Builder setPointInTimeRecoveryEnablement( + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; - concurrencyMode_ = value.getNumber(); + bitField0_ |= 0x00000200; + pointInTimeRecoveryEnablement_ = value.getNumber(); onChanged(); return this; } @@ -1840,16 +3979,18 @@ public Builder setConcurrencyMode( * * *
-     * The concurrency control mode to use for this database.
+     * Whether to enable the PITR feature on this database.
      * 
* - * .google.firestore.admin.v1.Database.ConcurrencyMode concurrency_mode = 15; + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * * * @return This builder for chaining. */ - public Builder clearConcurrencyMode() { - bitField0_ = (bitField0_ & ~0x00000008); - concurrencyMode_ = 0; + public Builder clearPointInTimeRecoveryEnablement() { + bitField0_ = (bitField0_ & ~0x00000200); + pointInTimeRecoveryEnablement_ = 0; onChanged(); return this; } @@ -1888,7 +4029,7 @@ public int getAppEngineIntegrationModeValue() { */ public Builder setAppEngineIntegrationModeValue(int value) { appEngineIntegrationMode_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -1934,7 +4075,7 @@ public Builder setAppEngineIntegrationMode( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000400; appEngineIntegrationMode_ = value.getNumber(); onChanged(); return this; @@ -1953,7 +4094,7 @@ public Builder setAppEngineIntegrationMode( * @return This builder for chaining. */ public Builder clearAppEngineIntegrationMode() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000400); appEngineIntegrationMode_ = 0; onChanged(); return this; @@ -1964,10 +4105,10 @@ public Builder clearAppEngineIntegrationMode() { * * *
-     * Output only. The key_prefix for this database. This key_prefix is used, in combination
-     * with the project id ("<key prefix>~<project id>") to construct the
-     * application id that is returned from the Cloud Datastore APIs in Google App
-     * Engine first generation runtimes.
+     * Output only. The key_prefix for this database. This key_prefix is used, in
+     * combination with the project id ("<key prefix>~<project id>") to construct
+     * the application id that is returned from the Cloud Datastore APIs in Google
+     * App Engine first generation runtimes.
      *
      * This value may be empty in which case the appid to use for URL-encoded keys
      * is the project_id (eg: foo instead of v~foo).
@@ -1992,10 +4133,10 @@ public java.lang.String getKeyPrefix() {
      *
      *
      * 
-     * Output only. The key_prefix for this database. This key_prefix is used, in combination
-     * with the project id ("<key prefix>~<project id>") to construct the
-     * application id that is returned from the Cloud Datastore APIs in Google App
-     * Engine first generation runtimes.
+     * Output only. The key_prefix for this database. This key_prefix is used, in
+     * combination with the project id ("<key prefix>~<project id>") to construct
+     * the application id that is returned from the Cloud Datastore APIs in Google
+     * App Engine first generation runtimes.
      *
      * This value may be empty in which case the appid to use for URL-encoded keys
      * is the project_id (eg: foo instead of v~foo).
@@ -2020,10 +4161,10 @@ public com.google.protobuf.ByteString getKeyPrefixBytes() {
      *
      *
      * 
-     * Output only. The key_prefix for this database. This key_prefix is used, in combination
-     * with the project id ("<key prefix>~<project id>") to construct the
-     * application id that is returned from the Cloud Datastore APIs in Google App
-     * Engine first generation runtimes.
+     * Output only. The key_prefix for this database. This key_prefix is used, in
+     * combination with the project id ("<key prefix>~<project id>") to construct
+     * the application id that is returned from the Cloud Datastore APIs in Google
+     * App Engine first generation runtimes.
      *
      * This value may be empty in which case the appid to use for URL-encoded keys
      * is the project_id (eg: foo instead of v~foo).
@@ -2039,7 +4180,7 @@ public Builder setKeyPrefix(java.lang.String value) {
         throw new NullPointerException();
       }
       keyPrefix_ = value;
-      bitField0_ |= 0x00000020;
+      bitField0_ |= 0x00000800;
       onChanged();
       return this;
     }
@@ -2047,10 +4188,10 @@ public Builder setKeyPrefix(java.lang.String value) {
      *
      *
      * 
-     * Output only. The key_prefix for this database. This key_prefix is used, in combination
-     * with the project id ("<key prefix>~<project id>") to construct the
-     * application id that is returned from the Cloud Datastore APIs in Google App
-     * Engine first generation runtimes.
+     * Output only. The key_prefix for this database. This key_prefix is used, in
+     * combination with the project id ("<key prefix>~<project id>") to construct
+     * the application id that is returned from the Cloud Datastore APIs in Google
+     * App Engine first generation runtimes.
      *
      * This value may be empty in which case the appid to use for URL-encoded keys
      * is the project_id (eg: foo instead of v~foo).
@@ -2062,7 +4203,7 @@ public Builder setKeyPrefix(java.lang.String value) {
      */
     public Builder clearKeyPrefix() {
       keyPrefix_ = getDefaultInstance().getKeyPrefix();
-      bitField0_ = (bitField0_ & ~0x00000020);
+      bitField0_ = (bitField0_ & ~0x00000800);
       onChanged();
       return this;
     }
@@ -2070,10 +4211,10 @@ public Builder clearKeyPrefix() {
      *
      *
      * 
-     * Output only. The key_prefix for this database. This key_prefix is used, in combination
-     * with the project id ("<key prefix>~<project id>") to construct the
-     * application id that is returned from the Cloud Datastore APIs in Google App
-     * Engine first generation runtimes.
+     * Output only. The key_prefix for this database. This key_prefix is used, in
+     * combination with the project id ("<key prefix>~<project id>") to construct
+     * the application id that is returned from the Cloud Datastore APIs in Google
+     * App Engine first generation runtimes.
      *
      * This value may be empty in which case the appid to use for URL-encoded keys
      * is the project_id (eg: foo instead of v~foo).
@@ -2090,7 +4231,106 @@ public Builder setKeyPrefixBytes(com.google.protobuf.ByteString value) {
       }
       checkByteStringIsUtf8(value);
       keyPrefix_ = value;
-      bitField0_ |= 0x00000020;
+      bitField0_ |= 0x00000800;
+      onChanged();
+      return this;
+    }
+
+    private int deleteProtectionState_ = 0;
+    /**
+     *
+     *
+     * 
+     * State of delete protection for the database.
+     * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The enum numeric value on the wire for deleteProtectionState. + */ + @java.lang.Override + public int getDeleteProtectionStateValue() { + return deleteProtectionState_; + } + /** + * + * + *
+     * State of delete protection for the database.
+     * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @param value The enum numeric value on the wire for deleteProtectionState to set. + * @return This builder for chaining. + */ + public Builder setDeleteProtectionStateValue(int value) { + deleteProtectionState_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * State of delete protection for the database.
+     * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The deleteProtectionState. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Database.DeleteProtectionState getDeleteProtectionState() { + com.google.firestore.admin.v1.Database.DeleteProtectionState result = + com.google.firestore.admin.v1.Database.DeleteProtectionState.forNumber( + deleteProtectionState_); + return result == null + ? com.google.firestore.admin.v1.Database.DeleteProtectionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * State of delete protection for the database.
+     * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @param value The deleteProtectionState to set. + * @return This builder for chaining. + */ + public Builder setDeleteProtectionState( + com.google.firestore.admin.v1.Database.DeleteProtectionState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + deleteProtectionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * State of delete protection for the database.
+     * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return This builder for chaining. + */ + public Builder clearDeleteProtectionState() { + bitField0_ = (bitField0_ & ~0x00001000); + deleteProtectionState_ = 0; onChanged(); return this; } @@ -2163,7 +4403,7 @@ public Builder setEtag(java.lang.String value) { throw new NullPointerException(); } etag_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -2182,7 +4422,7 @@ public Builder setEtag(java.lang.String value) { */ public Builder clearEtag() { etag_ = getDefaultInstance().getEtag(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); return this; } @@ -2206,7 +4446,7 @@ public Builder setEtagBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); etag_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00002000; onChanged(); return this; } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseOrBuilder.java index c0f2053eb5..3b1e55a886 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseOrBuilder.java @@ -54,7 +54,117 @@ public interface DatabaseOrBuilder * * *
-   * The location of the database. Available databases are listed at
+   * Output only. The system-generated UUID4 for this Database.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. The system-generated UUID4 for this Database.
+   * 
+ * + * string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this database was created. Databases
+   * created before 2016 do not populate create_time.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp at which this database was most recently
+   * updated. Note this only includes updates to the database resource and not
+   * data contained by the database.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The location of the database. Available locations are listed at
    * https://cloud.google.com/firestore/docs/locations.
    * 
* @@ -67,7 +177,7 @@ public interface DatabaseOrBuilder * * *
-   * The location of the database. Available databases are listed at
+   * The location of the database. Available locations are listed at
    * https://cloud.google.com/firestore/docs/locations.
    * 
* @@ -131,6 +241,166 @@ public interface DatabaseOrBuilder */ com.google.firestore.admin.v1.Database.ConcurrencyMode getConcurrencyMode(); + /** + * + * + *
+   * Output only. The period during which past versions of data are retained in
+   * the database.
+   *
+   * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+   * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+   * a `read_time` within this window, and will read the state of the database
+   * at that time.
+   *
+   * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+   * the retention period is 1 hour.
+   * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the versionRetentionPeriod field is set. + */ + boolean hasVersionRetentionPeriod(); + /** + * + * + *
+   * Output only. The period during which past versions of data are retained in
+   * the database.
+   *
+   * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+   * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+   * a `read_time` within this window, and will read the state of the database
+   * at that time.
+   *
+   * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+   * the retention period is 1 hour.
+   * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The versionRetentionPeriod. + */ + com.google.protobuf.Duration getVersionRetentionPeriod(); + /** + * + * + *
+   * Output only. The period during which past versions of data are retained in
+   * the database.
+   *
+   * Any [read][google.firestore.v1.GetDocumentRequest.read_time]
+   * or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
+   * a `read_time` within this window, and will read the state of the database
+   * at that time.
+   *
+   * If the PITR feature is enabled, the retention period is 7 days. Otherwise,
+   * the retention period is 1 hour.
+   * 
+ * + * + * .google.protobuf.Duration version_retention_period = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.DurationOrBuilder getVersionRetentionPeriodOrBuilder(); + + /** + * + * + *
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
+   *
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the earliestVersionTime field is set. + */ + boolean hasEarliestVersionTime(); + /** + * + * + *
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
+   *
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The earliestVersionTime. + */ + com.google.protobuf.Timestamp getEarliestVersionTime(); + /** + * + * + *
+   * Output only. The earliest timestamp at which older versions of the data can
+   * be read from the database. See [version_retention_period] above; this field
+   * is populated with `now - version_retention_period`.
+   *
+   * This value is continuously updated, and becomes stale the moment it is
+   * queried. If you are using this value to recover data, make sure to account
+   * for the time from the moment when the value is queried to the moment when
+   * you initiate the recovery.
+   * 
+ * + * + * .google.protobuf.Timestamp earliest_version_time = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEarliestVersionTimeOrBuilder(); + + /** + * + * + *
+   * Whether to enable the PITR feature on this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * + * + * @return The enum numeric value on the wire for pointInTimeRecoveryEnablement. + */ + int getPointInTimeRecoveryEnablementValue(); + /** + * + * + *
+   * Whether to enable the PITR feature on this database.
+   * 
+ * + * + * .google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + * + * + * @return The pointInTimeRecoveryEnablement. + */ + com.google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement + getPointInTimeRecoveryEnablement(); + /** * * @@ -164,10 +434,10 @@ public interface DatabaseOrBuilder * * *
-   * Output only. The key_prefix for this database. This key_prefix is used, in combination
-   * with the project id ("<key prefix>~<project id>") to construct the
-   * application id that is returned from the Cloud Datastore APIs in Google App
-   * Engine first generation runtimes.
+   * Output only. The key_prefix for this database. This key_prefix is used, in
+   * combination with the project id ("<key prefix>~<project id>") to construct
+   * the application id that is returned from the Cloud Datastore APIs in Google
+   * App Engine first generation runtimes.
    *
    * This value may be empty in which case the appid to use for URL-encoded keys
    * is the project_id (eg: foo instead of v~foo).
@@ -182,10 +452,10 @@ public interface DatabaseOrBuilder
    *
    *
    * 
-   * Output only. The key_prefix for this database. This key_prefix is used, in combination
-   * with the project id ("<key prefix>~<project id>") to construct the
-   * application id that is returned from the Cloud Datastore APIs in Google App
-   * Engine first generation runtimes.
+   * Output only. The key_prefix for this database. This key_prefix is used, in
+   * combination with the project id ("<key prefix>~<project id>") to construct
+   * the application id that is returned from the Cloud Datastore APIs in Google
+   * App Engine first generation runtimes.
    *
    * This value may be empty in which case the appid to use for URL-encoded keys
    * is the project_id (eg: foo instead of v~foo).
@@ -197,6 +467,33 @@ public interface DatabaseOrBuilder
    */
   com.google.protobuf.ByteString getKeyPrefixBytes();
 
+  /**
+   *
+   *
+   * 
+   * State of delete protection for the database.
+   * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The enum numeric value on the wire for deleteProtectionState. + */ + int getDeleteProtectionStateValue(); + /** + * + * + *
+   * State of delete protection for the database.
+   * 
+ * + * .google.firestore.admin.v1.Database.DeleteProtectionState delete_protection_state = 22; + * + * + * @return The deleteProtectionState. + */ + com.google.firestore.admin.v1.Database.DeleteProtectionState getDeleteProtectionState(); + /** * * diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseProto.java index a1148fa656..d132cab60c 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DatabaseProto.java @@ -43,31 +43,51 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n(google/firestore/admin/v1/database.pro" + "to\022\031google.firestore.admin.v1\032\037google/ap" + "i/field_behavior.proto\032\031google/api/resou" - + "rce.proto\"\321\005\n\010Database\022\014\n\004name\030\001 \001(\t\022\023\n\013" - + "location_id\030\t \001(\t\022>\n\004type\030\n \001(\01620.google" - + ".firestore.admin.v1.Database.DatabaseTyp" - + "e\022M\n\020concurrency_mode\030\017 \001(\01623.google.fir" - + "estore.admin.v1.Database.ConcurrencyMode" - + "\022a\n\033app_engine_integration_mode\030\023 \001(\0162<." - + "google.firestore.admin.v1.Database.AppEn" - + "gineIntegrationMode\022\030\n\nkey_prefix\030\024 \001(\tB" - + "\004\342A\001\003\022\014\n\004etag\030c \001(\t\"W\n\014DatabaseType\022\035\n\031D" - + "ATABASE_TYPE_UNSPECIFIED\020\000\022\024\n\020FIRESTORE_" - + "NATIVE\020\001\022\022\n\016DATASTORE_MODE\020\002\"w\n\017Concurre" - + "ncyMode\022 \n\034CONCURRENCY_MODE_UNSPECIFIED\020" - + "\000\022\016\n\nOPTIMISTIC\020\001\022\017\n\013PESSIMISTIC\020\002\022!\n\035OP" - + "TIMISTIC_WITH_ENTITY_GROUPS\020\003\"b\n\030AppEngi" - + "neIntegrationMode\022+\n\'APP_ENGINE_INTEGRAT" - + "ION_MODE_UNSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010D" - + "ISABLED\020\002:R\352AO\n!firestore.googleapis.com" - + "/Database\022\'projects/{project}/databases/" - + "{database}R\001\001B\334\001\n\035com.google.firestore.a" - + "dmin.v1B\rDatabaseProtoP\001Z9cloud.google.c" - + "om/go/firestore/apiv1/admin/adminpb;admi" - + "npb\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admi" - + "n.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002" - + "#Google::Cloud::Firestore::Admin::V1b\006pr" - + "oto3" + + "rce.proto\032\036google/protobuf/duration.prot" + + "o\032\037google/protobuf/timestamp.proto\"\277\013\n\010D" + + "atabase\022\014\n\004name\030\001 \001(\t\022\021\n\003uid\030\003 \001(\tB\004\342A\001\003" + + "\0225\n\013create_time\030\005 \001(\0132\032.google.protobuf." + + "TimestampB\004\342A\001\003\0225\n\013update_time\030\006 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\004\342A\001\003\022\023\n\013locati" + + "on_id\030\t \001(\t\022>\n\004type\030\n \001(\01620.google.fires" + + "tore.admin.v1.Database.DatabaseType\022M\n\020c" + + "oncurrency_mode\030\017 \001(\01623.google.firestore" + + ".admin.v1.Database.ConcurrencyMode\022A\n\030ve" + + "rsion_retention_period\030\021 \001(\0132\031.google.pr" + + "otobuf.DurationB\004\342A\001\003\022?\n\025earliest_versio" + + "n_time\030\022 \001(\0132\032.google.protobuf.Timestamp" + + "B\004\342A\001\003\022l\n!point_in_time_recovery_enablem" + + "ent\030\025 \001(\0162A.google.firestore.admin.v1.Da" + + "tabase.PointInTimeRecoveryEnablement\022a\n\033" + + "app_engine_integration_mode\030\023 \001(\0162<.goog" + + "le.firestore.admin.v1.Database.AppEngine" + + "IntegrationMode\022\030\n\nkey_prefix\030\024 \001(\tB\004\342A\001" + + "\003\022Z\n\027delete_protection_state\030\026 \001(\01629.goo" + + "gle.firestore.admin.v1.Database.DeletePr" + + "otectionState\022\014\n\004etag\030c \001(\t\"W\n\014DatabaseT" + + "ype\022\035\n\031DATABASE_TYPE_UNSPECIFIED\020\000\022\024\n\020FI" + + "RESTORE_NATIVE\020\001\022\022\n\016DATASTORE_MODE\020\002\"w\n\017" + + "ConcurrencyMode\022 \n\034CONCURRENCY_MODE_UNSP" + + "ECIFIED\020\000\022\016\n\nOPTIMISTIC\020\001\022\017\n\013PESSIMISTIC" + + "\020\002\022!\n\035OPTIMISTIC_WITH_ENTITY_GROUPS\020\003\"\233\001" + + "\n\035PointInTimeRecoveryEnablement\0221\n-POINT" + + "_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" + + "\020\000\022\"\n\036POINT_IN_TIME_RECOVERY_ENABLED\020\001\022#" + + "\n\037POINT_IN_TIME_RECOVERY_DISABLED\020\002\"b\n\030A" + + "ppEngineIntegrationMode\022+\n\'APP_ENGINE_IN" + + "TEGRATION_MODE_UNSPECIFIED\020\000\022\013\n\007ENABLED\020" + + "\001\022\014\n\010DISABLED\020\002\"\177\n\025DeleteProtectionState" + + "\022\'\n#DELETE_PROTECTION_STATE_UNSPECIFIED\020" + + "\000\022\036\n\032DELETE_PROTECTION_DISABLED\020\001\022\035\n\031DEL" + + "ETE_PROTECTION_ENABLED\020\002:R\352AO\n!firestore" + + ".googleapis.com/Database\022\'projects/{proj" + + "ect}/databases/{database}R\001\001B\334\001\n\035com.goo" + + "gle.firestore.admin.v1B\rDatabaseProtoP\001Z" + + "9cloud.google.com/go/firestore/apiv1/adm" + + "in/adminpb;adminpb\242\002\004GCFS\252\002\037Google.Cloud" + + ".Firestore.Admin.V1\312\002\037Google\\Cloud\\Fires" + + "tore\\Admin\\V1\352\002#Google::Cloud::Firestore" + + "::Admin::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -75,6 +95,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_firestore_admin_v1_Database_descriptor = getDescriptor().getMessageTypes().get(0); @@ -83,11 +105,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_firestore_admin_v1_Database_descriptor, new java.lang.String[] { "Name", + "Uid", + "CreateTime", + "UpdateTime", "LocationId", "Type", "ConcurrencyMode", + "VersionRetentionPeriod", + "EarliestVersionTime", + "PointInTimeRecoveryEnablement", "AppEngineIntegrationMode", "KeyPrefix", + "DeleteProtectionState", "Etag", }); com.google.protobuf.ExtensionRegistry registry = @@ -98,6 +127,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadata.java new file mode 100644 index 0000000000..ecdca040ca --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadata.java @@ -0,0 +1,431 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * Metadata related to the delete database operation.
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteDatabaseMetadata} + */ +public final class DeleteDatabaseMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.DeleteDatabaseMetadata) + DeleteDatabaseMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDatabaseMetadata.newBuilder() to construct. + private DeleteDatabaseMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDatabaseMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDatabaseMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteDatabaseMetadata.class, + com.google.firestore.admin.v1.DeleteDatabaseMetadata.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.admin.v1.DeleteDatabaseMetadata)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DeleteDatabaseMetadata other = + (com.google.firestore.admin.v1.DeleteDatabaseMetadata) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.firestore.admin.v1.DeleteDatabaseMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata related to the delete database operation.
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteDatabaseMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DeleteDatabaseMetadata) + com.google.firestore.admin.v1.DeleteDatabaseMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteDatabaseMetadata.class, + com.google.firestore.admin.v1.DeleteDatabaseMetadata.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.DeleteDatabaseMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseMetadata getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DeleteDatabaseMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseMetadata build() { + com.google.firestore.admin.v1.DeleteDatabaseMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseMetadata buildPartial() { + com.google.firestore.admin.v1.DeleteDatabaseMetadata result = + new com.google.firestore.admin.v1.DeleteDatabaseMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.DeleteDatabaseMetadata) { + return mergeFrom((com.google.firestore.admin.v1.DeleteDatabaseMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DeleteDatabaseMetadata other) { + if (other == com.google.firestore.admin.v1.DeleteDatabaseMetadata.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.DeleteDatabaseMetadata) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteDatabaseMetadata) + private static final com.google.firestore.admin.v1.DeleteDatabaseMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DeleteDatabaseMetadata(); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDatabaseMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadataOrBuilder.java new file mode 100644 index 0000000000..a6fd525241 --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseMetadataOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface DeleteDatabaseMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DeleteDatabaseMetadata) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequest.java new file mode 100644 index 0000000000..e1e622924c --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequest.java @@ -0,0 +1,843 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +/** + * + * + *
+ * The request for
+ * [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
+ * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteDatabaseRequest} + */ +public final class DeleteDatabaseRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.admin.v1.DeleteDatabaseRequest) + DeleteDatabaseRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteDatabaseRequest.newBuilder() to construct. + private DeleteDatabaseRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteDatabaseRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteDatabaseRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteDatabaseRequest.class, + com.google.firestore.admin.v1.DeleteDatabaseRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. A name of the form
+   * `projects/{project_id}/databases/{database_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. A name of the form
+   * `projects/{project_id}/databases/{database_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; + /** + * + * + *
+   * The current etag of the Database.
+   * If an etag is provided and does not match the current etag of the database,
+   * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } + } + /** + * + * + *
+   * The current etag of the Database.
+   * If an etag is provided and does not match the current etag of the database,
+   * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.admin.v1.DeleteDatabaseRequest)) { + return super.equals(obj); + } + com.google.firestore.admin.v1.DeleteDatabaseRequest other = + (com.google.firestore.admin.v1.DeleteDatabaseRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getEtag().equals(other.getEtag())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.firestore.admin.v1.DeleteDatabaseRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request for
+   * [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
+   * 
+ * + * Protobuf type {@code google.firestore.admin.v1.DeleteDatabaseRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.admin.v1.DeleteDatabaseRequest) + com.google.firestore.admin.v1.DeleteDatabaseRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.admin.v1.DeleteDatabaseRequest.class, + com.google.firestore.admin.v1.DeleteDatabaseRequest.Builder.class); + } + + // Construct using com.google.firestore.admin.v1.DeleteDatabaseRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + etag_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.admin.v1.FirestoreAdminProto + .internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseRequest getDefaultInstanceForType() { + return com.google.firestore.admin.v1.DeleteDatabaseRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseRequest build() { + com.google.firestore.admin.v1.DeleteDatabaseRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseRequest buildPartial() { + com.google.firestore.admin.v1.DeleteDatabaseRequest result = + new com.google.firestore.admin.v1.DeleteDatabaseRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.admin.v1.DeleteDatabaseRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.etag_ = etag_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.admin.v1.DeleteDatabaseRequest) { + return mergeFrom((com.google.firestore.admin.v1.DeleteDatabaseRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.admin.v1.DeleteDatabaseRequest other) { + if (other == com.google.firestore.admin.v1.DeleteDatabaseRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + etag_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. A name of the form
+     * `projects/{project_id}/databases/{database_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. A name of the form
+     * `projects/{project_id}/databases/{database_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. A name of the form
+     * `projects/{project_id}/databases/{database_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the form
+     * `projects/{project_id}/databases/{database_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A name of the form
+     * `projects/{project_id}/databases/{database_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + * + * + *
+     * The current etag of the Database.
+     * If an etag is provided and does not match the current etag of the database,
+     * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+     * 
+ * + * string etag = 3; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The current etag of the Database.
+     * If an etag is provided and does not match the current etag of the database,
+     * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+     * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The current etag of the Database.
+     * If an etag is provided and does not match the current etag of the database,
+     * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+     * 
+ * + * string etag = 3; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the Database.
+     * If an etag is provided and does not match the current etag of the database,
+     * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+     * 
+ * + * string etag = 3; + * + * @return This builder for chaining. + */ + public Builder clearEtag() { + etag_ = getDefaultInstance().getEtag(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The current etag of the Database.
+     * If an etag is provided and does not match the current etag of the database,
+     * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+     * 
+ * + * string etag = 3; + * + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.admin.v1.DeleteDatabaseRequest) + } + + // @@protoc_insertion_point(class_scope:google.firestore.admin.v1.DeleteDatabaseRequest) + private static final com.google.firestore.admin.v1.DeleteDatabaseRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.admin.v1.DeleteDatabaseRequest(); + } + + public static com.google.firestore.admin.v1.DeleteDatabaseRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteDatabaseRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.admin.v1.DeleteDatabaseRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequestOrBuilder.java new file mode 100644 index 0000000000..18b93518fd --- /dev/null +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/DeleteDatabaseRequestOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/admin/v1/firestore_admin.proto + +package com.google.firestore.admin.v1; + +public interface DeleteDatabaseRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.admin.v1.DeleteDatabaseRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A name of the form
+   * `projects/{project_id}/databases/{database_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. A name of the form
+   * `projects/{project_id}/databases/{database_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The current etag of the Database.
+   * If an etag is provided and does not match the current etag of the database,
+   * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+   * 
+ * + * string etag = 3; + * + * @return The etag. + */ + java.lang.String getEtag(); + /** + * + * + *
+   * The current etag of the Database.
+   * If an etag is provided and does not match the current etag of the database,
+   * deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+   * 
+ * + * string etag = 3; + * + * @return The bytes for etag. + */ + com.google.protobuf.ByteString getEtagBytes(); +} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java index 3f993c8757..f87737ff0c 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadata.java @@ -22,7 +22,8 @@ * * *
- * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+ * results from
  * [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
  * 
* @@ -42,6 +43,7 @@ private ExportDocumentsMetadata() { operationState_ = 0; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); outputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -367,7 +369,7 @@ public com.google.protobuf.ByteString getCollectionIdsBytes(int index) { * * *
-   * Where the entities are being exported to.
+   * Where the documents are being exported to.
    * 
* * string output_uri_prefix = 7; @@ -390,7 +392,7 @@ public java.lang.String getOutputUriPrefix() { * * *
-   * Where the entities are being exported to.
+   * Where the documents are being exported to.
    * 
* * string output_uri_prefix = 7; @@ -410,6 +412,126 @@ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { } } + public static final int NAMESPACE_IDS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_; + } + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + + public static final int SNAPSHOT_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp snapshotTime_; + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return Whether the snapshotTime field is set. + */ + @java.lang.Override + public boolean hasSnapshotTime() { + return snapshotTime_ != null; + } + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return The snapshotTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -446,6 +568,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, outputUriPrefix_); } + for (int i = 0; i < namespaceIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, namespaceIds_.getRaw(i)); + } + if (snapshotTime_ != null) { + output.writeMessage(9, getSnapshotTime()); + } getUnknownFields().writeTo(output); } @@ -482,6 +610,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, outputUriPrefix_); } + { + int dataSize = 0; + for (int i = 0; i < namespaceIds_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaceIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespaceIdsList().size(); + } + if (snapshotTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getSnapshotTime()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -517,6 +656,11 @@ public boolean equals(final java.lang.Object obj) { } if (!getCollectionIdsList().equals(other.getCollectionIdsList())) return false; if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) return false; + if (!getNamespaceIdsList().equals(other.getNamespaceIdsList())) return false; + if (hasSnapshotTime() != other.hasSnapshotTime()) return false; + if (hasSnapshotTime()) { + if (!getSnapshotTime().equals(other.getSnapshotTime())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -552,6 +696,14 @@ public int hashCode() { } hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; hash = (53 * hash) + getOutputUriPrefix().hashCode(); + if (getNamespaceIdsCount() > 0) { + hash = (37 * hash) + NAMESPACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceIdsList().hashCode(); + } + if (hasSnapshotTime()) { + hash = (37 * hash) + SNAPSHOT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotTime().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -657,7 +809,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+   * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+   * results from
    * [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
    * 
* @@ -716,6 +869,12 @@ public Builder clear() { } collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); outputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } return this; } @@ -778,6 +937,14 @@ private void buildPartial0(com.google.firestore.admin.v1.ExportDocumentsMetadata if (((from_bitField0_ & 0x00000040) != 0)) { result.outputUriPrefix_ = outputUriPrefix_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + namespaceIds_.makeImmutable(); + result.namespaceIds_ = namespaceIds_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.snapshotTime_ = + snapshotTimeBuilder_ == null ? snapshotTime_ : snapshotTimeBuilder_.build(); + } } @java.lang.Override @@ -856,6 +1023,19 @@ public Builder mergeFrom(com.google.firestore.admin.v1.ExportDocumentsMetadata o bitField0_ |= 0x00000040; onChanged(); } + if (!other.namespaceIds_.isEmpty()) { + if (namespaceIds_.isEmpty()) { + namespaceIds_ = other.namespaceIds_; + bitField0_ |= 0x00000080; + } else { + ensureNamespaceIdsIsMutable(); + namespaceIds_.addAll(other.namespaceIds_); + } + onChanged(); + } + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -926,6 +1106,19 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(s); + break; + } // case 66 + case 74: + { + input.readMessage(getSnapshotTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 74 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1949,7 +2142,7 @@ public Builder addCollectionIdsBytes(com.google.protobuf.ByteString value) { * * *
-     * Where the entities are being exported to.
+     * Where the documents are being exported to.
      * 
* * string output_uri_prefix = 7; @@ -1971,7 +2164,7 @@ public java.lang.String getOutputUriPrefix() { * * *
-     * Where the entities are being exported to.
+     * Where the documents are being exported to.
      * 
* * string output_uri_prefix = 7; @@ -1993,7 +2186,7 @@ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { * * *
-     * Where the entities are being exported to.
+     * Where the documents are being exported to.
      * 
* * string output_uri_prefix = 7; @@ -2014,7 +2207,7 @@ public Builder setOutputUriPrefix(java.lang.String value) { * * *
-     * Where the entities are being exported to.
+     * Where the documents are being exported to.
      * 
* * string output_uri_prefix = 7; @@ -2031,7 +2224,7 @@ public Builder clearOutputUriPrefix() { * * *
-     * Where the entities are being exported to.
+     * Where the documents are being exported to.
      * 
* * string output_uri_prefix = 7; @@ -2050,6 +2243,381 @@ public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamespaceIdsIsMutable() { + if (!namespaceIds_.isModifiable()) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(namespaceIds_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + namespaceIds_.makeImmutable(); + return namespaceIds_; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index to set the value at. + * @param value The namespaceIds to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param value The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param values The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaceIds(java.lang.Iterable values) { + ensureNamespaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaceIds_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceIds() { + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being exported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param value The bytes of the namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp snapshotTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + snapshotTimeBuilder_; + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } else { + return snapshotTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + } else { + snapshotTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && snapshotTime_ != null + && snapshotTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSnapshotTimeBuilder().mergeFrom(value); + } else { + snapshotTime_ = value; + } + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public Builder clearSnapshotTime() { + bitField0_ = (bitField0_ & ~0x00000100); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database that is being
+     * exported. If unspecified, there are no guarantees about the consistency of
+     * the documents being exported.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSnapshotTimeFieldBuilder() { + if (snapshotTimeBuilder_ == null) { + snapshotTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSnapshotTime(), getParentForChildren(), isClean()); + snapshotTime_ = null; + } + return snapshotTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java index d115722cde..2d473b8fe8 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsMetadataOrBuilder.java @@ -246,7 +246,7 @@ public interface ExportDocumentsMetadataOrBuilder * * *
-   * Where the entities are being exported to.
+   * Where the documents are being exported to.
    * 
* * string output_uri_prefix = 7; @@ -258,7 +258,7 @@ public interface ExportDocumentsMetadataOrBuilder * * *
-   * Where the entities are being exported to.
+   * Where the documents are being exported to.
    * 
* * string output_uri_prefix = 7; @@ -266,4 +266,96 @@ public interface ExportDocumentsMetadataOrBuilder * @return The bytes for outputUriPrefix. */ com.google.protobuf.ByteString getOutputUriPrefixBytes(); + + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + java.util.List getNamespaceIdsList(); + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + int getNamespaceIdsCount(); + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + java.lang.String getNamespaceIds(int index); + /** + * + * + *
+   * Which namespace ids are being exported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + com.google.protobuf.ByteString getNamespaceIdsBytes(int index); + + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + /** + * + * + *
+   * The timestamp that corresponds to the version of the database that is being
+   * exported. If unspecified, there are no guarantees about the consistency of
+   * the documents being exported.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 9; + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java index d9b2954b76..46f2697f18 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequest.java @@ -42,6 +42,7 @@ private ExportDocumentsRequest() { name_ = ""; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); outputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -251,6 +252,158 @@ public com.google.protobuf.ByteString getOutputUriPrefixBytes() { } } + public static final int NAMESPACE_IDS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_; + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + + public static final int SNAPSHOT_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp snapshotTime_; + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return Whether the snapshotTime field is set. + */ + @java.lang.Override + public boolean hasSnapshotTime() { + return snapshotTime_ != null; + } + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return The snapshotTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getSnapshotTime() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -274,6 +427,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, outputUriPrefix_); } + for (int i = 0; i < namespaceIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, namespaceIds_.getRaw(i)); + } + if (snapshotTime_ != null) { + output.writeMessage(5, getSnapshotTime()); + } getUnknownFields().writeTo(output); } @@ -297,6 +456,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, outputUriPrefix_); } + { + int dataSize = 0; + for (int i = 0; i < namespaceIds_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaceIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespaceIdsList().size(); + } + if (snapshotTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSnapshotTime()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -316,6 +486,11 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getCollectionIdsList().equals(other.getCollectionIdsList())) return false; if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) return false; + if (!getNamespaceIdsList().equals(other.getNamespaceIdsList())) return false; + if (hasSnapshotTime() != other.hasSnapshotTime()) return false; + if (hasSnapshotTime()) { + if (!getSnapshotTime().equals(other.getSnapshotTime())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -335,6 +510,14 @@ public int hashCode() { } hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; hash = (53 * hash) + getOutputUriPrefix().hashCode(); + if (getNamespaceIdsCount() > 0) { + hash = (37 * hash) + NAMESPACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceIdsList().hashCode(); + } + if (hasSnapshotTime()) { + hash = (37 * hash) + SNAPSHOT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getSnapshotTime().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -478,6 +661,12 @@ public Builder clear() { name_ = ""; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); outputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } return this; } @@ -524,6 +713,14 @@ private void buildPartial0(com.google.firestore.admin.v1.ExportDocumentsRequest if (((from_bitField0_ & 0x00000004) != 0)) { result.outputUriPrefix_ = outputUriPrefix_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + namespaceIds_.makeImmutable(); + result.namespaceIds_ = namespaceIds_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.snapshotTime_ = + snapshotTimeBuilder_ == null ? snapshotTime_ : snapshotTimeBuilder_.build(); + } } @java.lang.Override @@ -592,6 +789,19 @@ public Builder mergeFrom(com.google.firestore.admin.v1.ExportDocumentsRequest ot bitField0_ |= 0x00000004; onChanged(); } + if (!other.namespaceIds_.isEmpty()) { + if (namespaceIds_.isEmpty()) { + namespaceIds_ = other.namespaceIds_; + bitField0_ |= 0x00000008; + } else { + ensureNamespaceIdsIsMutable(); + namespaceIds_.addAll(other.namespaceIds_); + } + onChanged(); + } + if (other.hasSnapshotTime()) { + mergeSnapshotTime(other.getSnapshotTime()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -637,6 +847,19 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(s); + break; + } // case 34 + case 42: + { + input.readMessage(getSnapshotTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1092,6 +1315,462 @@ public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamespaceIdsIsMutable() { + if (!namespaceIds_.isModifiable()) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(namespaceIds_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + namespaceIds_.makeImmutable(); + return namespaceIds_; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index to set the value at. + * @param value The namespaceIds to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param value The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param values The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaceIds(java.lang.Iterable values) { + ensureNamespaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaceIds_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceIds() { + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param value The bytes of the namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp snapshotTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + snapshotTimeBuilder_; + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return Whether the snapshotTime field is set. + */ + public boolean hasSnapshotTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return The snapshotTime. + */ + public com.google.protobuf.Timestamp getSnapshotTime() { + if (snapshotTimeBuilder_ == null) { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } else { + return snapshotTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + snapshotTime_ = value; + } else { + snapshotTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public Builder setSnapshotTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (snapshotTimeBuilder_ == null) { + snapshotTime_ = builderForValue.build(); + } else { + snapshotTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public Builder mergeSnapshotTime(com.google.protobuf.Timestamp value) { + if (snapshotTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && snapshotTime_ != null + && snapshotTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getSnapshotTimeBuilder().mergeFrom(value); + } else { + snapshotTime_ = value; + } + } else { + snapshotTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public Builder clearSnapshotTime() { + bitField0_ = (bitField0_ & ~0x00000010); + snapshotTime_ = null; + if (snapshotTimeBuilder_ != null) { + snapshotTimeBuilder_.dispose(); + snapshotTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getSnapshotTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getSnapshotTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder() { + if (snapshotTimeBuilder_ != null) { + return snapshotTimeBuilder_.getMessageOrBuilder(); + } else { + return snapshotTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : snapshotTime_; + } + } + /** + * + * + *
+     * The timestamp that corresponds to the version of the database to be
+     * exported. The timestamp must be in the past, rounded to the minute and not
+     * older than
+     * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+     * If specified, then the exported documents will represent a consistent view
+     * of the database at the provided time. Otherwise, there are no guarantees
+     * about the consistency of the exported documents.
+     * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getSnapshotTimeFieldBuilder() { + if (snapshotTimeBuilder_ == null) { + snapshotTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getSnapshotTime(), getParentForChildren(), isClean()); + snapshotTime_ = null; + } + return snapshotTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java index 1da200a0d4..13a32788fc 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsRequestOrBuilder.java @@ -143,4 +143,128 @@ public interface ExportDocumentsRequestOrBuilder * @return The bytes for outputUriPrefix. */ com.google.protobuf.ByteString getOutputUriPrefixBytes(); + + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + java.util.List getNamespaceIdsList(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + int getNamespaceIdsCount(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + java.lang.String getNamespaceIds(int index); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + com.google.protobuf.ByteString getNamespaceIdsBytes(int index); + + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return Whether the snapshotTime field is set. + */ + boolean hasSnapshotTime(); + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + * + * @return The snapshotTime. + */ + com.google.protobuf.Timestamp getSnapshotTime(); + /** + * + * + *
+   * The timestamp that corresponds to the version of the database to be
+   * exported. The timestamp must be in the past, rounded to the minute and not
+   * older than
+   * [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
+   * If specified, then the exported documents will represent a consistent view
+   * of the database at the provided time. Otherwise, there are no guarantees
+   * about the consistency of the exported documents.
+   * 
+ * + * .google.protobuf.Timestamp snapshot_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getSnapshotTimeOrBuilder(); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java index fb3e0f8ad2..d71eb0a006 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ExportDocumentsResponse.java @@ -22,7 +22,8 @@ * * *
- * Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
+ * Returned in the [google.longrunning.Operation][google.longrunning.Operation]
+ * response field.
  * 
* * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsResponse} @@ -281,7 +282,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
+   * Returned in the [google.longrunning.Operation][google.longrunning.Operation]
+   * response field.
    * 
* * Protobuf type {@code google.firestore.admin.v1.ExportDocumentsResponse} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java index bde0ef0589..30ce174ec5 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadata.java @@ -22,7 +22,8 @@ * * *
- * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+ * results from
  * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
  * 
* @@ -1213,7 +1214,7 @@ public interface TtlConfigDeltaOrBuilder * * *
-   * Information about an TTL configuration change.
+   * Information about a TTL configuration change.
    * 
* * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} @@ -1629,7 +1630,7 @@ protected Builder newBuilderForType( * * *
-     * Information about an TTL configuration change.
+     * Information about a TTL configuration change.
      * 
* * Protobuf type {@code google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} @@ -2146,8 +2147,9 @@ public com.google.protobuf.ByteString getFieldBytes() { * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -2163,8 +2165,9 @@ public com.google.protobuf.ByteString getFieldBytes() { * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -2181,8 +2184,9 @@ public com.google.protobuf.ByteString getFieldBytes() { * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -2197,8 +2201,9 @@ public int getIndexConfigDeltasCount() { * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -2214,8 +2219,9 @@ public com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta get * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -2673,7 +2679,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+   * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+   * results from
    * [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
    * 
* @@ -3521,8 +3528,9 @@ private void ensureIndexConfigDeltasIsMutable() { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3541,8 +3549,9 @@ private void ensureIndexConfigDeltasIsMutable() { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3560,8 +3569,9 @@ public int getIndexConfigDeltasCount() { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3580,8 +3590,9 @@ public int getIndexConfigDeltasCount() { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3606,8 +3617,9 @@ public Builder setIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3631,8 +3643,9 @@ public Builder setIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3657,8 +3670,9 @@ public Builder addIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3683,8 +3697,9 @@ public Builder addIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3707,8 +3722,9 @@ public Builder addIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3732,8 +3748,9 @@ public Builder addIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3757,8 +3774,9 @@ public Builder addAllIndexConfigDeltas( * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3779,8 +3797,9 @@ public Builder clearIndexConfigDeltas() { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3801,8 +3820,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3817,8 +3837,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3837,8 +3858,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3859,8 +3881,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3878,8 +3901,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * @@ -3898,8 +3922,9 @@ public Builder removeIndexConfigDeltas(int index) { * * *
-     * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-     * operation.
+     * A list of
+     * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+     * which describe the intent of this operation.
      * 
* * diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java index af5cb824d1..12e02284f6 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FieldOperationMetadataOrBuilder.java @@ -127,8 +127,9 @@ public interface FieldOperationMetadataOrBuilder * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -141,8 +142,9 @@ public interface FieldOperationMetadataOrBuilder * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -155,8 +157,9 @@ com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta getIndexCo * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -168,8 +171,9 @@ com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta getIndexCo * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * @@ -183,8 +187,9 @@ com.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta getIndexCo * * *
-   * A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
-   * operation.
+   * A list of
+   * [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
+   * which describe the intent of this operation.
    * 
* * diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java index 50e4a25dc3..5869ee9afd 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/FirestoreAdminProto.java @@ -55,6 +55,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_firestore_admin_v1_UpdateDatabaseMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_firestore_admin_v1_UpdateDatabaseMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -115,134 +123,146 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "roto\032\031google/api/resource.proto\032(google/" + "firestore/admin/v1/database.proto\032%googl" + "e/firestore/admin/v1/field.proto\032%google" - + "/firestore/admin/v1/index.proto\032#google/" - + "longrunning/operations.proto\032\033google/pro" - + "tobuf/empty.proto\032 google/protobuf/field" - + "_mask.proto\"R\n\024ListDatabasesRequest\022:\n\006p" - + "arent\030\001 \001(\tB*\342A\001\002\372A#\022!firestore.googleap" - + "is.com/Database\"\253\001\n\025CreateDatabaseReques" - + "t\022:\n\006parent\030\001 \001(\tB*\342A\001\002\372A#\022!firestore.go" - + "ogleapis.com/Database\022;\n\010database\030\002 \001(\0132" - + "#.google.firestore.admin.v1.DatabaseB\004\342A" - + "\001\002\022\031\n\013database_id\030\003 \001(\tB\004\342A\001\002\"\030\n\026CreateD" - + "atabaseMetadata\"O\n\025ListDatabasesResponse" - + "\0226\n\tdatabases\030\001 \003(\0132#.google.firestore.a" - + "dmin.v1.Database\"N\n\022GetDatabaseRequest\0228" - + "\n\004name\030\001 \001(\tB*\342A\001\002\372A#\n!firestore.googlea" - + "pis.com/Database\"\205\001\n\025UpdateDatabaseReque" - + "st\022;\n\010database\030\001 \001(\0132#.google.firestore." - + "admin.v1.DatabaseB\004\342A\001\002\022/\n\013update_mask\030\002" - + " \001(\0132\032.google.protobuf.FieldMask\"\030\n\026Upda" - + "teDatabaseMetadata\"\216\001\n\022CreateIndexReques" - + "t\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(firestore.go" - + "ogleapis.com/CollectionGroup\0225\n\005index\030\002 " - + "\001(\0132 .google.firestore.admin.v1.IndexB\004\342" - + "A\001\002\"\216\001\n\022ListIndexesRequest\022A\n\006parent\030\001 \001" - + "(\tB1\342A\001\002\372A*\n(firestore.googleapis.com/Co" - + "llectionGroup\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_si" - + "ze\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"a\n\023ListInde" - + "xesResponse\0221\n\007indexes\030\001 \003(\0132 .google.fi" - + "restore.admin.v1.Index\022\027\n\017next_page_toke" - + "n\030\002 \001(\t\"H\n\017GetIndexRequest\0225\n\004name\030\001 \001(\t" - + "B\'\342A\001\002\372A \n\036firestore.googleapis.com/Inde" - + "x\"K\n\022DeleteIndexRequest\0225\n\004name\030\001 \001(\tB\'\342" - + "A\001\002\372A \n\036firestore.googleapis.com/Index\"|" - + "\n\022UpdateFieldRequest\0225\n\005field\030\001 \001(\0132 .go" - + "ogle.firestore.admin.v1.FieldB\004\342A\001\002\022/\n\013u" - + "pdate_mask\030\002 \001(\0132\032.google.protobuf.Field" - + "Mask\"H\n\017GetFieldRequest\0225\n\004name\030\001 \001(\tB\'\342" - + "A\001\002\372A \n\036firestore.googleapis.com/Field\"\215" - + "\001\n\021ListFieldsRequest\022A\n\006parent\030\001 \001(\tB1\342A" - + "\001\002\372A*\n(firestore.googleapis.com/Collecti" - + "onGroup\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001" - + "(\005\022\022\n\npage_token\030\004 \001(\t\"_\n\022ListFieldsResp" - + "onse\0220\n\006fields\030\001 \003(\0132 .google.firestore." - + "admin.v1.Field\022\027\n\017next_page_token\030\002 \001(\t\"" - + "\205\001\n\026ExportDocumentsRequest\0228\n\004name\030\001 \001(\t" - + "B*\342A\001\002\372A#\n!firestore.googleapis.com/Data" - + "base\022\026\n\016collection_ids\030\002 \003(\t\022\031\n\021output_u" - + "ri_prefix\030\003 \001(\t\"\204\001\n\026ImportDocumentsReque" - + "st\0228\n\004name\030\001 \001(\tB*\342A\001\002\372A#\n!firestore.goo" - + "gleapis.com/Database\022\026\n\016collection_ids\030\002" - + " \003(\t\022\030\n\020input_uri_prefix\030\003 \001(\t2\356\024\n\016Fires" - + "toreAdmin\022\333\001\n\013CreateIndex\022-.google.fires" - + "tore.admin.v1.CreateIndexRequest\032\035.googl" - + "e.longrunning.Operation\"~\312A\037\n\005Index\022\026Ind" - + "exOperationMetadata\332A\014parent,index\202\323\344\223\002G" - + "\">/v1/{parent=projects/*/databases/*/col" - + "lectionGroups/*}/indexes:\005index\022\275\001\n\013List" - + "Indexes\022-.google.firestore.admin.v1.List" - + "IndexesRequest\032..google.firestore.admin." - + "v1.ListIndexesResponse\"O\332A\006parent\202\323\344\223\002@\022" - + ">/v1/{parent=projects/*/databases/*/coll" - + "ectionGroups/*}/indexes\022\247\001\n\010GetIndex\022*.g" - + "oogle.firestore.admin.v1.GetIndexRequest" - + "\032 .google.firestore.admin.v1.Index\"M\332A\004n" - + "ame\202\323\344\223\002@\022>/v1/{name=projects/*/database" - + "s/*/collectionGroups/*/indexes/*}\022\243\001\n\013De" - + "leteIndex\022-.google.firestore.admin.v1.De" - + "leteIndexRequest\032\026.google.protobuf.Empty" - + "\"M\332A\004name\202\323\344\223\002@*>/v1/{name=projects/*/da" - + "tabases/*/collectionGroups/*/indexes/*}\022" - + "\246\001\n\010GetField\022*.google.firestore.admin.v1" - + ".GetFieldRequest\032 .google.firestore.admi" - + "n.v1.Field\"L\332A\004name\202\323\344\223\002?\022=/v1/{name=pro" - + "jects/*/databases/*/collectionGroups/*/f" - + "ields/*}\022\331\001\n\013UpdateField\022-.google.firest" - + "ore.admin.v1.UpdateFieldRequest\032\035.google" - + ".longrunning.Operation\"|\312A\037\n\005Field\022\026Fiel" - + "dOperationMetadata\332A\005field\202\323\344\223\002L2C/v1/{f" - + "ield.name=projects/*/databases/*/collect" - + "ionGroups/*/fields/*}:\005field\022\271\001\n\nListFie" - + "lds\022,.google.firestore.admin.v1.ListFiel" - + "dsRequest\032-.google.firestore.admin.v1.Li" - + "stFieldsResponse\"N\332A\006parent\202\323\344\223\002?\022=/v1/{" - + "parent=projects/*/databases/*/collection" - + "Groups/*}/fields\022\335\001\n\017ExportDocuments\0221.g" - + "oogle.firestore.admin.v1.ExportDocuments" - + "Request\032\035.google.longrunning.Operation\"x" - + "\312A2\n\027ExportDocumentsResponse\022\027ExportDocu" - + "mentsMetadata\332A\004name\202\323\344\223\0026\"1/v1/{name=pr" - + "ojects/*/databases/*}:exportDocuments:\001*" - + "\022\333\001\n\017ImportDocuments\0221.google.firestore." - + "admin.v1.ImportDocumentsRequest\032\035.google" - + ".longrunning.Operation\"v\312A0\n\025google.prot" - + "obuf.Empty\022\027ImportDocumentsMetadata\332A\004na" - + "me\202\323\344\223\0026\"1/v1/{name=projects/*/databases" - + "/*}:importDocuments:\001*\022\331\001\n\016CreateDatabas" - + "e\0220.google.firestore.admin.v1.CreateData" - + "baseRequest\032\035.google.longrunning.Operati" - + "on\"v\312A\"\n\010Database\022\026CreateDatabaseMetadat" - + "a\332A\033parent,database,database_id\202\323\344\223\002-\"!/" - + "v1/{parent=projects/*}/databases:\010databa" - + "se\022\223\001\n\013GetDatabase\022-.google.firestore.ad" - + "min.v1.GetDatabaseRequest\032#.google.fires" - + "tore.admin.v1.Database\"0\332A\004name\202\323\344\223\002#\022!/" - + "v1/{name=projects/*/databases/*}\022\246\001\n\rLis" - + "tDatabases\022/.google.firestore.admin.v1.L" - + "istDatabasesRequest\0320.google.firestore.a" - + "dmin.v1.ListDatabasesResponse\"2\332A\006parent" - + "\202\323\344\223\002#\022!/v1/{parent=projects/*}/database" - + "s\022\333\001\n\016UpdateDatabase\0220.google.firestore." - + "admin.v1.UpdateDatabaseRequest\032\035.google." - + "longrunning.Operation\"x\312A\"\n\010Database\022\026Up" - + "dateDatabaseMetadata\332A\024database,update_m" - + "ask\202\323\344\223\00262*/v1/{database.name=projects/*" - + "/databases/*}:\010database\032v\312A\030firestore.go" - + "ogleapis.com\322AXhttps://www.googleapis.co" - + "m/auth/cloud-platform,https://www.google" - + "apis.com/auth/datastoreB\245\003\n\035com.google.f" - + "irestore.admin.v1B\023FirestoreAdminProtoP\001" - + "Z9cloud.google.com/go/firestore/apiv1/ad" - + "min/adminpb;adminpb\242\002\004GCFS\252\002\037Google.Clou" - + "d.Firestore.Admin.V1\312\002\037Google\\Cloud\\Fire" - + "store\\Admin\\V1\352\002#Google::Cloud::Firestor" - + "e::Admin::V1\352AL\n!firestore.googleapis.co" - + "m/Location\022\'projects/{project}/locations" - + "/{location}\352Aq\n(firestore.googleapis.com" - + "/CollectionGroup\022Eprojects/{project}/dat" - + "abases/{database}/collectionGroups/{coll" - + "ection}b\006proto3" + + "/firestore/admin/v1/index.proto\032)google/" + + "firestore/admin/v1/operation.proto\032#goog" + + "le/longrunning/operations.proto\032\033google/" + + "protobuf/empty.proto\032 google/protobuf/fi" + + "eld_mask.proto\032\037google/protobuf/timestam" + + "p.proto\"R\n\024ListDatabasesRequest\022:\n\006paren" + + "t\030\001 \001(\tB*\342A\001\002\372A#\022!firestore.googleapis.c" + + "om/Database\"\253\001\n\025CreateDatabaseRequest\022:\n" + + "\006parent\030\001 \001(\tB*\342A\001\002\372A#\022!firestore.google" + + "apis.com/Database\022;\n\010database\030\002 \001(\0132#.go" + + "ogle.firestore.admin.v1.DatabaseB\004\342A\001\002\022\031" + + "\n\013database_id\030\003 \001(\tB\004\342A\001\002\"\030\n\026CreateDatab" + + "aseMetadata\"d\n\025ListDatabasesResponse\0226\n\t" + + "databases\030\001 \003(\0132#.google.firestore.admin" + + ".v1.Database\022\023\n\013unreachable\030\003 \003(\t\"N\n\022Get" + + "DatabaseRequest\0228\n\004name\030\001 \001(\tB*\342A\001\002\372A#\n!" + + "firestore.googleapis.com/Database\"\205\001\n\025Up" + + "dateDatabaseRequest\022;\n\010database\030\001 \001(\0132#." + + "google.firestore.admin.v1.DatabaseB\004\342A\001\002" + + "\022/\n\013update_mask\030\002 \001(\0132\032.google.protobuf." + + "FieldMask\"\030\n\026UpdateDatabaseMetadata\"_\n\025D" + + "eleteDatabaseRequest\0228\n\004name\030\001 \001(\tB*\342A\001\002" + + "\372A#\n!firestore.googleapis.com/Database\022\014" + + "\n\004etag\030\003 \001(\t\"\030\n\026DeleteDatabaseMetadata\"\216" + + "\001\n\022CreateIndexRequest\022A\n\006parent\030\001 \001(\tB1\342" + + "A\001\002\372A*\n(firestore.googleapis.com/Collect" + + "ionGroup\0225\n\005index\030\002 \001(\0132 .google.firesto" + + "re.admin.v1.IndexB\004\342A\001\002\"\216\001\n\022ListIndexesR" + + "equest\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(firesto" + + "re.googleapis.com/CollectionGroup\022\016\n\006fil" + + "ter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_tok" + + "en\030\004 \001(\t\"a\n\023ListIndexesResponse\0221\n\007index" + + "es\030\001 \003(\0132 .google.firestore.admin.v1.Ind" + + "ex\022\027\n\017next_page_token\030\002 \001(\t\"H\n\017GetIndexR" + + "equest\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036firestore" + + ".googleapis.com/Index\"K\n\022DeleteIndexRequ" + + "est\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036firestore.go" + + "ogleapis.com/Index\"|\n\022UpdateFieldRequest" + + "\0225\n\005field\030\001 \001(\0132 .google.firestore.admin" + + ".v1.FieldB\004\342A\001\002\022/\n\013update_mask\030\002 \001(\0132\032.g" + + "oogle.protobuf.FieldMask\"H\n\017GetFieldRequ" + + "est\0225\n\004name\030\001 \001(\tB\'\342A\001\002\372A \n\036firestore.go" + + "ogleapis.com/Field\"\215\001\n\021ListFieldsRequest" + + "\022A\n\006parent\030\001 \001(\tB1\342A\001\002\372A*\n(firestore.goo" + + "gleapis.com/CollectionGroup\022\016\n\006filter\030\002 " + + "\001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001" + + "(\t\"_\n\022ListFieldsResponse\0220\n\006fields\030\001 \003(\013" + + "2 .google.firestore.admin.v1.Field\022\027\n\017ne" + + "xt_page_token\030\002 \001(\t\"\317\001\n\026ExportDocumentsR" + + "equest\0228\n\004name\030\001 \001(\tB*\342A\001\002\372A#\n!firestore" + + ".googleapis.com/Database\022\026\n\016collection_i" + + "ds\030\002 \003(\t\022\031\n\021output_uri_prefix\030\003 \001(\t\022\025\n\rn" + + "amespace_ids\030\004 \003(\t\0221\n\rsnapshot_time\030\005 \001(" + + "\0132\032.google.protobuf.Timestamp\"\233\001\n\026Import" + + "DocumentsRequest\0228\n\004name\030\001 \001(\tB*\342A\001\002\372A#\n" + + "!firestore.googleapis.com/Database\022\026\n\016co" + + "llection_ids\030\002 \003(\t\022\030\n\020input_uri_prefix\030\003" + + " \001(\t\022\025\n\rnamespace_ids\030\004 \003(\t2\251\026\n\016Firestor" + + "eAdmin\022\333\001\n\013CreateIndex\022-.google.firestor" + + "e.admin.v1.CreateIndexRequest\032\035.google.l" + + "ongrunning.Operation\"~\312A\037\n\005Index\022\026IndexO" + + "perationMetadata\332A\014parent,index\202\323\344\223\002G\">/" + + "v1/{parent=projects/*/databases/*/collec" + + "tionGroups/*}/indexes:\005index\022\275\001\n\013ListInd" + + "exes\022-.google.firestore.admin.v1.ListInd" + + "exesRequest\032..google.firestore.admin.v1." + + "ListIndexesResponse\"O\332A\006parent\202\323\344\223\002@\022>/v" + + "1/{parent=projects/*/databases/*/collect" + + "ionGroups/*}/indexes\022\247\001\n\010GetIndex\022*.goog" + + "le.firestore.admin.v1.GetIndexRequest\032 ." + + "google.firestore.admin.v1.Index\"M\332A\004name" + + "\202\323\344\223\002@\022>/v1/{name=projects/*/databases/*" + + "/collectionGroups/*/indexes/*}\022\243\001\n\013Delet" + + "eIndex\022-.google.firestore.admin.v1.Delet" + + "eIndexRequest\032\026.google.protobuf.Empty\"M\332" + + "A\004name\202\323\344\223\002@*>/v1/{name=projects/*/datab" + + "ases/*/collectionGroups/*/indexes/*}\022\246\001\n" + + "\010GetField\022*.google.firestore.admin.v1.Ge" + + "tFieldRequest\032 .google.firestore.admin.v" + + "1.Field\"L\332A\004name\202\323\344\223\002?\022=/v1/{name=projec" + + "ts/*/databases/*/collectionGroups/*/fiel" + + "ds/*}\022\331\001\n\013UpdateField\022-.google.firestore" + + ".admin.v1.UpdateFieldRequest\032\035.google.lo" + + "ngrunning.Operation\"|\312A\037\n\005Field\022\026FieldOp" + + "erationMetadata\332A\005field\202\323\344\223\002L2C/v1/{fiel" + + "d.name=projects/*/databases/*/collection" + + "Groups/*/fields/*}:\005field\022\271\001\n\nListFields" + + "\022,.google.firestore.admin.v1.ListFieldsR" + + "equest\032-.google.firestore.admin.v1.ListF" + + "ieldsResponse\"N\332A\006parent\202\323\344\223\002?\022=/v1/{par" + + "ent=projects/*/databases/*/collectionGro" + + "ups/*}/fields\022\335\001\n\017ExportDocuments\0221.goog" + + "le.firestore.admin.v1.ExportDocumentsReq" + + "uest\032\035.google.longrunning.Operation\"x\312A2" + + "\n\027ExportDocumentsResponse\022\027ExportDocumen" + + "tsMetadata\332A\004name\202\323\344\223\0026\"1/v1/{name=proje" + + "cts/*/databases/*}:exportDocuments:\001*\022\333\001" + + "\n\017ImportDocuments\0221.google.firestore.adm" + + "in.v1.ImportDocumentsRequest\032\035.google.lo" + + "ngrunning.Operation\"v\312A0\n\025google.protobu" + + "f.Empty\022\027ImportDocumentsMetadata\332A\004name\202" + + "\323\344\223\0026\"1/v1/{name=projects/*/databases/*}" + + ":importDocuments:\001*\022\331\001\n\016CreateDatabase\0220" + + ".google.firestore.admin.v1.CreateDatabas" + + "eRequest\032\035.google.longrunning.Operation\"" + + "v\312A\"\n\010Database\022\026CreateDatabaseMetadata\332A" + + "\033parent,database,database_id\202\323\344\223\002-\"!/v1/" + + "{parent=projects/*}/databases:\010database\022" + + "\223\001\n\013GetDatabase\022-.google.firestore.admin" + + ".v1.GetDatabaseRequest\032#.google.firestor" + + "e.admin.v1.Database\"0\332A\004name\202\323\344\223\002#\022!/v1/" + + "{name=projects/*/databases/*}\022\246\001\n\rListDa" + + "tabases\022/.google.firestore.admin.v1.List" + + "DatabasesRequest\0320.google.firestore.admi" + + "n.v1.ListDatabasesResponse\"2\332A\006parent\202\323\344" + + "\223\002#\022!/v1/{parent=projects/*}/databases\022\333" + + "\001\n\016UpdateDatabase\0220.google.firestore.adm" + + "in.v1.UpdateDatabaseRequest\032\035.google.lon" + + "grunning.Operation\"x\312A\"\n\010Database\022\026Updat" + + "eDatabaseMetadata\332A\024database,update_mask" + + "\202\323\344\223\00262*/v1/{database.name=projects/*/da" + + "tabases/*}:\010database\022\270\001\n\016DeleteDatabase\022" + + "0.google.firestore.admin.v1.DeleteDataba" + + "seRequest\032\035.google.longrunning.Operation" + + "\"U\312A\"\n\010Database\022\026DeleteDatabaseMetadata\332" + + "A\004name\202\323\344\223\002#*!/v1/{name=projects/*/datab" + + "ases/*}\032v\312A\030firestore.googleapis.com\322AXh" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tform,https://www.googleapis.com/auth/da" + + "tastoreB\245\003\n\035com.google.firestore.admin.v" + + "1B\023FirestoreAdminProtoP\001Z9cloud.google.c" + + "om/go/firestore/apiv1/admin/adminpb;admi" + + "npb\242\002\004GCFS\252\002\037Google.Cloud.Firestore.Admi" + + "n.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V1\352\002" + + "#Google::Cloud::Firestore::Admin::V1\352AL\n" + + "!firestore.googleapis.com/Location\022\'proj" + + "ects/{project}/locations/{location}\352Aq\n(" + + "firestore.googleapis.com/CollectionGroup" + + "\022Eprojects/{project}/databases/{database" + + "}/collectionGroups/{collection}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -255,9 +275,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.firestore.admin.v1.DatabaseProto.getDescriptor(), com.google.firestore.admin.v1.FieldProto.getDescriptor(), com.google.firestore.admin.v1.IndexProto.getDescriptor(), + com.google.firestore.admin.v1.OperationProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_firestore_admin_v1_ListDatabasesRequest_descriptor = getDescriptor().getMessageTypes().get(0); @@ -287,7 +309,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListDatabasesResponse_descriptor, new java.lang.String[] { - "Databases", + "Databases", "Unreachable", }); internal_static_google_firestore_admin_v1_GetDatabaseRequest_descriptor = getDescriptor().getMessageTypes().get(4); @@ -311,8 +333,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_UpdateDatabaseMetadata_descriptor, new java.lang.String[] {}); - internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor = + internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor = getDescriptor().getMessageTypes().get(7); + internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DeleteDatabaseRequest_descriptor, + new java.lang.String[] { + "Name", "Etag", + }); + internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_admin_v1_DeleteDatabaseMetadata_descriptor, + new java.lang.String[] {}); + internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor = + getDescriptor().getMessageTypes().get(9); internal_static_google_firestore_admin_v1_CreateIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_CreateIndexRequest_descriptor, @@ -320,7 +356,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Index", }); internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_google_firestore_admin_v1_ListIndexesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListIndexesRequest_descriptor, @@ -328,7 +364,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Filter", "PageSize", "PageToken", }); internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_google_firestore_admin_v1_ListIndexesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListIndexesResponse_descriptor, @@ -336,7 +372,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Indexes", "NextPageToken", }); internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_google_firestore_admin_v1_GetIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_GetIndexRequest_descriptor, @@ -344,7 +380,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_firestore_admin_v1_DeleteIndexRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_DeleteIndexRequest_descriptor, @@ -352,7 +388,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_google_firestore_admin_v1_UpdateFieldRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_UpdateFieldRequest_descriptor, @@ -360,7 +396,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Field", "UpdateMask", }); internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_firestore_admin_v1_GetFieldRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_GetFieldRequest_descriptor, @@ -368,7 +404,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_google_firestore_admin_v1_ListFieldsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListFieldsRequest_descriptor, @@ -376,7 +412,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "Filter", "PageSize", "PageToken", }); internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_google_firestore_admin_v1_ListFieldsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ListFieldsResponse_descriptor, @@ -384,20 +420,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Fields", "NextPageToken", }); internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_google_firestore_admin_v1_ExportDocumentsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ExportDocumentsRequest_descriptor, new java.lang.String[] { - "Name", "CollectionIds", "OutputUriPrefix", + "Name", "CollectionIds", "OutputUriPrefix", "NamespaceIds", "SnapshotTime", }); internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_google_firestore_admin_v1_ImportDocumentsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_ImportDocumentsRequest_descriptor, new java.lang.String[] { - "Name", "CollectionIds", "InputUriPrefix", + "Name", "CollectionIds", "InputUriPrefix", "NamespaceIds", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); @@ -418,9 +454,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.firestore.admin.v1.DatabaseProto.getDescriptor(); com.google.firestore.admin.v1.FieldProto.getDescriptor(); com.google.firestore.admin.v1.IndexProto.getDescriptor(); + com.google.firestore.admin.v1.OperationProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java index a8d70740c5..d1490d46ae 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadata.java @@ -22,7 +22,8 @@ * * *
- * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+ * results from
  * [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
  * 
* @@ -42,6 +43,7 @@ private ImportDocumentsMetadata() { operationState_ = 0; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); inputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -410,6 +412,70 @@ public com.google.protobuf.ByteString getInputUriPrefixBytes() { } } + public static final int NAMESPACE_IDS_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_; + } + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -446,6 +512,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUriPrefix_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, inputUriPrefix_); } + for (int i = 0; i < namespaceIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, namespaceIds_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -482,6 +551,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUriPrefix_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, inputUriPrefix_); } + { + int dataSize = 0; + for (int i = 0; i < namespaceIds_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaceIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespaceIdsList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -517,6 +594,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getCollectionIdsList().equals(other.getCollectionIdsList())) return false; if (!getInputUriPrefix().equals(other.getInputUriPrefix())) return false; + if (!getNamespaceIdsList().equals(other.getNamespaceIdsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -552,6 +630,10 @@ public int hashCode() { } hash = (37 * hash) + INPUT_URI_PREFIX_FIELD_NUMBER; hash = (53 * hash) + getInputUriPrefix().hashCode(); + if (getNamespaceIdsCount() > 0) { + hash = (37 * hash) + NAMESPACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceIdsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -657,7 +739,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+   * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+   * results from
    * [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
    * 
* @@ -716,6 +799,7 @@ public Builder clear() { } collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); inputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -778,6 +862,10 @@ private void buildPartial0(com.google.firestore.admin.v1.ImportDocumentsMetadata if (((from_bitField0_ & 0x00000040) != 0)) { result.inputUriPrefix_ = inputUriPrefix_; } + if (((from_bitField0_ & 0x00000080) != 0)) { + namespaceIds_.makeImmutable(); + result.namespaceIds_ = namespaceIds_; + } } @java.lang.Override @@ -856,6 +944,16 @@ public Builder mergeFrom(com.google.firestore.admin.v1.ImportDocumentsMetadata o bitField0_ |= 0x00000040; onChanged(); } + if (!other.namespaceIds_.isEmpty()) { + if (namespaceIds_.isEmpty()) { + namespaceIds_ = other.namespaceIds_; + bitField0_ |= 0x00000080; + } else { + ensureNamespaceIdsIsMutable(); + namespaceIds_.addAll(other.namespaceIds_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -926,6 +1024,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 58 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(s); + break; + } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2050,6 +2155,180 @@ public Builder setInputUriPrefixBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamespaceIdsIsMutable() { + if (!namespaceIds_.isModifiable()) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(namespaceIds_); + } + bitField0_ |= 0x00000080; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + namespaceIds_.makeImmutable(); + return namespaceIds_; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index to set the value at. + * @param value The namespaceIds to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.set(index, value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param value The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param values The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaceIds(java.lang.Iterable values) { + ensureNamespaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaceIds_); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceIds() { + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Which namespace ids are being imported.
+     * 
+ * + * repeated string namespace_ids = 8; + * + * @param value The bytes of the namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java index ff895c6479..132b0e4c19 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsMetadataOrBuilder.java @@ -266,4 +266,55 @@ public interface ImportDocumentsMetadataOrBuilder * @return The bytes for inputUriPrefix. */ com.google.protobuf.ByteString getInputUriPrefixBytes(); + + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return A list containing the namespaceIds. + */ + java.util.List getNamespaceIdsList(); + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @return The count of namespaceIds. + */ + int getNamespaceIdsCount(); + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + java.lang.String getNamespaceIds(int index); + /** + * + * + *
+   * Which namespace ids are being imported.
+   * 
+ * + * repeated string namespace_ids = 8; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + com.google.protobuf.ByteString getNamespaceIdsBytes(int index); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java index 044b01f7e8..e921696836 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequest.java @@ -42,6 +42,7 @@ private ImportDocumentsRequest() { name_ = ""; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); inputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -249,6 +250,90 @@ public com.google.protobuf.ByteString getInputUriPrefixBytes() { } } + public static final int NAMESPACE_IDS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + return namespaceIds_; + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -272,6 +357,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUriPrefix_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, inputUriPrefix_); } + for (int i = 0; i < namespaceIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, namespaceIds_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -295,6 +383,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(inputUriPrefix_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, inputUriPrefix_); } + { + int dataSize = 0; + for (int i = 0; i < namespaceIds_.size(); i++) { + dataSize += computeStringSizeNoTag(namespaceIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamespaceIdsList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -314,6 +410,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getCollectionIdsList().equals(other.getCollectionIdsList())) return false; if (!getInputUriPrefix().equals(other.getInputUriPrefix())) return false; + if (!getNamespaceIdsList().equals(other.getNamespaceIdsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -333,6 +430,10 @@ public int hashCode() { } hash = (37 * hash) + INPUT_URI_PREFIX_FIELD_NUMBER; hash = (53 * hash) + getInputUriPrefix().hashCode(); + if (getNamespaceIdsCount() > 0) { + hash = (37 * hash) + NAMESPACE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getNamespaceIdsList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -476,6 +577,7 @@ public Builder clear() { name_ = ""; collectionIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); inputUriPrefix_ = ""; + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -522,6 +624,10 @@ private void buildPartial0(com.google.firestore.admin.v1.ImportDocumentsRequest if (((from_bitField0_ & 0x00000004) != 0)) { result.inputUriPrefix_ = inputUriPrefix_; } + if (((from_bitField0_ & 0x00000008) != 0)) { + namespaceIds_.makeImmutable(); + result.namespaceIds_ = namespaceIds_; + } } @java.lang.Override @@ -590,6 +696,16 @@ public Builder mergeFrom(com.google.firestore.admin.v1.ImportDocumentsRequest ot bitField0_ |= 0x00000004; onChanged(); } + if (!other.namespaceIds_.isEmpty()) { + if (namespaceIds_.isEmpty()) { + namespaceIds_ = other.namespaceIds_; + bitField0_ |= 0x00000008; + } else { + ensureNamespaceIdsIsMutable(); + namespaceIds_.addAll(other.namespaceIds_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -635,6 +751,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(s); + break; + } // case 34 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1084,6 +1207,225 @@ public Builder setInputUriPrefixBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList namespaceIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNamespaceIdsIsMutable() { + if (!namespaceIds_.isModifiable()) { + namespaceIds_ = new com.google.protobuf.LazyStringArrayList(namespaceIds_); + } + bitField0_ |= 0x00000008; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + public com.google.protobuf.ProtocolStringList getNamespaceIdsList() { + namespaceIds_.makeImmutable(); + return namespaceIds_; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + public int getNamespaceIdsCount() { + return namespaceIds_.size(); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + public java.lang.String getNamespaceIds(int index) { + return namespaceIds_.get(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + public com.google.protobuf.ByteString getNamespaceIdsBytes(int index) { + return namespaceIds_.getByteString(index); + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index to set the value at. + * @param value The namespaceIds to set. + * @return This builder for chaining. + */ + public Builder setNamespaceIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.set(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param value The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param values The namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addAllNamespaceIds(java.lang.Iterable values) { + ensureNamespaceIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, namespaceIds_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearNamespaceIds() { + namespaceIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * An empty list represents all namespaces. This is the preferred
+     * usage for databases that don't use namespaces.
+     *
+     * An empty string element represents the default namespace. This should be
+     * used if the database has data in non-default namespaces, but doesn't want
+     * to include them. Each namespace in this list must be unique.
+     * 
+ * + * repeated string namespace_ids = 4; + * + * @param value The bytes of the namespaceIds to add. + * @return This builder for chaining. + */ + public Builder addNamespaceIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamespaceIdsIsMutable(); + namespaceIds_.add(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java index b0c764fea8..dba2886312 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ImportDocumentsRequestOrBuilder.java @@ -141,4 +141,75 @@ public interface ImportDocumentsRequestOrBuilder * @return The bytes for inputUriPrefix. */ com.google.protobuf.ByteString getInputUriPrefixBytes(); + + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return A list containing the namespaceIds. + */ + java.util.List getNamespaceIdsList(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @return The count of namespaceIds. + */ + int getNamespaceIdsCount(); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the element to return. + * @return The namespaceIds at the given index. + */ + java.lang.String getNamespaceIds(int index); + /** + * + * + *
+   * An empty list represents all namespaces. This is the preferred
+   * usage for databases that don't use namespaces.
+   *
+   * An empty string element represents the default namespace. This should be
+   * used if the database has data in non-default namespaces, but doesn't want
+   * to include them. Each namespace in this list must be unique.
+   * 
+ * + * repeated string namespace_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the namespaceIds at the given index. + */ + com.google.protobuf.ByteString getNamespaceIdsBytes(int index); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java index 7867340fa5..4864b97aa2 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOperationMetadata.java @@ -22,7 +22,8 @@ * * *
- * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+ * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+ * results from
  * [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
  * 
* @@ -577,7 +578,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
+   * Metadata for [google.longrunning.Operation][google.longrunning.Operation]
+   * results from
    * [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
    * 
* diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponse.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponse.java index 99253b3606..87469958aa 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponse.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponse.java @@ -39,6 +39,7 @@ private ListDatabasesResponse(com.google.protobuf.GeneratedMessageV3.Builder private ListDatabasesResponse() { databases_ = java.util.Collections.emptyList(); + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -133,6 +134,102 @@ public com.google.firestore.admin.v1.DatabaseOrBuilder getDatabasesOrBuilder(int return databases_.get(index); } + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -150,6 +247,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < databases_.size(); i++) { output.writeMessage(1, databases_.get(i)); } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -162,6 +262,14 @@ public int getSerializedSize() { for (int i = 0; i < databases_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, databases_.get(i)); } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -179,6 +287,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.firestore.admin.v1.ListDatabasesResponse) obj; if (!getDatabasesList().equals(other.getDatabasesList())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -194,6 +303,10 @@ public int hashCode() { hash = (37 * hash) + DATABASES_FIELD_NUMBER; hash = (53 * hash) + getDatabasesList().hashCode(); } + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -340,6 +453,7 @@ public Builder clear() { databasesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -390,6 +504,10 @@ private void buildPartialRepeatedFields( private void buildPartial0(com.google.firestore.admin.v1.ListDatabasesResponse result) { int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } } @java.lang.Override @@ -465,6 +583,16 @@ public Builder mergeFrom(com.google.firestore.admin.v1.ListDatabasesResponse oth } } } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000002; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -504,6 +632,13 @@ public Builder mergeFrom( } break; } // case 10 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -872,6 +1007,252 @@ public com.google.firestore.admin.v1.Database.Builder addDatabasesBuilder(int in return databasesBuilder_; } + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * In the event that data about individual databases cannot be listed they
+     * will be recorded here.
+     *
+     * An example entry might be: projects/some_project/locations/some_location
+     * This can happen if the Cloud Region that the Database resides in is
+     * currently unavailable.  In this case we can't fetch all the details about
+     * the database. You may be able to get a more detailed error message
+     * (or possibly fetch the resource) by sending a 'Get' request for the
+     * resource or a 'List' request for the specific location.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponseOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponseOrBuilder.java index 9d160f406d..da93235a4b 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponseOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/ListDatabasesResponseOrBuilder.java @@ -74,4 +74,87 @@ public interface ListDatabasesResponseOrBuilder * repeated .google.firestore.admin.v1.Database databases = 1; */ com.google.firestore.admin.v1.DatabaseOrBuilder getDatabasesOrBuilder(int index); + + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * In the event that data about individual databases cannot be listed they
+   * will be recorded here.
+   *
+   * An example entry might be: projects/some_project/locations/some_location
+   * This can happen if the Cloud Region that the Database resides in is
+   * currently unavailable.  In this case we can't fetch all the details about
+   * the database. You may be able to get a more detailed error message
+   * (or possibly fetch the resource) by sending a 'Get' request for the
+   * resource or a 'List' request for the specific location.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java index bdaaa2aacf..b9fa4c060f 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/LocationMetadata.java @@ -22,7 +22,8 @@ * * *
- * The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
+ * The metadata message for
+ * [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
  * 
* * Protobuf type {@code google.firestore.admin.v1.LocationMetadata} @@ -214,7 +215,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
+   * The metadata message for
+   * [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
    * 
* * Protobuf type {@code google.firestore.admin.v1.LocationMetadata} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java index 2c27cc9281..c0a42a4734 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/OperationProto.java @@ -69,76 +69,80 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n)google/firestore/admin/v1/operation.pr" - + "oto\022\031google.firestore.admin.v1\032%google/f" - + "irestore/admin/v1/index.proto\032\037google/pr" - + "otobuf/timestamp.proto\"\275\002\n\026IndexOperatio" - + "nMetadata\022.\n\nstart_time\030\001 \001(\0132\032.google.p" - + "rotobuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022\r\n\005index\030\003 \001(\t\0228" - + "\n\005state\030\004 \001(\0162).google.firestore.admin.v" - + "1.OperationState\022?\n\022progress_documents\030\005" - + " \001(\0132#.google.firestore.admin.v1.Progres" - + "s\022;\n\016progress_bytes\030\006 \001(\0132#.google.fires" - + "tore.admin.v1.Progress\"\231\007\n\026FieldOperatio" - + "nMetadata\022.\n\nstart_time\030\001 \001(\0132\032.google.p" - + "rotobuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.go" - + "ogle.protobuf.Timestamp\022\r\n\005field\030\003 \001(\t\022_" - + "\n\023index_config_deltas\030\004 \003(\0132B.google.fir" - + "estore.admin.v1.FieldOperationMetadata.I" - + "ndexConfigDelta\0228\n\005state\030\005 \001(\0162).google." - + "firestore.admin.v1.OperationState\022?\n\022pro" - + "gress_documents\030\006 \001(\0132#.google.firestore" - + ".admin.v1.Progress\022;\n\016progress_bytes\030\007 \001" - + "(\0132#.google.firestore.admin.v1.Progress\022" - + "Z\n\020ttl_config_delta\030\010 \001(\0132@.google.fires" - + "tore.admin.v1.FieldOperationMetadata.Ttl" - + "ConfigDelta\032\347\001\n\020IndexConfigDelta\022b\n\013chan" - + "ge_type\030\001 \001(\0162M.google.firestore.admin.v" - + "1.FieldOperationMetadata.IndexConfigDelt" - + "a.ChangeType\022/\n\005index\030\002 \001(\0132 .google.fir" - + "estore.admin.v1.Index\">\n\nChangeType\022\033\n\027C" - + "HANGE_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REM" - + "OVE\020\002\032\262\001\n\016TtlConfigDelta\022`\n\013change_type\030" - + "\001 \001(\0162K.google.firestore.admin.v1.FieldO" - + "perationMetadata.TtlConfigDelta.ChangeTy" - + "pe\">\n\nChangeType\022\033\n\027CHANGE_TYPE_UNSPECIF" - + "IED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\"\354\002\n\027ExportDoc" - + "umentsMetadata\022.\n\nstart_time\030\001 \001(\0132\032.goo" - + "gle.protobuf.Timestamp\022,\n\010end_time\030\002 \001(\013" - + "2\032.google.protobuf.Timestamp\022B\n\017operatio" - + "n_state\030\003 \001(\0162).google.firestore.admin.v" - + "1.OperationState\022?\n\022progress_documents\030\004" - + " \001(\0132#.google.firestore.admin.v1.Progres" - + "s\022;\n\016progress_bytes\030\005 \001(\0132#.google.fires" - + "tore.admin.v1.Progress\022\026\n\016collection_ids" - + "\030\006 \003(\t\022\031\n\021output_uri_prefix\030\007 \001(\t\"\353\002\n\027Im" - + "portDocumentsMetadata\022.\n\nstart_time\030\001 \001(" - + "\0132\032.google.protobuf.Timestamp\022,\n\010end_tim" - + "e\030\002 \001(\0132\032.google.protobuf.Timestamp\022B\n\017o" - + "peration_state\030\003 \001(\0162).google.firestore." - + "admin.v1.OperationState\022?\n\022progress_docu" - + "ments\030\004 \001(\0132#.google.firestore.admin.v1." - + "Progress\022;\n\016progress_bytes\030\005 \001(\0132#.googl" - + "e.firestore.admin.v1.Progress\022\026\n\016collect" - + "ion_ids\030\006 \003(\t\022\030\n\020input_uri_prefix\030\007 \001(\t\"" - + "4\n\027ExportDocumentsResponse\022\031\n\021output_uri" - + "_prefix\030\001 \001(\t\":\n\010Progress\022\026\n\016estimated_w" - + "ork\030\001 \001(\003\022\026\n\016completed_work\030\002 \001(\003*\236\001\n\016Op" - + "erationState\022\037\n\033OPERATION_STATE_UNSPECIF" - + "IED\020\000\022\020\n\014INITIALIZING\020\001\022\016\n\nPROCESSING\020\002\022" - + "\016\n\nCANCELLING\020\003\022\016\n\nFINALIZING\020\004\022\016\n\nSUCCE" - + "SSFUL\020\005\022\n\n\006FAILED\020\006\022\r\n\tCANCELLED\020\007B\335\001\n\035c" - + "om.google.firestore.admin.v1B\016OperationP" - + "rotoP\001Z9cloud.google.com/go/firestore/ap" - + "iv1/admin/adminpb;adminpb\242\002\004GCFS\252\002\037Googl" - + "e.Cloud.Firestore.Admin.V1\312\002\037Google\\Clou" - + "d\\Firestore\\Admin\\V1\352\002#Google::Cloud::Fi" - + "restore::Admin::V1b\006proto3" + + "oto\022\031google.firestore.admin.v1\032\031google/a" + + "pi/resource.proto\032%google/firestore/admi" + + "n/v1/index.proto\032\037google/protobuf/timest" + + "amp.proto\"\275\002\n\026IndexOperationMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\022\r\n\005index\030\003 \001(\t\0228\n\005state\030\004 \001(\016" + + "2).google.firestore.admin.v1.OperationSt" + + "ate\022?\n\022progress_documents\030\005 \001(\0132#.google" + + ".firestore.admin.v1.Progress\022;\n\016progress" + + "_bytes\030\006 \001(\0132#.google.firestore.admin.v1" + + ".Progress\"\231\007\n\026FieldOperationMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Times" + + "tamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobuf" + + ".Timestamp\022\r\n\005field\030\003 \001(\t\022_\n\023index_confi" + + "g_deltas\030\004 \003(\0132B.google.firestore.admin." + + "v1.FieldOperationMetadata.IndexConfigDel" + + "ta\0228\n\005state\030\005 \001(\0162).google.firestore.adm" + + "in.v1.OperationState\022?\n\022progress_documen" + + "ts\030\006 \001(\0132#.google.firestore.admin.v1.Pro" + + "gress\022;\n\016progress_bytes\030\007 \001(\0132#.google.f" + + "irestore.admin.v1.Progress\022Z\n\020ttl_config" + + "_delta\030\010 \001(\0132@.google.firestore.admin.v1" + + ".FieldOperationMetadata.TtlConfigDelta\032\347" + + "\001\n\020IndexConfigDelta\022b\n\013change_type\030\001 \001(\016" + + "2M.google.firestore.admin.v1.FieldOperat" + + "ionMetadata.IndexConfigDelta.ChangeType\022" + + "/\n\005index\030\002 \001(\0132 .google.firestore.admin." + + "v1.Index\">\n\nChangeType\022\033\n\027CHANGE_TYPE_UN" + + "SPECIFIED\020\000\022\007\n\003ADD\020\001\022\n\n\006REMOVE\020\002\032\262\001\n\016Ttl" + + "ConfigDelta\022`\n\013change_type\030\001 \001(\0162K.googl" + + "e.firestore.admin.v1.FieldOperationMetad" + + "ata.TtlConfigDelta.ChangeType\">\n\nChangeT" + + "ype\022\033\n\027CHANGE_TYPE_UNSPECIFIED\020\000\022\007\n\003ADD\020" + + "\001\022\n\n\006REMOVE\020\002\"\266\003\n\027ExportDocumentsMetadat" + + "a\022.\n\nstart_time\030\001 \001(\0132\032.google.protobuf." + + "Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022B\n\017operation_state\030\003 \001(\016" + + "2).google.firestore.admin.v1.OperationSt" + + "ate\022?\n\022progress_documents\030\004 \001(\0132#.google" + + ".firestore.admin.v1.Progress\022;\n\016progress" + + "_bytes\030\005 \001(\0132#.google.firestore.admin.v1" + + ".Progress\022\026\n\016collection_ids\030\006 \003(\t\022\031\n\021out" + + "put_uri_prefix\030\007 \001(\t\022\025\n\rnamespace_ids\030\010 " + + "\003(\t\0221\n\rsnapshot_time\030\t \001(\0132\032.google.prot" + + "obuf.Timestamp\"\202\003\n\027ImportDocumentsMetada" + + "ta\022.\n\nstart_time\030\001 \001(\0132\032.google.protobuf" + + ".Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022B\n\017operation_state\030\003 \001(" + + "\0162).google.firestore.admin.v1.OperationS" + + "tate\022?\n\022progress_documents\030\004 \001(\0132#.googl" + + "e.firestore.admin.v1.Progress\022;\n\016progres" + + "s_bytes\030\005 \001(\0132#.google.firestore.admin.v" + + "1.Progress\022\026\n\016collection_ids\030\006 \003(\t\022\030\n\020in" + + "put_uri_prefix\030\007 \001(\t\022\025\n\rnamespace_ids\030\010 " + + "\003(\t\"4\n\027ExportDocumentsResponse\022\031\n\021output" + + "_uri_prefix\030\001 \001(\t\":\n\010Progress\022\026\n\016estimat" + + "ed_work\030\001 \001(\003\022\026\n\016completed_work\030\002 \001(\003*\236\001" + + "\n\016OperationState\022\037\n\033OPERATION_STATE_UNSP" + + "ECIFIED\020\000\022\020\n\014INITIALIZING\020\001\022\016\n\nPROCESSIN" + + "G\020\002\022\016\n\nCANCELLING\020\003\022\016\n\nFINALIZING\020\004\022\016\n\nS" + + "UCCESSFUL\020\005\022\n\n\006FAILED\020\006\022\r\n\tCANCELLED\020\007B\335" + + "\001\n\035com.google.firestore.admin.v1B\016Operat" + + "ionProtoP\001Z9cloud.google.com/go/firestor" + + "e/apiv1/admin/adminpb;adminpb\242\002\004GCFS\252\002\037G" + + "oogle.Cloud.Firestore.Admin.V1\312\002\037Google\\" + + "Cloud\\Firestore\\Admin\\V1\352\002#Google::Cloud" + + "::Firestore::Admin::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), com.google.firestore.admin.v1.IndexProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); @@ -198,6 +202,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProgressBytes", "CollectionIds", "OutputUriPrefix", + "NamespaceIds", + "SnapshotTime", }); internal_static_google_firestore_admin_v1_ImportDocumentsMetadata_descriptor = getDescriptor().getMessageTypes().get(3); @@ -212,6 +218,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProgressBytes", "CollectionIds", "InputUriPrefix", + "NamespaceIds", }); internal_static_google_firestore_admin_v1_ExportDocumentsResponse_descriptor = getDescriptor().getMessageTypes().get(4); @@ -229,6 +236,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "EstimatedWork", "CompletedWork", }); + com.google.api.ResourceProto.getDescriptor(); com.google.firestore.admin.v1.IndexProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java index 93a484d12e..422b5b1b60 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Progress.java @@ -23,8 +23,8 @@ * *
  * Describes the progress of the operation.
- * Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
- * is used.
+ * Unit of work is generic and must be interpreted based on where
+ * [Progress][google.firestore.admin.v1.Progress] is used.
  * 
* * Protobuf type {@code google.firestore.admin.v1.Progress} @@ -270,8 +270,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Describes the progress of the operation.
-   * Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
-   * is used.
+   * Unit of work is generic and must be interpreted based on where
+   * [Progress][google.firestore.admin.v1.Progress] is used.
    * 
* * Protobuf type {@code google.firestore.admin.v1.Progress} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/database.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/database.proto index 5d9b762a19..fbf4bd7540 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/database.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/database.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,8 @@ package google.firestore.admin.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; @@ -29,8 +31,6 @@ option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; option ruby_package = "Google::Cloud::Firestore::Admin::V1"; // A Cloud Firestore Database. -// Currently only one database is allowed per cloud project; this database -// must have a `database_id` of '(default)'. message Database { option (google.api.resource) = { type: "firestore.googleapis.com/Database" @@ -78,6 +78,26 @@ message Database { OPTIMISTIC_WITH_ENTITY_GROUPS = 3; } + // Point In Time Recovery feature enablement. + enum PointInTimeRecoveryEnablement { + // Not used. + POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0; + + // Reads are supported on selected versions of the data from within the past + // 7 days: + // + // * Reads against any timestamp within the past hour + // * Reads against 1-minute snapshots beyond 1 hour and within 7 days + // + // `version_retention_period` and `earliest_version_time` can be + // used to determine the supported versions. + POINT_IN_TIME_RECOVERY_ENABLED = 1; + + // Reads are supported on any version of the data from within the past 1 + // hour. + POINT_IN_TIME_RECOVERY_DISABLED = 2; + } + // The type of App Engine integration mode. enum AppEngineIntegrationMode { // Not used. @@ -89,16 +109,44 @@ message Database { // the database. ENABLED = 1; - // Appengine has no affect on the ability of this database to serve + // App Engine has no effect on the ability of this database to serve // requests. + // + // This is the default setting for databases created with the Firestore API. DISABLED = 2; } + // The delete protection state of the database. + enum DeleteProtectionState { + // The default value. Delete protection type is not specified + DELETE_PROTECTION_STATE_UNSPECIFIED = 0; + + // Delete protection is disabled + DELETE_PROTECTION_DISABLED = 1; + + // Delete protection is enabled + DELETE_PROTECTION_ENABLED = 2; + } + // The resource name of the Database. // Format: `projects/{project}/databases/{database}` string name = 1; - // The location of the database. Available databases are listed at + // Output only. The system-generated UUID4 for this Database. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this database was created. Databases + // created before 2016 do not populate create_time. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this database was most recently + // updated. Note this only includes updates to the database resource and not + // data contained by the database. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The location of the database. Available locations are listed at // https://cloud.google.com/firestore/docs/locations. string location_id = 9; @@ -110,18 +158,48 @@ message Database { // The concurrency control mode to use for this database. ConcurrencyMode concurrency_mode = 15; + // Output only. The period during which past versions of data are retained in + // the database. + // + // Any [read][google.firestore.v1.GetDocumentRequest.read_time] + // or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify + // a `read_time` within this window, and will read the state of the database + // at that time. + // + // If the PITR feature is enabled, the retention period is 7 days. Otherwise, + // the retention period is 1 hour. + google.protobuf.Duration version_retention_period = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The earliest timestamp at which older versions of the data can + // be read from the database. See [version_retention_period] above; this field + // is populated with `now - version_retention_period`. + // + // This value is continuously updated, and becomes stale the moment it is + // queried. If you are using this value to recover data, make sure to account + // for the time from the moment when the value is queried to the moment when + // you initiate the recovery. + google.protobuf.Timestamp earliest_version_time = 18 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether to enable the PITR feature on this database. + PointInTimeRecoveryEnablement point_in_time_recovery_enablement = 21; + // The App Engine integration mode to use for this database. AppEngineIntegrationMode app_engine_integration_mode = 19; - // Output only. The key_prefix for this database. This key_prefix is used, in combination - // with the project id ("~") to construct the - // application id that is returned from the Cloud Datastore APIs in Google App - // Engine first generation runtimes. + // Output only. The key_prefix for this database. This key_prefix is used, in + // combination with the project id ("~") to construct + // the application id that is returned from the Cloud Datastore APIs in Google + // App Engine first generation runtimes. // // This value may be empty in which case the appid to use for URL-encoded keys // is the project_id (eg: foo instead of v~foo). string key_prefix = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + // State of delete protection for the database. + DeleteProtectionState delete_protection_state = 22; + // This checksum is computed by the server based on the value of other // fields, and may be sent on update and delete requests to ensure the // client has an up-to-date value before proceeding. diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto index e1faa4dcf7..53f134a1b5 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/firestore_admin.proto @@ -23,9 +23,11 @@ import "google/api/resource.proto"; import "google/firestore/admin/v1/database.proto"; import "google/firestore/admin/v1/field.proto"; import "google/firestore/admin/v1/index.proto"; +import "google/firestore/admin/v1/operation.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; @@ -162,7 +164,8 @@ service FirestoreAdmin { // only supports listing fields that have been explicitly overridden. To issue // this query, call // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] - // with the filter set to `indexConfig.usesAncestorConfig:false` . + // with the filter set to `indexConfig.usesAncestorConfig:false or + // `ttlConfig:*`. rpc ListFields(ListFieldsRequest) returns (ListFieldsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields" @@ -255,6 +258,19 @@ service FirestoreAdmin { metadata_type: "UpdateDatabaseMetadata" }; } + + // Deletes a database. + rpc DeleteDatabase(DeleteDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/databases/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "DeleteDatabaseMetadata" + }; + } } // A request to list the Firestore Databases in all locations for a project. @@ -287,7 +303,11 @@ message CreateDatabaseRequest { // Required. The ID to use for the database, which will become the final // component of the database's resource name. // - // The value must be set to "(default)". + // This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + // with first character a letter and the last a letter or a number. Must not + // be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + // + // "(default)" database id is also valid. string database_id = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -298,6 +318,17 @@ message CreateDatabaseMetadata {} message ListDatabasesResponse { // The databases in the project. repeated Database databases = 1; + + // In the event that data about individual databases cannot be listed they + // will be recorded here. + // + // An example entry might be: projects/some_project/locations/some_location + // This can happen if the Cloud Region that the Database resides in is + // currently unavailable. In this case we can't fetch all the details about + // the database. You may be able to get a more detailed error message + // (or possibly fetch the resource) by sending a 'Get' request for the + // resource or a 'List' request for the specific location. + repeated string unreachable = 3; } // The request for @@ -326,6 +357,27 @@ message UpdateDatabaseRequest { // Metadata related to the update database operation. message UpdateDatabaseMetadata {} +// The request for +// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]. +message DeleteDatabaseRequest { + // Required. A name of the form + // `projects/{project_id}/databases/{database_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // The current etag of the Database. + // If an etag is provided and does not match the current etag of the database, + // deletion will be blocked and a FAILED_PRECONDITION error will be returned. + string etag = 3; +} + +// Metadata related to the delete database operation. +message DeleteDatabaseMetadata {} + // The request for // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. message CreateIndexRequest { @@ -485,6 +537,23 @@ message ExportDocumentsRequest { // If the URI is a bucket (without a namespace path), a prefix will be // generated based on the start time. string output_uri_prefix = 3; + + // An empty list represents all namespaces. This is the preferred + // usage for databases that don't use namespaces. + // + // An empty string element represents the default namespace. This should be + // used if the database has data in non-default namespaces, but doesn't want + // to include them. Each namespace in this list must be unique. + repeated string namespace_ids = 4; + + // The timestamp that corresponds to the version of the database to be + // exported. The timestamp must be in the past, rounded to the minute and not + // older than + // [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time]. + // If specified, then the exported documents will represent a consistent view + // of the database at the provided time. Otherwise, there are no guarantees + // about the consistency of the exported documents. + google.protobuf.Timestamp snapshot_time = 5; } // The request for @@ -509,4 +578,12 @@ message ImportDocumentsRequest { // See: // [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]. string input_uri_prefix = 3; + + // An empty list represents all namespaces. This is the preferred + // usage for databases that don't use namespaces. + // + // An empty string element represents the default namespace. This should be + // used if the database has data in non-default namespaces, but doesn't want + // to include them. Each namespace in this list must be unique. + repeated string namespace_ids = 4; } diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto index abf836d92e..71f4247ae8 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/location.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; option ruby_package = "Google::Cloud::Firestore::Admin::V1"; -// The metadata message for [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata]. -message LocationMetadata { - -} +// The metadata message for +// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata]. +message LocationMetadata {} diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto index 6b0562293f..31f63af37b 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/operation.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.firestore.admin.v1; +import "google/api/resource.proto"; import "google/firestore/admin/v1/index.proto"; import "google/protobuf/timestamp.proto"; @@ -28,7 +29,8 @@ option objc_class_prefix = "GCFS"; option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; option ruby_package = "Google::Cloud::Firestore::Admin::V1"; -// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] +// results from // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. message IndexOperationMetadata { // The time this operation started. @@ -52,7 +54,8 @@ message IndexOperationMetadata { Progress progress_bytes = 6; } -// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] +// results from // [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. message FieldOperationMetadata { // Information about an index configuration change. @@ -76,7 +79,7 @@ message FieldOperationMetadata { Index index = 2; } - // Information about an TTL configuration change. + // Information about a TTL configuration change. message TtlConfigDelta { // Specifies how the TTL config is changing. enum ChangeType { @@ -105,8 +108,9 @@ message FieldOperationMetadata { // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}` string field = 3; - // A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this - // operation. + // A list of + // [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], + // which describe the intent of this operation. repeated IndexConfigDelta index_config_deltas = 4; // The state of the operation. @@ -122,7 +126,8 @@ message FieldOperationMetadata { TtlConfigDelta ttl_config_delta = 8; } -// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] +// results from // [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. message ExportDocumentsMetadata { // The time this operation started. @@ -144,11 +149,20 @@ message ExportDocumentsMetadata { // Which collection ids are being exported. repeated string collection_ids = 6; - // Where the entities are being exported to. + // Where the documents are being exported to. string output_uri_prefix = 7; + + // Which namespace ids are being exported. + repeated string namespace_ids = 8; + + // The timestamp that corresponds to the version of the database that is being + // exported. If unspecified, there are no guarantees about the consistency of + // the documents being exported. + google.protobuf.Timestamp snapshot_time = 9; } -// Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from +// Metadata for [google.longrunning.Operation][google.longrunning.Operation] +// results from // [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. message ImportDocumentsMetadata { // The time this operation started. @@ -172,9 +186,13 @@ message ImportDocumentsMetadata { // The location of the documents being imported. string input_uri_prefix = 7; + + // Which namespace ids are being imported. + repeated string namespace_ids = 8; } -// Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field. +// Returned in the [google.longrunning.Operation][google.longrunning.Operation] +// response field. message ExportDocumentsResponse { // Location of the output files. This can be used to begin an import // into Cloud Firestore (this project or another project) after the operation @@ -212,8 +230,8 @@ enum OperationState { } // Describes the progress of the operation. -// Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress] -// is used. +// Unit of work is generic and must be interpreted based on where +// [Progress][google.firestore.admin.v1.Progress] is used. message Progress { // The amount of work estimated. int64 estimated_work = 1; diff --git a/proto-google-cloud-firestore-bundle-v1/pom.xml b/proto-google-cloud-firestore-bundle-v1/pom.xml index 4ce8bc977f..1e927d07b0 100644 --- a/proto-google-cloud-firestore-bundle-v1/pom.xml +++ b/proto-google-cloud-firestore-bundle-v1/pom.xml @@ -5,14 +5,14 @@ 4.0.0 proto-google-cloud-firestore-bundle-v1 - 3.15.7 + 3.16.0 proto-google-cloud-firestore-bundle-v1 PROTO library for proto-google-cloud-firestore-bundle-v1 com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/proto-google-cloud-firestore-v1/pom.xml b/proto-google-cloud-firestore-v1/pom.xml index 56b8f0887b..f43cf5359e 100644 --- a/proto-google-cloud-firestore-v1/pom.xml +++ b/proto-google-cloud-firestore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-firestore-v1 - 3.15.7 + 3.16.0 proto-google-cloud-firestore-v1 PROTO library for proto-google-cloud-firestore-v1 com.google.cloud google-cloud-firestore-parent - 3.15.7 + 3.16.0 diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java index 90283b7c9d..a4a986d56e 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/FirestoreProto.java @@ -179,242 +179,248 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "tore/v1/aggregation_result.proto\032 google" + "/firestore/v1/common.proto\032\"google/fires" + "tore/v1/document.proto\032\037google/firestore" - + "/v1/query.proto\032\037google/firestore/v1/wri" - + "te.proto\032\033google/protobuf/empty.proto\032\037g" - + "oogle/protobuf/timestamp.proto\032\036google/p" - + "rotobuf/wrappers.proto\032\027google/rpc/statu" - + "s.proto\"\271\001\n\022GetDocumentRequest\022\022\n\004name\030\001" - + " \001(\tB\004\342A\001\002\022/\n\004mask\030\002 \001(\0132!.google.firest" - + "ore.v1.DocumentMask\022\025\n\013transaction\030\003 \001(\014" - + "H\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf." - + "TimestampH\000B\026\n\024consistency_selector\"\301\002\n\024" - + "ListDocumentsRequest\022\024\n\006parent\030\001 \001(\tB\004\342A" - + "\001\002\022\033\n\rcollection_id\030\002 \001(\tB\004\342A\001\001\022\027\n\tpage_" - + "size\030\003 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\004 \001(\tB\004\342A" - + "\001\001\022\026\n\010order_by\030\006 \001(\tB\004\342A\001\001\0225\n\004mask\030\007 \001(\013" - + "2!.google.firestore.v1.DocumentMaskB\004\342A\001" - + "\001\022\025\n\013transaction\030\010 \001(\014H\000\022/\n\tread_time\030\n " - + "\001(\0132\032.google.protobuf.TimestampH\000\022\024\n\014sho" - + "w_missing\030\014 \001(\010B\026\n\024consistency_selector\"" - + "b\n\025ListDocumentsResponse\0220\n\tdocuments\030\001 " - + "\003(\0132\035.google.firestore.v1.Document\022\027\n\017ne" - + "xt_page_token\030\002 \001(\t\"\307\001\n\025CreateDocumentRe" - + "quest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022\033\n\rcollectio" - + "n_id\030\002 \001(\tB\004\342A\001\002\022\023\n\013document_id\030\003 \001(\t\0225\n" - + "\010document\030\004 \001(\0132\035.google.firestore.v1.Do" - + "cumentB\004\342A\001\002\022/\n\004mask\030\005 \001(\0132!.google.fire" - + "store.v1.DocumentMask\"\364\001\n\025UpdateDocument" - + "Request\0225\n\010document\030\001 \001(\0132\035.google.fires" - + "tore.v1.DocumentB\004\342A\001\002\0226\n\013update_mask\030\002 " - + "\001(\0132!.google.firestore.v1.DocumentMask\022/" - + "\n\004mask\030\003 \001(\0132!.google.firestore.v1.Docum" - + "entMask\022;\n\020current_document\030\004 \001(\0132!.goog" - + "le.firestore.v1.Precondition\"h\n\025DeleteDo" - + "cumentRequest\022\022\n\004name\030\001 \001(\tB\004\342A\001\002\022;\n\020cur" - + "rent_document\030\002 \001(\0132!.google.firestore.v" - + "1.Precondition\"\232\002\n\030BatchGetDocumentsRequ" - + "est\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\021\n\tdocuments" - + "\030\002 \003(\t\022/\n\004mask\030\003 \001(\0132!.google.firestore." - + "v1.DocumentMask\022\025\n\013transaction\030\004 \001(\014H\000\022B" - + "\n\017new_transaction\030\005 \001(\0132\'.google.firesto" - + "re.v1.TransactionOptionsH\000\022/\n\tread_time\030" - + "\007 \001(\0132\032.google.protobuf.TimestampH\000B\026\n\024c" - + "onsistency_selector\"\254\001\n\031BatchGetDocument" - + "sResponse\022.\n\005found\030\001 \001(\0132\035.google.firest" - + "ore.v1.DocumentH\000\022\021\n\007missing\030\002 \001(\tH\000\022\023\n\013" - + "transaction\030\003 \001(\014\022-\n\tread_time\030\004 \001(\0132\032.g" - + "oogle.protobuf.TimestampB\010\n\006result\"k\n\027Be" - + "ginTransactionRequest\022\026\n\010database\030\001 \001(\tB" - + "\004\342A\001\002\0228\n\007options\030\002 \001(\0132\'.google.firestor" - + "e.v1.TransactionOptions\"/\n\030BeginTransact" - + "ionResponse\022\023\n\013transaction\030\001 \001(\014\"h\n\rComm" - + "itRequest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022*\n\006wri" - + "tes\030\002 \003(\0132\032.google.firestore.v1.Write\022\023\n" - + "\013transaction\030\003 \001(\014\"z\n\016CommitResponse\0227\n\r" - + "write_results\030\001 \003(\0132 .google.firestore.v" - + "1.WriteResult\022/\n\013commit_time\030\002 \001(\0132\032.goo" - + "gle.protobuf.Timestamp\"D\n\017RollbackReques" - + "t\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\031\n\013transaction" - + "\030\002 \001(\014B\004\342A\001\002\"\233\002\n\017RunQueryRequest\022\024\n\006pare" - + "nt\030\001 \001(\tB\004\342A\001\002\022@\n\020structured_query\030\002 \001(\013" - + "2$.google.firestore.v1.StructuredQueryH\000" - + "\022\025\n\013transaction\030\005 \001(\014H\001\022B\n\017new_transacti" - + "on\030\006 \001(\0132\'.google.firestore.v1.Transacti" - + "onOptionsH\001\022/\n\tread_time\030\007 \001(\0132\032.google." - + "protobuf.TimestampH\001B\014\n\nquery_typeB\026\n\024co" - + "nsistency_selector\"\311\001\n\020RunQueryResponse\022" - + "\023\n\013transaction\030\002 \001(\014\022/\n\010document\030\001 \001(\0132\035" - + ".google.firestore.v1.Document\022-\n\tread_ti" - + "me\030\003 \001(\0132\032.google.protobuf.Timestamp\022\027\n\017" - + "skipped_results\030\004 \001(\005\022\016\n\004done\030\006 \001(\010H\000B\027\n" - + "\025continuation_selector\"\275\002\n\032RunAggregatio" - + "nQueryRequest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022W\n\034s" - + "tructured_aggregation_query\030\002 \001(\0132/.goog" - + "le.firestore.v1.StructuredAggregationQue" - + "ryH\000\022\025\n\013transaction\030\004 \001(\014H\001\022B\n\017new_trans" - + "action\030\005 \001(\0132\'.google.firestore.v1.Trans" - + "actionOptionsH\001\022/\n\tread_time\030\006 \001(\0132\032.goo" - + "gle.protobuf.TimestampH\001B\014\n\nquery_typeB\026" - + "\n\024consistency_selector\"\231\001\n\033RunAggregatio" - + "nQueryResponse\0226\n\006result\030\001 \001(\0132&.google." - + "firestore.v1.AggregationResult\022\023\n\013transa" - + "ction\030\002 \001(\014\022-\n\tread_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\"\206\002\n\025PartitionQueryReq" - + "uest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022@\n\020structured" + + "/v1/query.proto\032\'google/firestore/v1/que" + + "ry_profile.proto\032\037google/firestore/v1/wr" + + "ite.proto\032\033google/protobuf/empty.proto\032\037" + + "google/protobuf/timestamp.proto\032\036google/" + + "protobuf/wrappers.proto\032\027google/rpc/stat" + + "us.proto\"\271\001\n\022GetDocumentRequest\022\022\n\004name\030" + + "\001 \001(\tB\004\342A\001\002\022/\n\004mask\030\002 \001(\0132!.google.fires" + + "tore.v1.DocumentMask\022\025\n\013transaction\030\003 \001(" + + "\014H\000\022/\n\tread_time\030\005 \001(\0132\032.google.protobuf" + + ".TimestampH\000B\026\n\024consistency_selector\"\301\002\n" + + "\024ListDocumentsRequest\022\024\n\006parent\030\001 \001(\tB\004\342" + + "A\001\002\022\033\n\rcollection_id\030\002 \001(\tB\004\342A\001\001\022\027\n\tpage" + + "_size\030\003 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\004 \001(\tB\004\342" + + "A\001\001\022\026\n\010order_by\030\006 \001(\tB\004\342A\001\001\0225\n\004mask\030\007 \001(" + + "\0132!.google.firestore.v1.DocumentMaskB\004\342A" + + "\001\001\022\025\n\013transaction\030\010 \001(\014H\000\022/\n\tread_time\030\n" + + " \001(\0132\032.google.protobuf.TimestampH\000\022\024\n\014sh" + + "ow_missing\030\014 \001(\010B\026\n\024consistency_selector" + + "\"b\n\025ListDocumentsResponse\0220\n\tdocuments\030\001" + + " \003(\0132\035.google.firestore.v1.Document\022\027\n\017n" + + "ext_page_token\030\002 \001(\t\"\307\001\n\025CreateDocumentR" + + "equest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022\033\n\rcollecti" + + "on_id\030\002 \001(\tB\004\342A\001\002\022\023\n\013document_id\030\003 \001(\t\0225" + + "\n\010document\030\004 \001(\0132\035.google.firestore.v1.D" + + "ocumentB\004\342A\001\002\022/\n\004mask\030\005 \001(\0132!.google.fir" + + "estore.v1.DocumentMask\"\364\001\n\025UpdateDocumen" + + "tRequest\0225\n\010document\030\001 \001(\0132\035.google.fire" + + "store.v1.DocumentB\004\342A\001\002\0226\n\013update_mask\030\002" + + " \001(\0132!.google.firestore.v1.DocumentMask\022" + + "/\n\004mask\030\003 \001(\0132!.google.firestore.v1.Docu" + + "mentMask\022;\n\020current_document\030\004 \001(\0132!.goo" + + "gle.firestore.v1.Precondition\"h\n\025DeleteD" + + "ocumentRequest\022\022\n\004name\030\001 \001(\tB\004\342A\001\002\022;\n\020cu" + + "rrent_document\030\002 \001(\0132!.google.firestore." + + "v1.Precondition\"\232\002\n\030BatchGetDocumentsReq" + + "uest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\021\n\tdocument" + + "s\030\002 \003(\t\022/\n\004mask\030\003 \001(\0132!.google.firestore" + + ".v1.DocumentMask\022\025\n\013transaction\030\004 \001(\014H\000\022" + + "B\n\017new_transaction\030\005 \001(\0132\'.google.firest" + + "ore.v1.TransactionOptionsH\000\022/\n\tread_time" + + "\030\007 \001(\0132\032.google.protobuf.TimestampH\000B\026\n\024" + + "consistency_selector\"\254\001\n\031BatchGetDocumen" + + "tsResponse\022.\n\005found\030\001 \001(\0132\035.google.fires" + + "tore.v1.DocumentH\000\022\021\n\007missing\030\002 \001(\tH\000\022\023\n" + + "\013transaction\030\003 \001(\014\022-\n\tread_time\030\004 \001(\0132\032." + + "google.protobuf.TimestampB\010\n\006result\"k\n\027B" + + "eginTransactionRequest\022\026\n\010database\030\001 \001(\t" + + "B\004\342A\001\002\0228\n\007options\030\002 \001(\0132\'.google.firesto" + + "re.v1.TransactionOptions\"/\n\030BeginTransac" + + "tionResponse\022\023\n\013transaction\030\001 \001(\014\"h\n\rCom" + + "mitRequest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022*\n\006wr" + + "ites\030\002 \003(\0132\032.google.firestore.v1.Write\022\023" + + "\n\013transaction\030\003 \001(\014\"z\n\016CommitResponse\0227\n" + + "\rwrite_results\030\001 \003(\0132 .google.firestore." + + "v1.WriteResult\022/\n\013commit_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\"D\n\017RollbackReque" + + "st\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\031\n\013transactio" + + "n\030\002 \001(\014B\004\342A\001\002\"\317\002\n\017RunQueryRequest\022\024\n\006par" + + "ent\030\001 \001(\tB\004\342A\001\002\022@\n\020structured_query\030\002 \001(" + + "\0132$.google.firestore.v1.StructuredQueryH" + + "\000\022\025\n\013transaction\030\005 \001(\014H\001\022B\n\017new_transact" + + "ion\030\006 \001(\0132\'.google.firestore.v1.Transact" + + "ionOptionsH\001\022/\n\tread_time\030\007 \001(\0132\032.google" + + ".protobuf.TimestampH\001\0222\n\004mode\030\t \001(\0162\036.go" + + "ogle.firestore.v1.QueryModeB\004\342A\001\001B\014\n\nque" + + "ry_typeB\026\n\024consistency_selector\"\375\001\n\020RunQ" + + "ueryResponse\022\023\n\013transaction\030\002 \001(\014\022/\n\010doc" + + "ument\030\001 \001(\0132\035.google.firestore.v1.Docume" + + "nt\022-\n\tread_time\030\003 \001(\0132\032.google.protobuf." + + "Timestamp\022\027\n\017skipped_results\030\004 \001(\005\022\016\n\004do" + + "ne\030\006 \001(\010H\000\0222\n\005stats\030\007 \001(\0132#.google.fires" + + "tore.v1.ResultSetStatsB\027\n\025continuation_s" + + "elector\"\361\002\n\032RunAggregationQueryRequest\022\024" + + "\n\006parent\030\001 \001(\tB\004\342A\001\002\022W\n\034structured_aggre" + + "gation_query\030\002 \001(\0132/.google.firestore.v1" + + ".StructuredAggregationQueryH\000\022\025\n\013transac" + + "tion\030\004 \001(\014H\001\022B\n\017new_transaction\030\005 \001(\0132\'." + + "google.firestore.v1.TransactionOptionsH\001" + + "\022/\n\tread_time\030\006 \001(\0132\032.google.protobuf.Ti" + + "mestampH\001\0222\n\004mode\030\007 \001(\0162\036.google.firesto" + + "re.v1.QueryModeB\004\342A\001\001B\014\n\nquery_typeB\026\n\024c" + + "onsistency_selector\"\315\001\n\033RunAggregationQu" + + "eryResponse\0226\n\006result\030\001 \001(\0132&.google.fir" + + "estore.v1.AggregationResult\022\023\n\013transacti" + + "on\030\002 \001(\014\022-\n\tread_time\030\003 \001(\0132\032.google.pro" + + "tobuf.Timestamp\0222\n\005stats\030\006 \001(\0132#.google." + + "firestore.v1.ResultSetStats\"\206\002\n\025Partitio" + + "nQueryRequest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022@\n\020s" + + "tructured_query\030\002 \001(\0132$.google.firestore" + + ".v1.StructuredQueryH\000\022\027\n\017partition_count" + + "\030\003 \001(\003\022\022\n\npage_token\030\004 \001(\t\022\021\n\tpage_size\030" + + "\005 \001(\005\022/\n\tread_time\030\006 \001(\0132\032.google.protob" + + "uf.TimestampH\001B\014\n\nquery_typeB\026\n\024consiste" + + "ncy_selector\"b\n\026PartitionQueryResponse\022/" + + "\n\npartitions\030\001 \003(\0132\033.google.firestore.v1" + + ".Cursor\022\027\n\017next_page_token\030\002 \001(\t\"\351\001\n\014Wri" + + "teRequest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\021\n\tstr" + + "eam_id\030\002 \001(\t\022*\n\006writes\030\003 \003(\0132\032.google.fi" + + "restore.v1.Write\022\024\n\014stream_token\030\004 \001(\014\022=" + + "\n\006labels\030\005 \003(\0132-.google.firestore.v1.Wri" + + "teRequest.LabelsEntry\032-\n\013LabelsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\242\001\n\rWriteRe" + + "sponse\022\021\n\tstream_id\030\001 \001(\t\022\024\n\014stream_toke" + + "n\030\002 \001(\014\0227\n\rwrite_results\030\003 \003(\0132 .google." + + "firestore.v1.WriteResult\022/\n\013commit_time\030" + + "\004 \001(\0132\032.google.protobuf.Timestamp\"\363\001\n\rLi" + + "stenRequest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\0221\n\na" + + "dd_target\030\002 \001(\0132\033.google.firestore.v1.Ta" + + "rgetH\000\022\027\n\rremove_target\030\003 \001(\005H\000\022>\n\006label" + + "s\030\004 \003(\0132..google.firestore.v1.ListenRequ" + + "est.LabelsEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 " + + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\017\n\rtarget_change\"" + + "\325\002\n\016ListenResponse\022:\n\rtarget_change\030\002 \001(" + + "\0132!.google.firestore.v1.TargetChangeH\000\022>" + + "\n\017document_change\030\003 \001(\0132#.google.firesto" + + "re.v1.DocumentChangeH\000\022>\n\017document_delet" + + "e\030\004 \001(\0132#.google.firestore.v1.DocumentDe" + + "leteH\000\022>\n\017document_remove\030\006 \001(\0132#.google" + + ".firestore.v1.DocumentRemoveH\000\0226\n\006filter" + + "\030\005 \001(\0132$.google.firestore.v1.ExistenceFi" + + "lterH\000B\017\n\rresponse_type\"\326\003\n\006Target\0228\n\005qu" + + "ery\030\002 \001(\0132\'.google.firestore.v1.Target.Q" + + "ueryTargetH\000\022@\n\tdocuments\030\003 \001(\0132+.google" + + ".firestore.v1.Target.DocumentsTargetH\000\022\026" + + "\n\014resume_token\030\004 \001(\014H\001\022/\n\tread_time\030\013 \001(" + + "\0132\032.google.protobuf.TimestampH\001\022\021\n\ttarge" + + "t_id\030\005 \001(\005\022\014\n\004once\030\006 \001(\010\0223\n\016expected_cou" + + "nt\030\014 \001(\0132\033.google.protobuf.Int32Value\032$\n" + + "\017DocumentsTarget\022\021\n\tdocuments\030\002 \003(\t\032m\n\013Q" + + "ueryTarget\022\016\n\006parent\030\001 \001(\t\022@\n\020structured" + "_query\030\002 \001(\0132$.google.firestore.v1.Struc" - + "turedQueryH\000\022\027\n\017partition_count\030\003 \001(\003\022\022\n" - + "\npage_token\030\004 \001(\t\022\021\n\tpage_size\030\005 \001(\005\022/\n\t" - + "read_time\030\006 \001(\0132\032.google.protobuf.Timest" - + "ampH\001B\014\n\nquery_typeB\026\n\024consistency_selec" - + "tor\"b\n\026PartitionQueryResponse\022/\n\npartiti" - + "ons\030\001 \003(\0132\033.google.firestore.v1.Cursor\022\027" - + "\n\017next_page_token\030\002 \001(\t\"\351\001\n\014WriteRequest" - + "\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022\021\n\tstream_id\030\002 " - + "\001(\t\022*\n\006writes\030\003 \003(\0132\032.google.firestore.v" - + "1.Write\022\024\n\014stream_token\030\004 \001(\014\022=\n\006labels\030" - + "\005 \003(\0132-.google.firestore.v1.WriteRequest" - + ".LabelsEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t" - + "\022\r\n\005value\030\002 \001(\t:\0028\001\"\242\001\n\rWriteResponse\022\021\n" - + "\tstream_id\030\001 \001(\t\022\024\n\014stream_token\030\002 \001(\014\0227" - + "\n\rwrite_results\030\003 \003(\0132 .google.firestore" - + ".v1.WriteResult\022/\n\013commit_time\030\004 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\"\363\001\n\rListenReque" - + "st\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\0221\n\nadd_target" - + "\030\002 \001(\0132\033.google.firestore.v1.TargetH\000\022\027\n" - + "\rremove_target\030\003 \001(\005H\000\022>\n\006labels\030\004 \003(\0132." - + ".google.firestore.v1.ListenRequest.Label" - + "sEntry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" - + "lue\030\002 \001(\t:\0028\001B\017\n\rtarget_change\"\325\002\n\016Liste" - + "nResponse\022:\n\rtarget_change\030\002 \001(\0132!.googl" - + "e.firestore.v1.TargetChangeH\000\022>\n\017documen" - + "t_change\030\003 \001(\0132#.google.firestore.v1.Doc" - + "umentChangeH\000\022>\n\017document_delete\030\004 \001(\0132#" - + ".google.firestore.v1.DocumentDeleteH\000\022>\n" - + "\017document_remove\030\006 \001(\0132#.google.firestor" - + "e.v1.DocumentRemoveH\000\0226\n\006filter\030\005 \001(\0132$." - + "google.firestore.v1.ExistenceFilterH\000B\017\n" - + "\rresponse_type\"\326\003\n\006Target\0228\n\005query\030\002 \001(\013" - + "2\'.google.firestore.v1.Target.QueryTarge" - + "tH\000\022@\n\tdocuments\030\003 \001(\0132+.google.firestor" - + "e.v1.Target.DocumentsTargetH\000\022\026\n\014resume_" - + "token\030\004 \001(\014H\001\022/\n\tread_time\030\013 \001(\0132\032.googl" - + "e.protobuf.TimestampH\001\022\021\n\ttarget_id\030\005 \001(" - + "\005\022\014\n\004once\030\006 \001(\010\0223\n\016expected_count\030\014 \001(\0132" - + "\033.google.protobuf.Int32Value\032$\n\017Document" - + "sTarget\022\021\n\tdocuments\030\002 \003(\t\032m\n\013QueryTarge" - + "t\022\016\n\006parent\030\001 \001(\t\022@\n\020structured_query\030\002 " - + "\001(\0132$.google.firestore.v1.StructuredQuer" - + "yH\000B\014\n\nquery_typeB\r\n\013target_typeB\r\n\013resu" - + "me_type\"\252\002\n\014TargetChange\022N\n\022target_chang" - + "e_type\030\001 \001(\01622.google.firestore.v1.Targe" - + "tChange.TargetChangeType\022\022\n\ntarget_ids\030\002" - + " \003(\005\022!\n\005cause\030\003 \001(\0132\022.google.rpc.Status\022" - + "\024\n\014resume_token\030\004 \001(\014\022-\n\tread_time\030\006 \001(\013" - + "2\032.google.protobuf.Timestamp\"N\n\020TargetCh" - + "angeType\022\r\n\tNO_CHANGE\020\000\022\007\n\003ADD\020\001\022\n\n\006REMO" - + "VE\020\002\022\013\n\007CURRENT\020\003\022\t\n\005RESET\020\004\"\240\001\n\030ListCol" - + "lectionIdsRequest\022\024\n\006parent\030\001 \001(\tB\004\342A\001\002\022" - + "\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022/" - + "\n\tread_time\030\004 \001(\0132\032.google.protobuf.Time" - + "stampH\000B\026\n\024consistency_selector\"L\n\031ListC" - + "ollectionIdsResponse\022\026\n\016collection_ids\030\001" - + " \003(\t\022\027\n\017next_page_token\030\002 \001(\t\"\312\001\n\021BatchW" - + "riteRequest\022\026\n\010database\030\001 \001(\tB\004\342A\001\002\022*\n\006w" - + "rites\030\002 \003(\0132\032.google.firestore.v1.Write\022" - + "B\n\006labels\030\003 \003(\01322.google.firestore.v1.Ba" - + "tchWriteRequest.LabelsEntry\032-\n\013LabelsEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"q\n\022Ba" - + "tchWriteResponse\0227\n\rwrite_results\030\001 \003(\0132" - + " .google.firestore.v1.WriteResult\022\"\n\006sta" - + "tus\030\002 \003(\0132\022.google.rpc.Status2\332\031\n\tFirest" - + "ore\022\217\001\n\013GetDocument\022\'.google.firestore.v" - + "1.GetDocumentRequest\032\035.google.firestore." - + "v1.Document\"8\202\323\344\223\0022\0220/v1/{name=projects/" - + "*/databases/*/documents/*/**}\022\365\001\n\rListDo" - + "cuments\022).google.firestore.v1.ListDocume" - + "ntsRequest\032*.google.firestore.v1.ListDoc" - + "umentsResponse\"\214\001\202\323\344\223\002\205\001\022B/v1/{parent=pr" - + "ojects/*/databases/*/documents/*/**}/{co" - + "llection_id}Z?\022=/v1/{parent=projects/*/d" - + "atabases/*/documents}/{collection_id}\022\277\001" - + "\n\016UpdateDocument\022*.google.firestore.v1.U" - + "pdateDocumentRequest\032\035.google.firestore." - + "v1.Document\"b\332A\024document,update_mask\202\323\344\223" - + "\002E29/v1/{document.name=projects/*/databa" - + "ses/*/documents/*/**}:\010document\022\225\001\n\016Dele" - + "teDocument\022*.google.firestore.v1.DeleteD" - + "ocumentRequest\032\026.google.protobuf.Empty\"?" - + "\332A\004name\202\323\344\223\0022*0/v1/{name=projects/*/data" - + "bases/*/documents/*/**}\022\271\001\n\021BatchGetDocu" - + "ments\022-.google.firestore.v1.BatchGetDocu" - + "mentsRequest\032..google.firestore.v1.Batch" - + "GetDocumentsResponse\"C\202\323\344\223\002=\"8/v1/{datab" - + "ase=projects/*/databases/*}/documents:ba" - + "tchGet:\001*0\001\022\307\001\n\020BeginTransaction\022,.googl" - + "e.firestore.v1.BeginTransactionRequest\032-" - + ".google.firestore.v1.BeginTransactionRes" - + "ponse\"V\332A\010database\202\323\344\223\002E\"@/v1/{database=" - + "projects/*/databases/*}/documents:beginT" - + "ransaction:\001*\022\246\001\n\006Commit\022\".google.firest" - + "ore.v1.CommitRequest\032#.google.firestore." - + "v1.CommitResponse\"S\332A\017database,writes\202\323\344" - + "\223\002;\"6/v1/{database=projects/*/databases/" - + "*}/documents:commit:\001*\022\244\001\n\010Rollback\022$.go" - + "ogle.firestore.v1.RollbackRequest\032\026.goog" - + "le.protobuf.Empty\"Z\332A\024database,transacti" - + "on\202\323\344\223\002=\"8/v1/{database=projects/*/datab" - + "ases/*}/documents:rollback:\001*\022\337\001\n\010RunQue" - + "ry\022$.google.firestore.v1.RunQueryRequest" - + "\032%.google.firestore.v1.RunQueryResponse\"" - + "\203\001\202\323\344\223\002}\"6/v1/{parent=projects/*/databas" - + "es/*/documents}:runQuery:\001*Z@\";/v1/{pare" + + "turedQueryH\000B\014\n\nquery_typeB\r\n\013target_typ" + + "eB\r\n\013resume_type\"\252\002\n\014TargetChange\022N\n\022tar" + + "get_change_type\030\001 \001(\01622.google.firestore" + + ".v1.TargetChange.TargetChangeType\022\022\n\ntar" + + "get_ids\030\002 \003(\005\022!\n\005cause\030\003 \001(\0132\022.google.rp" + + "c.Status\022\024\n\014resume_token\030\004 \001(\014\022-\n\tread_t" + + "ime\030\006 \001(\0132\032.google.protobuf.Timestamp\"N\n" + + "\020TargetChangeType\022\r\n\tNO_CHANGE\020\000\022\007\n\003ADD\020" + + "\001\022\n\n\006REMOVE\020\002\022\013\n\007CURRENT\020\003\022\t\n\005RESET\020\004\"\240\001" + + "\n\030ListCollectionIdsRequest\022\024\n\006parent\030\001 \001" + + "(\tB\004\342A\001\002\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_toke" + + "n\030\003 \001(\t\022/\n\tread_time\030\004 \001(\0132\032.google.prot" + + "obuf.TimestampH\000B\026\n\024consistency_selector" + + "\"L\n\031ListCollectionIdsResponse\022\026\n\016collect" + + "ion_ids\030\001 \003(\t\022\027\n\017next_page_token\030\002 \001(\t\"\312" + + "\001\n\021BatchWriteRequest\022\026\n\010database\030\001 \001(\tB\004" + + "\342A\001\002\022*\n\006writes\030\002 \003(\0132\032.google.firestore." + + "v1.Write\022B\n\006labels\030\003 \003(\01322.google.firest" + + "ore.v1.BatchWriteRequest.LabelsEntry\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\"q\n\022BatchWriteResponse\0227\n\rwrite_resul" + + "ts\030\001 \003(\0132 .google.firestore.v1.WriteResu" + + "lt\022\"\n\006status\030\002 \003(\0132\022.google.rpc.Status2\332" + + "\031\n\tFirestore\022\217\001\n\013GetDocument\022\'.google.fi" + + "restore.v1.GetDocumentRequest\032\035.google.f" + + "irestore.v1.Document\"8\202\323\344\223\0022\0220/v1/{name=" + + "projects/*/databases/*/documents/*/**}\022\365" + + "\001\n\rListDocuments\022).google.firestore.v1.L" + + "istDocumentsRequest\032*.google.firestore.v" + + "1.ListDocumentsResponse\"\214\001\202\323\344\223\002\205\001\022B/v1/{" + + "parent=projects/*/databases/*/documents/" + + "*/**}/{collection_id}Z?\022=/v1/{parent=pro" + + "jects/*/databases/*/documents}/{collecti" + + "on_id}\022\277\001\n\016UpdateDocument\022*.google.fires" + + "tore.v1.UpdateDocumentRequest\032\035.google.f" + + "irestore.v1.Document\"b\332A\024document,update" + + "_mask\202\323\344\223\002E29/v1/{document.name=projects" + + "/*/databases/*/documents/*/**}:\010document" + + "\022\225\001\n\016DeleteDocument\022*.google.firestore.v" + + "1.DeleteDocumentRequest\032\026.google.protobu" + + "f.Empty\"?\332A\004name\202\323\344\223\0022*0/v1/{name=projec" + + "ts/*/databases/*/documents/*/**}\022\271\001\n\021Bat" + + "chGetDocuments\022-.google.firestore.v1.Bat" + + "chGetDocumentsRequest\032..google.firestore" + + ".v1.BatchGetDocumentsResponse\"C\202\323\344\223\002=\"8/" + + "v1/{database=projects/*/databases/*}/doc" + + "uments:batchGet:\001*0\001\022\307\001\n\020BeginTransactio" + + "n\022,.google.firestore.v1.BeginTransaction" + + "Request\032-.google.firestore.v1.BeginTrans" + + "actionResponse\"V\332A\010database\202\323\344\223\002E\"@/v1/{" + + "database=projects/*/databases/*}/documen" + + "ts:beginTransaction:\001*\022\246\001\n\006Commit\022\".goog" + + "le.firestore.v1.CommitRequest\032#.google.f" + + "irestore.v1.CommitResponse\"S\332A\017database," + + "writes\202\323\344\223\002;\"6/v1/{database=projects/*/d" + + "atabases/*}/documents:commit:\001*\022\244\001\n\010Roll" + + "back\022$.google.firestore.v1.RollbackReque" + + "st\032\026.google.protobuf.Empty\"Z\332A\024database," + + "transaction\202\323\344\223\002=\"8/v1/{database=project" + + "s/*/databases/*}/documents:rollback:\001*\022\337" + + "\001\n\010RunQuery\022$.google.firestore.v1.RunQue" + + "ryRequest\032%.google.firestore.v1.RunQuery" + + "Response\"\203\001\202\323\344\223\002}\"6/v1/{parent=projects/" + + "*/databases/*/documents}:runQuery:\001*Z@\";" + + "/v1/{parent=projects/*/databases/*/docum" + + "ents/*/**}:runQuery:\001*0\001\022\227\002\n\023RunAggregat" + + "ionQuery\022/.google.firestore.v1.RunAggreg" + + "ationQueryRequest\0320.google.firestore.v1." + + "RunAggregationQueryResponse\"\232\001\202\323\344\223\002\223\001\"A/" + + "v1/{parent=projects/*/databases/*/docume" + + "nts}:runAggregationQuery:\001*ZK\"F/v1/{pare" + "nt=projects/*/databases/*/documents/*/**" - + "}:runQuery:\001*0\001\022\227\002\n\023RunAggregationQuery\022" - + "/.google.firestore.v1.RunAggregationQuer" - + "yRequest\0320.google.firestore.v1.RunAggreg" - + "ationQueryResponse\"\232\001\202\323\344\223\002\223\001\"A/v1/{paren" - + "t=projects/*/databases/*/documents}:runA" - + "ggregationQuery:\001*ZK\"F/v1/{parent=projec" - + "ts/*/databases/*/documents/*/**}:runAggr" - + "egationQuery:\001*0\001\022\374\001\n\016PartitionQuery\022*.g" - + "oogle.firestore.v1.PartitionQueryRequest" - + "\032+.google.firestore.v1.PartitionQueryRes" - + "ponse\"\220\001\202\323\344\223\002\211\001\" + * The mode in which the query request must be processed. + *
+ * + * Protobuf enum {@code google.firestore.v1.QueryMode} + */ +public enum QueryMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default mode. Only the query results are returned.
+   * 
+ * + * NORMAL = 0; + */ + NORMAL(0), + /** + * + * + *
+   * This mode returns only the query plan, without any results or execution
+   * statistics information.
+   * 
+ * + * PLAN = 1; + */ + PLAN(1), + /** + * + * + *
+   * This mode returns both the query plan and the execution statistics along
+   * with the results.
+   * 
+ * + * PROFILE = 2; + */ + PROFILE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default mode. Only the query results are returned.
+   * 
+ * + * NORMAL = 0; + */ + public static final int NORMAL_VALUE = 0; + /** + * + * + *
+   * This mode returns only the query plan, without any results or execution
+   * statistics information.
+   * 
+ * + * PLAN = 1; + */ + public static final int PLAN_VALUE = 1; + /** + * + * + *
+   * This mode returns both the query plan and the execution statistics along
+   * with the results.
+   * 
+ * + * PROFILE = 2; + */ + public static final int PROFILE_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static QueryMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static QueryMode forNumber(int value) { + switch (value) { + case 0: + return NORMAL; + case 1: + return PLAN; + case 2: + return PROFILE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public QueryMode findValueByNumber(int number) { + return QueryMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto.getDescriptor().getEnumTypes().get(0); + } + + private static final QueryMode[] VALUES = values(); + + public static QueryMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private QueryMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.v1.QueryMode) +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlan.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlan.java new file mode 100644 index 0000000000..a22cb0ee00 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlan.java @@ -0,0 +1,777 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * Plan for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.QueryPlan} + */ +public final class QueryPlan extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.QueryPlan) + QueryPlanOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryPlan.newBuilder() to construct. + private QueryPlan(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryPlan() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryPlan(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_QueryPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.QueryPlan.class, + com.google.firestore.v1.QueryPlan.Builder.class); + } + + public static final int PLAN_INFO_FIELD_NUMBER = 1; + private com.google.protobuf.Struct planInfo_; + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + @java.lang.Override + public boolean hasPlanInfo() { + return planInfo_ != null; + } + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + @java.lang.Override + public com.google.protobuf.Struct getPlanInfo() { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder() { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (planInfo_ != null) { + output.writeMessage(1, getPlanInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (planInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPlanInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.QueryPlan)) { + return super.equals(obj); + } + com.google.firestore.v1.QueryPlan other = (com.google.firestore.v1.QueryPlan) obj; + + if (hasPlanInfo() != other.hasPlanInfo()) return false; + if (hasPlanInfo()) { + if (!getPlanInfo().equals(other.getPlanInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPlanInfo()) { + hash = (37 * hash) + PLAN_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPlanInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.QueryPlan parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.QueryPlan parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.QueryPlan parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.QueryPlan parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.v1.QueryPlan parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.QueryPlan parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.QueryPlan parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.firestore.v1.QueryPlan prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.QueryPlan} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.QueryPlan) + com.google.firestore.v1.QueryPlanOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_QueryPlan_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.QueryPlan.class, + com.google.firestore.v1.QueryPlan.Builder.class); + } + + // Construct using com.google.firestore.v1.QueryPlan.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + planInfo_ = null; + if (planInfoBuilder_ != null) { + planInfoBuilder_.dispose(); + planInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_QueryPlan_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.QueryPlan getDefaultInstanceForType() { + return com.google.firestore.v1.QueryPlan.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.QueryPlan build() { + com.google.firestore.v1.QueryPlan result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.QueryPlan buildPartial() { + com.google.firestore.v1.QueryPlan result = new com.google.firestore.v1.QueryPlan(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.QueryPlan result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.planInfo_ = planInfoBuilder_ == null ? planInfo_ : planInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.QueryPlan) { + return mergeFrom((com.google.firestore.v1.QueryPlan) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.QueryPlan other) { + if (other == com.google.firestore.v1.QueryPlan.getDefaultInstance()) return this; + if (other.hasPlanInfo()) { + mergePlanInfo(other.getPlanInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getPlanInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Struct planInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + planInfoBuilder_; + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + public boolean hasPlanInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + public com.google.protobuf.Struct getPlanInfo() { + if (planInfoBuilder_ == null) { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } else { + return planInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder setPlanInfo(com.google.protobuf.Struct value) { + if (planInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + planInfo_ = value; + } else { + planInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder setPlanInfo(com.google.protobuf.Struct.Builder builderForValue) { + if (planInfoBuilder_ == null) { + planInfo_ = builderForValue.build(); + } else { + planInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder mergePlanInfo(com.google.protobuf.Struct value) { + if (planInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && planInfo_ != null + && planInfo_ != com.google.protobuf.Struct.getDefaultInstance()) { + getPlanInfoBuilder().mergeFrom(value); + } else { + planInfo_ = value; + } + } else { + planInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public Builder clearPlanInfo() { + bitField0_ = (bitField0_ & ~0x00000001); + planInfo_ = null; + if (planInfoBuilder_ != null) { + planInfoBuilder_.dispose(); + planInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public com.google.protobuf.Struct.Builder getPlanInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getPlanInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + public com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder() { + if (planInfoBuilder_ != null) { + return planInfoBuilder_.getMessageOrBuilder(); + } else { + return planInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : planInfo_; + } + } + /** + * + * + *
+     * Planning phase information for the query. It will include:
+     *
+     * {
+     *   "indexes_used": [
+     *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+     *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+     *   ]
+     * }
+     * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getPlanInfoFieldBuilder() { + if (planInfoBuilder_ == null) { + planInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getPlanInfo(), getParentForChildren(), isClean()); + planInfo_ = null; + } + return planInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.QueryPlan) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.QueryPlan) + private static final com.google.firestore.v1.QueryPlan DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.QueryPlan(); + } + + public static com.google.firestore.v1.QueryPlan getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryPlan parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.QueryPlan getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlanOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlanOrBuilder.java new file mode 100644 index 0000000000..ec83494386 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryPlanOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +package com.google.firestore.v1; + +public interface QueryPlanOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.QueryPlan) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return Whether the planInfo field is set. + */ + boolean hasPlanInfo(); + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + * + * @return The planInfo. + */ + com.google.protobuf.Struct getPlanInfo(); + /** + * + * + *
+   * Planning phase information for the query. It will include:
+   *
+   * {
+   *   "indexes_used": [
+   *     {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"},
+   *     {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"}
+   *   ]
+   * }
+   * 
+ * + * .google.protobuf.Struct plan_info = 1; + */ + com.google.protobuf.StructOrBuilder getPlanInfoOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java new file mode 100644 index 0000000000..ad97a06da4 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/QueryProfileProto.java @@ -0,0 +1,88 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +package com.google.firestore.v1; + +public final class QueryProfileProto { + private QueryProfileProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_QueryPlan_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_QueryPlan_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_firestore_v1_ResultSetStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_firestore_v1_ResultSetStats_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\'google/firestore/v1/query_profile.prot" + + "o\022\023google.firestore.v1\032\034google/protobuf/" + + "struct.proto\"7\n\tQueryPlan\022*\n\tplan_info\030\001" + + " \001(\0132\027.google.protobuf.Struct\"r\n\016ResultS" + + "etStats\0222\n\nquery_plan\030\001 \001(\0132\036.google.fir" + + "estore.v1.QueryPlan\022,\n\013query_stats\030\002 \001(\013" + + "2\027.google.protobuf.Struct*.\n\tQueryMode\022\n" + + "\n\006NORMAL\020\000\022\010\n\004PLAN\020\001\022\013\n\007PROFILE\020\002B\311\001\n\027co" + + "m.google.firestore.v1B\021QueryProfileProto" + + "P\001Z;cloud.google.com/go/firestore/apiv1/" + + "firestorepb;firestorepb\242\002\004GCFS\252\002\031Google." + + "Cloud.Firestore.V1\312\002\031Google\\Cloud\\Firest" + + "ore\\V1\352\002\034Google::Cloud::Firestore::V1b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.StructProto.getDescriptor(), + }); + internal_static_google_firestore_v1_QueryPlan_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_firestore_v1_QueryPlan_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_QueryPlan_descriptor, + new java.lang.String[] { + "PlanInfo", + }); + internal_static_google_firestore_v1_ResultSetStats_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_firestore_v1_ResultSetStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_firestore_v1_ResultSetStats_descriptor, + new java.lang.String[] { + "QueryPlan", "QueryStats", + }); + com.google.protobuf.StructProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStats.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStats.java new file mode 100644 index 0000000000..6c75efedf9 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStats.java @@ -0,0 +1,1075 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +package com.google.firestore.v1; + +/** + * + * + *
+ * Planning and execution statistics for the query.
+ * 
+ * + * Protobuf type {@code google.firestore.v1.ResultSetStats} + */ +public final class ResultSetStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.firestore.v1.ResultSetStats) + ResultSetStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResultSetStats.newBuilder() to construct. + private ResultSetStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResultSetStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResultSetStats(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ResultSetStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ResultSetStats.class, + com.google.firestore.v1.ResultSetStats.Builder.class); + } + + public static final int QUERY_PLAN_FIELD_NUMBER = 1; + private com.google.firestore.v1.QueryPlan queryPlan_; + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + @java.lang.Override + public boolean hasQueryPlan() { + return queryPlan_ != null; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + @java.lang.Override + public com.google.firestore.v1.QueryPlan getQueryPlan() { + return queryPlan_ == null ? com.google.firestore.v1.QueryPlan.getDefaultInstance() : queryPlan_; + } + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + @java.lang.Override + public com.google.firestore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder() { + return queryPlan_ == null ? com.google.firestore.v1.QueryPlan.getDefaultInstance() : queryPlan_; + } + + public static final int QUERY_STATS_FIELD_NUMBER = 2; + private com.google.protobuf.Struct queryStats_; + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + @java.lang.Override + public boolean hasQueryStats() { + return queryStats_ != null; + } + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + @java.lang.Override + public com.google.protobuf.Struct getQueryStats() { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (queryPlan_ != null) { + output.writeMessage(1, getQueryPlan()); + } + if (queryStats_ != null) { + output.writeMessage(2, getQueryStats()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (queryPlan_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getQueryPlan()); + } + if (queryStats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryStats()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.firestore.v1.ResultSetStats)) { + return super.equals(obj); + } + com.google.firestore.v1.ResultSetStats other = (com.google.firestore.v1.ResultSetStats) obj; + + if (hasQueryPlan() != other.hasQueryPlan()) return false; + if (hasQueryPlan()) { + if (!getQueryPlan().equals(other.getQueryPlan())) return false; + } + if (hasQueryStats() != other.hasQueryStats()) return false; + if (hasQueryStats()) { + if (!getQueryStats().equals(other.getQueryStats())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasQueryPlan()) { + hash = (37 * hash) + QUERY_PLAN_FIELD_NUMBER; + hash = (53 * hash) + getQueryPlan().hashCode(); + } + if (hasQueryStats()) { + hash = (37 * hash) + QUERY_STATS_FIELD_NUMBER; + hash = (53 * hash) + getQueryStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.firestore.v1.ResultSetStats parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.v1.ResultSetStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ResultSetStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.firestore.v1.ResultSetStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.firestore.v1.ResultSetStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Planning and execution statistics for the query.
+   * 
+ * + * Protobuf type {@code google.firestore.v1.ResultSetStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.firestore.v1.ResultSetStats) + com.google.firestore.v1.ResultSetStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ResultSetStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.firestore.v1.ResultSetStats.class, + com.google.firestore.v1.ResultSetStats.Builder.class); + } + + // Construct using com.google.firestore.v1.ResultSetStats.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + queryPlan_ = null; + if (queryPlanBuilder_ != null) { + queryPlanBuilder_.dispose(); + queryPlanBuilder_ = null; + } + queryStats_ = null; + if (queryStatsBuilder_ != null) { + queryStatsBuilder_.dispose(); + queryStatsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.firestore.v1.QueryProfileProto + .internal_static_google_firestore_v1_ResultSetStats_descriptor; + } + + @java.lang.Override + public com.google.firestore.v1.ResultSetStats getDefaultInstanceForType() { + return com.google.firestore.v1.ResultSetStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.firestore.v1.ResultSetStats build() { + com.google.firestore.v1.ResultSetStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.firestore.v1.ResultSetStats buildPartial() { + com.google.firestore.v1.ResultSetStats result = + new com.google.firestore.v1.ResultSetStats(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.firestore.v1.ResultSetStats result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.queryPlan_ = queryPlanBuilder_ == null ? queryPlan_ : queryPlanBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.queryStats_ = queryStatsBuilder_ == null ? queryStats_ : queryStatsBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.firestore.v1.ResultSetStats) { + return mergeFrom((com.google.firestore.v1.ResultSetStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.firestore.v1.ResultSetStats other) { + if (other == com.google.firestore.v1.ResultSetStats.getDefaultInstance()) return this; + if (other.hasQueryPlan()) { + mergeQueryPlan(other.getQueryPlan()); + } + if (other.hasQueryStats()) { + mergeQueryStats(other.getQueryStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getQueryPlanFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getQueryStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.firestore.v1.QueryPlan queryPlan_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.QueryPlan, + com.google.firestore.v1.QueryPlan.Builder, + com.google.firestore.v1.QueryPlanOrBuilder> + queryPlanBuilder_; + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + public boolean hasQueryPlan() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + public com.google.firestore.v1.QueryPlan getQueryPlan() { + if (queryPlanBuilder_ == null) { + return queryPlan_ == null + ? com.google.firestore.v1.QueryPlan.getDefaultInstance() + : queryPlan_; + } else { + return queryPlanBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public Builder setQueryPlan(com.google.firestore.v1.QueryPlan value) { + if (queryPlanBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryPlan_ = value; + } else { + queryPlanBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public Builder setQueryPlan(com.google.firestore.v1.QueryPlan.Builder builderForValue) { + if (queryPlanBuilder_ == null) { + queryPlan_ = builderForValue.build(); + } else { + queryPlanBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public Builder mergeQueryPlan(com.google.firestore.v1.QueryPlan value) { + if (queryPlanBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && queryPlan_ != null + && queryPlan_ != com.google.firestore.v1.QueryPlan.getDefaultInstance()) { + getQueryPlanBuilder().mergeFrom(value); + } else { + queryPlan_ = value; + } + } else { + queryPlanBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public Builder clearQueryPlan() { + bitField0_ = (bitField0_ & ~0x00000001); + queryPlan_ = null; + if (queryPlanBuilder_ != null) { + queryPlanBuilder_.dispose(); + queryPlanBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public com.google.firestore.v1.QueryPlan.Builder getQueryPlanBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getQueryPlanFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + public com.google.firestore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder() { + if (queryPlanBuilder_ != null) { + return queryPlanBuilder_.getMessageOrBuilder(); + } else { + return queryPlan_ == null + ? com.google.firestore.v1.QueryPlan.getDefaultInstance() + : queryPlan_; + } + } + /** + * + * + *
+     * Plan for the query.
+     * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.QueryPlan, + com.google.firestore.v1.QueryPlan.Builder, + com.google.firestore.v1.QueryPlanOrBuilder> + getQueryPlanFieldBuilder() { + if (queryPlanBuilder_ == null) { + queryPlanBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.QueryPlan, + com.google.firestore.v1.QueryPlan.Builder, + com.google.firestore.v1.QueryPlanOrBuilder>( + getQueryPlan(), getParentForChildren(), isClean()); + queryPlan_ = null; + } + return queryPlanBuilder_; + } + + private com.google.protobuf.Struct queryStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + queryStatsBuilder_; + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + public boolean hasQueryStats() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + public com.google.protobuf.Struct getQueryStats() { + if (queryStatsBuilder_ == null) { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } else { + return queryStatsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder setQueryStats(com.google.protobuf.Struct value) { + if (queryStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryStats_ = value; + } else { + queryStatsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder setQueryStats(com.google.protobuf.Struct.Builder builderForValue) { + if (queryStatsBuilder_ == null) { + queryStats_ = builderForValue.build(); + } else { + queryStatsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder mergeQueryStats(com.google.protobuf.Struct value) { + if (queryStatsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && queryStats_ != null + && queryStats_ != com.google.protobuf.Struct.getDefaultInstance()) { + getQueryStatsBuilder().mergeFrom(value); + } else { + queryStats_ = value; + } + } else { + queryStatsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public Builder clearQueryStats() { + bitField0_ = (bitField0_ & ~0x00000002); + queryStats_ = null; + if (queryStatsBuilder_ != null) { + queryStatsBuilder_.dispose(); + queryStatsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public com.google.protobuf.Struct.Builder getQueryStatsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getQueryStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() { + if (queryStatsBuilder_ != null) { + return queryStatsBuilder_.getMessageOrBuilder(); + } else { + return queryStats_ == null ? com.google.protobuf.Struct.getDefaultInstance() : queryStats_; + } + } + /** + * + * + *
+     * Aggregated statistics from the execution of the query.
+     *
+     * This will only be present when the request specifies `PROFILE` mode.
+     * For example, a query will return the statistics including:
+     *
+     * {
+     *   "results_returned": "20",
+     *   "documents_scanned": "20",
+     *   "indexes_entries_scanned": "10050",
+     *   "total_execution_time": "100.7 msecs"
+     * }
+     * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getQueryStatsFieldBuilder() { + if (queryStatsBuilder_ == null) { + queryStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getQueryStats(), getParentForChildren(), isClean()); + queryStats_ = null; + } + return queryStatsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.firestore.v1.ResultSetStats) + } + + // @@protoc_insertion_point(class_scope:google.firestore.v1.ResultSetStats) + private static final com.google.firestore.v1.ResultSetStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.firestore.v1.ResultSetStats(); + } + + public static com.google.firestore.v1.ResultSetStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResultSetStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.firestore.v1.ResultSetStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStatsOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStatsOrBuilder.java new file mode 100644 index 0000000000..ecba0e9714 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/ResultSetStatsOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/firestore/v1/query_profile.proto + +package com.google.firestore.v1; + +public interface ResultSetStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.firestore.v1.ResultSetStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return Whether the queryPlan field is set. + */ + boolean hasQueryPlan(); + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + * + * @return The queryPlan. + */ + com.google.firestore.v1.QueryPlan getQueryPlan(); + /** + * + * + *
+   * Plan for the query.
+   * 
+ * + * .google.firestore.v1.QueryPlan query_plan = 1; + */ + com.google.firestore.v1.QueryPlanOrBuilder getQueryPlanOrBuilder(); + + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return Whether the queryStats field is set. + */ + boolean hasQueryStats(); + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + * + * @return The queryStats. + */ + com.google.protobuf.Struct getQueryStats(); + /** + * + * + *
+   * Aggregated statistics from the execution of the query.
+   *
+   * This will only be present when the request specifies `PROFILE` mode.
+   * For example, a query will return the statistics including:
+   *
+   * {
+   *   "results_returned": "20",
+   *   "documents_scanned": "20",
+   *   "indexes_entries_scanned": "10050",
+   *   "total_execution_time": "100.7 msecs"
+   * }
+   * 
+ * + * .google.protobuf.Struct query_stats = 2; + */ + com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder(); +} diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java index 800b830494..773bb73b2d 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequest.java @@ -40,6 +40,7 @@ private RunAggregationQueryRequest(com.google.protobuf.GeneratedMessageV3.Builde private RunAggregationQueryRequest() { parent_ = ""; + mode_ = 0; } @java.lang.Override @@ -436,6 +437,44 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int MODE_FIELD_NUMBER = 7; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mode. + */ + @java.lang.Override + public com.google.firestore.v1.QueryMode getMode() { + com.google.firestore.v1.QueryMode result = com.google.firestore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.firestore.v1.QueryMode.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -465,6 +504,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 6) { output.writeMessage(6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (mode_ != com.google.firestore.v1.QueryMode.NORMAL.getNumber()) { + output.writeEnum(7, mode_); + } getUnknownFields().writeTo(output); } @@ -497,6 +539,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 6, (com.google.protobuf.Timestamp) consistencySelector_); } + if (mode_ != com.google.firestore.v1.QueryMode.NORMAL.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, mode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -514,6 +559,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.firestore.v1.RunAggregationQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (mode_ != other.mode_) return false; if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -550,6 +596,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_AGGREGATION_QUERY_FIELD_NUMBER; @@ -724,6 +772,7 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + mode_ = 0; queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -768,6 +817,9 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryRequest re if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.mode_ = mode_; + } } private void buildPartialOneofs(com.google.firestore.v1.RunAggregationQueryRequest result) { @@ -837,6 +889,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryRequest othe bitField0_ |= 0x00000001; onChanged(); } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_AGGREGATION_QUERY: { @@ -926,6 +981,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 6; break; } // case 50 + case 56: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 56 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1888,6 +1949,110 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.firestore.v1.QueryMode getMode() { + com.google.firestore.v1.QueryMode result = com.google.firestore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.firestore.v1.QueryMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.firestore.v1.QueryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000020); + mode_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java index 8f46e3c0a9..aaa958d14d 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryRequestOrBuilder.java @@ -214,6 +214,35 @@ public interface RunAggregationQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mode. + */ + com.google.firestore.v1.QueryMode getMode(); + com.google.firestore.v1.RunAggregationQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunAggregationQueryRequest.ConsistencySelectorCase diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java index 083525ad4e..575f144fc5 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponse.java @@ -207,6 +207,64 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; } + public static final int STATS_FIELD_NUMBER = 6; + private com.google.firestore.v1.ResultSetStats stats_; + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return stats_ != null; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + @java.lang.Override + public com.google.firestore.v1.ResultSetStats getStats() { + return stats_ == null ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + @java.lang.Override + public com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -230,6 +288,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (readTime_ != null) { output.writeMessage(3, getReadTime()); } + if (stats_ != null) { + output.writeMessage(6, getStats()); + } getUnknownFields().writeTo(output); } @@ -248,6 +309,9 @@ public int getSerializedSize() { if (readTime_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReadTime()); } + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStats()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -273,6 +337,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadTime()) { if (!getReadTime().equals(other.getReadTime())) return false; } + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -294,6 +362,10 @@ public int hashCode() { hash = (37 * hash) + READ_TIME_FIELD_NUMBER; hash = (53 * hash) + getReadTime().hashCode(); } + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -445,6 +517,11 @@ public Builder clear() { readTimeBuilder_.dispose(); readTimeBuilder_ = null; } + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } return this; } @@ -490,6 +567,9 @@ private void buildPartial0(com.google.firestore.v1.RunAggregationQueryResponse r if (((from_bitField0_ & 0x00000004) != 0)) { result.readTime_ = readTimeBuilder_ == null ? readTime_ : readTimeBuilder_.build(); } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + } } @java.lang.Override @@ -547,6 +627,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunAggregationQueryResponse oth if (other.hasReadTime()) { mergeReadTime(other.getReadTime()); } + if (other.hasStats()) { + mergeStats(other.getStats()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -591,6 +674,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 50: + { + input.readMessage(getStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1117,6 +1206,225 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private com.google.firestore.v1.ResultSetStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + public com.google.firestore.v1.ResultSetStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.firestore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public Builder setStats(com.google.firestore.v1.ResultSetStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public Builder mergeStats(com.google.firestore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && stats_ != null + && stats_ != com.google.firestore.v1.ResultSetStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000008); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public com.google.firestore.v1.ResultSetStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + public com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java index 3c257e0c81..087c54f6dc 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunAggregationQueryResponseOrBuilder.java @@ -135,4 +135,51 @@ public interface RunAggregationQueryResponseOrBuilder * .google.protobuf.Timestamp read_time = 3; */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + * + * @return The stats. + */ + com.google.firestore.v1.ResultSetStats getStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 6; + */ + com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder(); } diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java index 8d246bd913..13e2d3d2d2 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequest.java @@ -39,6 +39,7 @@ private RunQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builde private RunQueryRequest() { parent_ = ""; + mode_ = 0; } @java.lang.Override @@ -434,6 +435,44 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int MODE_FIELD_NUMBER = 9; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mode. + */ + @java.lang.Override + public com.google.firestore.v1.QueryMode getMode() { + com.google.firestore.v1.QueryMode result = com.google.firestore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.firestore.v1.QueryMode.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -463,6 +502,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistencySelectorCase_ == 7) { output.writeMessage(7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (mode_ != com.google.firestore.v1.QueryMode.NORMAL.getNumber()) { + output.writeEnum(9, mode_); + } getUnknownFields().writeTo(output); } @@ -495,6 +537,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 7, (com.google.protobuf.Timestamp) consistencySelector_); } + if (mode_ != com.google.firestore.v1.QueryMode.NORMAL.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, mode_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -511,6 +556,7 @@ public boolean equals(final java.lang.Object obj) { com.google.firestore.v1.RunQueryRequest other = (com.google.firestore.v1.RunQueryRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (mode_ != other.mode_) return false; if (!getQueryTypeCase().equals(other.getQueryTypeCase())) return false; switch (queryTypeCase_) { case 2: @@ -546,6 +592,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; switch (queryTypeCase_) { case 2: hash = (37 * hash) + STRUCTURED_QUERY_FIELD_NUMBER; @@ -719,6 +767,7 @@ public Builder clear() { if (readTimeBuilder_ != null) { readTimeBuilder_.clear(); } + mode_ = 0; queryTypeCase_ = 0; queryType_ = null; consistencySelectorCase_ = 0; @@ -763,6 +812,9 @@ private void buildPartial0(com.google.firestore.v1.RunQueryRequest result) { if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.mode_ = mode_; + } } private void buildPartialOneofs(com.google.firestore.v1.RunQueryRequest result) { @@ -831,6 +883,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryRequest other) { bitField0_ |= 0x00000001; onChanged(); } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } switch (other.getQueryTypeCase()) { case STRUCTURED_QUERY: { @@ -919,6 +974,12 @@ public Builder mergeFrom( consistencySelectorCase_ = 7; break; } // case 58 + case 72: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 72 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1867,6 +1928,110 @@ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { return readTimeBuilder_; } + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.firestore.v1.QueryMode getMode() { + com.google.firestore.v1.QueryMode result = com.google.firestore.v1.QueryMode.forNumber(mode_); + return result == null ? com.google.firestore.v1.QueryMode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.firestore.v1.QueryMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode in which the query request is processed. This field is
+     * optional, and when not provided, it defaults to `NORMAL` mode where no
+     * additional statistics will be returned with the query results.
+     * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000020); + mode_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java index beb2dc58e3..3d32302f65 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryRequestOrBuilder.java @@ -213,6 +213,35 @@ public interface RunQueryRequestOrBuilder */ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode in which the query request is processed. This field is
+   * optional, and when not provided, it defaults to `NORMAL` mode where no
+   * additional statistics will be returned with the query results.
+   * 
+ * + * .google.firestore.v1.QueryMode mode = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The mode. + */ + com.google.firestore.v1.QueryMode getMode(); + com.google.firestore.v1.RunQueryRequest.QueryTypeCase getQueryTypeCase(); com.google.firestore.v1.RunQueryRequest.ConsistencySelectorCase getConsistencySelectorCase(); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java index 75ba7686d7..5fa04011a1 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponse.java @@ -297,6 +297,64 @@ public boolean getDone() { return false; } + public static final int STATS_FIELD_NUMBER = 7; + private com.google.firestore.v1.ResultSetStats stats_; + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return Whether the stats field is set. + */ + @java.lang.Override + public boolean hasStats() { + return stats_ != null; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return The stats. + */ + @java.lang.Override + public com.google.firestore.v1.ResultSetStats getStats() { + return stats_ == null ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + @java.lang.Override + public com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + return stats_ == null ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() : stats_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -326,6 +384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (continuationSelectorCase_ == 6) { output.writeBool(6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (stats_ != null) { + output.writeMessage(7, getStats()); + } getUnknownFields().writeTo(output); } @@ -352,6 +413,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 6, (boolean) ((java.lang.Boolean) continuationSelector_)); } + if (stats_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getStats()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -377,6 +441,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReadTime().equals(other.getReadTime())) return false; } if (getSkippedResults() != other.getSkippedResults()) return false; + if (hasStats() != other.hasStats()) return false; + if (hasStats()) { + if (!getStats().equals(other.getStats())) return false; + } if (!getContinuationSelectorCase().equals(other.getContinuationSelectorCase())) return false; switch (continuationSelectorCase_) { case 6: @@ -408,6 +476,10 @@ public int hashCode() { } hash = (37 * hash) + SKIPPED_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getSkippedResults(); + if (hasStats()) { + hash = (37 * hash) + STATS_FIELD_NUMBER; + hash = (53 * hash) + getStats().hashCode(); + } switch (continuationSelectorCase_) { case 6: hash = (37 * hash) + DONE_FIELD_NUMBER; @@ -568,6 +640,11 @@ public Builder clear() { readTimeBuilder_ = null; } skippedResults_ = 0; + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } continuationSelectorCase_ = 0; continuationSelector_ = null; return this; @@ -619,6 +696,9 @@ private void buildPartial0(com.google.firestore.v1.RunQueryResponse result) { if (((from_bitField0_ & 0x00000008) != 0)) { result.skippedResults_ = skippedResults_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stats_ = statsBuilder_ == null ? stats_ : statsBuilder_.build(); + } } private void buildPartialOneofs(com.google.firestore.v1.RunQueryResponse result) { @@ -683,6 +763,9 @@ public Builder mergeFrom(com.google.firestore.v1.RunQueryResponse other) { if (other.getSkippedResults() != 0) { setSkippedResults(other.getSkippedResults()); } + if (other.hasStats()) { + mergeStats(other.getStats()); + } switch (other.getContinuationSelectorCase()) { case DONE: { @@ -750,6 +833,12 @@ public Builder mergeFrom( continuationSelectorCase_ = 6; break; } // case 48 + case 58: + { + input.readMessage(getStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1396,6 +1485,225 @@ public Builder clearDone() { return this; } + private com.google.firestore.v1.ResultSetStats stats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder> + statsBuilder_; + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return Whether the stats field is set. + */ + public boolean hasStats() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return The stats. + */ + public com.google.firestore.v1.ResultSetStats getStats() { + if (statsBuilder_ == null) { + return stats_ == null + ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } else { + return statsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public Builder setStats(com.google.firestore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stats_ = value; + } else { + statsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public Builder setStats(com.google.firestore.v1.ResultSetStats.Builder builderForValue) { + if (statsBuilder_ == null) { + stats_ = builderForValue.build(); + } else { + statsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public Builder mergeStats(com.google.firestore.v1.ResultSetStats value) { + if (statsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stats_ != null + && stats_ != com.google.firestore.v1.ResultSetStats.getDefaultInstance()) { + getStatsBuilder().mergeFrom(value); + } else { + stats_ = value; + } + } else { + statsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public Builder clearStats() { + bitField0_ = (bitField0_ & ~0x00000020); + stats_ = null; + if (statsBuilder_ != null) { + statsBuilder_.dispose(); + statsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public com.google.firestore.v1.ResultSetStats.Builder getStatsBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + public com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { + if (statsBuilder_ != null) { + return statsBuilder_.getMessageOrBuilder(); + } else { + return stats_ == null + ? com.google.firestore.v1.ResultSetStats.getDefaultInstance() + : stats_; + } + } + /** + * + * + *
+     * Query plan and execution statistics. Note that the returned stats are
+     * subject to change as Firestore evolves.
+     *
+     * This is only present when the request specifies a mode other than `NORMAL`
+     * and is sent only once with the last response in the stream.
+     * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder> + getStatsFieldBuilder() { + if (statsBuilder_ == null) { + statsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.firestore.v1.ResultSetStats, + com.google.firestore.v1.ResultSetStats.Builder, + com.google.firestore.v1.ResultSetStatsOrBuilder>( + getStats(), getParentForChildren(), isClean()); + stats_ = null; + } + return statsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java index dab4a7f2be..8d2a38910b 100644 --- a/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java +++ b/proto-google-cloud-firestore-v1/src/main/java/com/google/firestore/v1/RunQueryResponseOrBuilder.java @@ -169,5 +169,52 @@ public interface RunQueryResponseOrBuilder */ boolean getDone(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return Whether the stats field is set. + */ + boolean hasStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + * + * @return The stats. + */ + com.google.firestore.v1.ResultSetStats getStats(); + /** + * + * + *
+   * Query plan and execution statistics. Note that the returned stats are
+   * subject to change as Firestore evolves.
+   *
+   * This is only present when the request specifies a mode other than `NORMAL`
+   * and is sent only once with the last response in the stream.
+   * 
+ * + * .google.firestore.v1.ResultSetStats stats = 7; + */ + com.google.firestore.v1.ResultSetStatsOrBuilder getStatsOrBuilder(); + com.google.firestore.v1.RunQueryResponse.ContinuationSelectorCase getContinuationSelectorCase(); } diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto index 3b843eed58..cc38cfb4a4 100644 --- a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/firestore.proto @@ -23,6 +23,7 @@ import "google/firestore/v1/aggregation_result.proto"; import "google/firestore/v1/common.proto"; import "google/firestore/v1/document.proto"; import "google/firestore/v1/query.proto"; +import "google/firestore/v1/query_profile.proto"; import "google/firestore/v1/write.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -576,6 +577,11 @@ message RunQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 7; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 9 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -612,6 +618,13 @@ message RunQueryResponse { // documents will be returned. bool done = 6; } + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL` + // and is sent only once with the last response in the stream. + ResultSetStats stats = 7; } // The request for @@ -651,6 +664,11 @@ message RunAggregationQueryRequest { // minute timestamp within the past 7 days. google.protobuf.Timestamp read_time = 6; } + + // Optional. The mode in which the query request is processed. This field is + // optional, and when not provided, it defaults to `NORMAL` mode where no + // additional statistics will be returned with the query results. + QueryMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; } // The response for @@ -676,6 +694,13 @@ message RunAggregationQueryResponse { // `result` will be sent, and this represents the time at which the query // was run. google.protobuf.Timestamp read_time = 3; + + // Query plan and execution statistics. Note that the returned stats are + // subject to change as Firestore evolves. + // + // This is only present when the request specifies a mode other than `NORMAL` + // and is sent only once with the last response in the stream. + ResultSetStats stats = 6; } // The request for diff --git a/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto new file mode 100644 index 0000000000..371aa1ef21 --- /dev/null +++ b/proto-google-cloud-firestore-v1/src/main/proto/google/firestore/v1/query_profile.proto @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.firestore.v1; + +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb"; +option java_multiple_files = true; +option java_outer_classname = "QueryProfileProto"; +option java_package = "com.google.firestore.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\V1"; +option ruby_package = "Google::Cloud::Firestore::V1"; + +// Specification of the Firestore Query Profile fields. + +// The mode in which the query request must be processed. +enum QueryMode { + // The default mode. Only the query results are returned. + NORMAL = 0; + + // This mode returns only the query plan, without any results or execution + // statistics information. + PLAN = 1; + + // This mode returns both the query plan and the execution statistics along + // with the results. + PROFILE = 2; +} + +// Plan for the query. +message QueryPlan { + // Planning phase information for the query. It will include: + // + // { + // "indexes_used": [ + // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + // ] + // } + google.protobuf.Struct plan_info = 1; +} + +// Planning and execution statistics for the query. +message ResultSetStats { + // Plan for the query. + QueryPlan query_plan = 1; + + // Aggregated statistics from the execution of the query. + // + // This will only be present when the request specifies `PROFILE` mode. + // For example, a query will return the statistics including: + // + // { + // "results_returned": "20", + // "documents_scanned": "20", + // "indexes_entries_scanned": "10050", + // "total_execution_time": "100.7 msecs" + // } + google.protobuf.Struct query_stats = 2; +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index b3ab468aa1..b529548d96 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -20,7 +20,7 @@ 1.8 1.8 - 2.52.0 + 2.53.0 UTF-8 @@ -30,7 +30,7 @@ com.google.cloud google-cloud-firestore - 3.15.6 + 3.15.7 diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index 32f1afd5bc..7a06356f98 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -23,7 +23,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> 1.8 1.8 - 2.52.0 + 2.53.0 UTF-8 @@ -32,7 +32,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> com.google.cloud libraries-bom - 26.27.0 + 26.29.0 pom import @@ -113,7 +113,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.2.5 **/IT* diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 8c0a384a46..b2d79866f7 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -21,7 +21,7 @@ 1.8 1.8 UTF-8 - 2.52.0 + 2.53.0 @@ -29,7 +29,7 @@ com.google.cloud google-cloud-firestore - 3.15.6 + 3.15.7 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 86d278309f..51d2add5dc 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -21,7 +21,7 @@ 1.8 1.8 UTF-8 - 2.52.0 + 2.53.0 @@ -34,7 +34,7 @@ com.google.cloud libraries-bom - 26.27.0 + 26.29.0 pom import diff --git a/versions.txt b/versions.txt index 8dac363c37..124a5dedb6 100644 --- a/versions.txt +++ b/versions.txt @@ -1,11 +1,11 @@ # Format: # module:released-version:current-version -google-cloud-firestore:3.15.7:3.15.7 -google-cloud-firestore-admin:3.15.7:3.15.7 -google-cloud-firestore-bom:3.15.7:3.15.7 -grpc-google-cloud-firestore-admin-v1:3.15.7:3.15.7 -grpc-google-cloud-firestore-v1:3.15.7:3.15.7 -proto-google-cloud-firestore-admin-v1:3.15.7:3.15.7 -proto-google-cloud-firestore-v1:3.15.7:3.15.7 -proto-google-cloud-firestore-bundle-v1:3.15.7:3.15.7 +google-cloud-firestore:3.16.0:3.16.0 +google-cloud-firestore-admin:3.16.0:3.16.0 +google-cloud-firestore-bom:3.16.0:3.16.0 +grpc-google-cloud-firestore-admin-v1:3.16.0:3.16.0 +grpc-google-cloud-firestore-v1:3.16.0:3.16.0 +proto-google-cloud-firestore-admin-v1:3.16.0:3.16.0 +proto-google-cloud-firestore-v1:3.16.0:3.16.0 +proto-google-cloud-firestore-bundle-v1:3.16.0:3.16.0