diff --git a/google-cloud-firestore/clirr-ignored-differences.xml b/google-cloud-firestore/clirr-ignored-differences.xml
index 84adffe46..703537fb5 100644
--- a/google-cloud-firestore/clirr-ignored-differences.xml
+++ b/google-cloud-firestore/clirr-ignored-differences.xml
@@ -36,4 +36,102 @@
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * Index index = Index.newBuilder().build();
- * Operation response = firestoreAdminClient.createIndex(parent, index);
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
+ * firestoreAdminClient.deleteIndex(name);
* }
*
*
@@ -125,6 +132,7 @@
public class FirestoreAdminClient implements BackgroundResource {
private final FirestoreAdminSettings settings;
private final FirestoreAdminStub stub;
+ private final OperationsClient operationsClient;
/** Constructs an instance of FirestoreAdminClient with default settings. */
public static final FirestoreAdminClient create() throws IOException {
@@ -157,12 +165,14 @@ public static final FirestoreAdminClient create(FirestoreAdminStub stub) {
protected FirestoreAdminClient(FirestoreAdminSettings settings) throws IOException {
this.settings = settings;
this.stub = ((FirestoreAdminStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected FirestoreAdminClient(FirestoreAdminStub stub) {
this.settings = null;
this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
public final FirestoreAdminSettings getSettings() {
@@ -174,6 +184,249 @@ public FirestoreAdminStub getStub() {
return stub;
}
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a composite index.
+ *
+ * Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
+ * firestoreAdminClient.deleteIndex(name);
+ * }
+ *
+ *
+ * @param name Required. A name of the form
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteIndex(IndexName name) {
+ DeleteIndexRequest request =
+ DeleteIndexRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteIndex(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a composite index.
+ *
+ * Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
+ * firestoreAdminClient.deleteIndex(name.toString());
+ * }
+ *
+ *
+ * @param name Required. A name of the form
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteIndex(String name) {
+ DeleteIndexRequest request = DeleteIndexRequest.newBuilder().setName(name).build();
+ deleteIndex(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a composite index.
+ *
+ * Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
+ * DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * firestoreAdminClient.deleteIndex(request);
+ * }
+ *
+ *
+ * @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 void deleteIndex(DeleteIndexRequest request) {
+ deleteIndexCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a composite index.
+ *
+ * Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
+ * DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = firestoreAdminClient.deleteIndexCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThis 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/*`. + * + *
Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * Field field = Field.newBuilder().build();
+ * Field response = firestoreAdminClient.updateFieldAsync(field).get();
+ * }
+ *
+ *
+ * @param field Required. The field to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureThis 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/*`. + * + *
Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * Field field = Field.newBuilder().build();
+ * UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
+ * .setField(field)
+ * .build();
+ * Field response = firestoreAdminClient.updateFieldAsync(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
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureThis 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/*`. + * + *
Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * Field field = Field.newBuilder().build();
+ * UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
+ * .setField(field)
+ * .build();
+ * OperationFuture<Field, FieldOperationMetadata> future = firestoreAdminClient.updateFieldOperationCallable().futureCall(request);
+ * // Do something
+ * Field response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallableThis 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/*`. + * + *
Sample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * Field field = Field.newBuilder().build();
+ * UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
+ * .setField(field)
+ * .build();
+ * ApiFuture<Operation> future = firestoreAdminClient.updateFieldCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* Index index = Index.newBuilder().build();
- * Operation response = firestoreAdminClient.createIndex(parent, index);
+ * Index response = firestoreAdminClient.createIndexAsync(parent, index).get();
* }
*
*
@@ -196,13 +449,16 @@ public FirestoreAdminStub getStub() {
* @param index Required. The composite index to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation createIndex(ParentName parent, Index index) {
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* Index index = Index.newBuilder().build();
- * Operation response = firestoreAdminClient.createIndex(parent.toString(), index);
+ * Index response = firestoreAdminClient.createIndexAsync(parent.toString(), index).get();
* }
*
*
@@ -227,10 +483,13 @@ public final Operation createIndex(ParentName parent, Index index) {
* @param index Required. The composite index to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation createIndex(String parent, Index index) {
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* Index index = Index.newBuilder().build();
* CreateIndexRequest request = CreateIndexRequest.newBuilder()
* .setParent(parent.toString())
* .setIndex(index)
* .build();
- * Operation response = firestoreAdminClient.createIndex(request);
+ * Index response = firestoreAdminClient.createIndexAsync(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 Operation createIndex(CreateIndexRequest request) {
- return createIndexCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFutureSample code: + * + *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * Index index = Index.newBuilder().build();
+ * CreateIndexRequest request = CreateIndexRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setIndex(index)
+ * .build();
+ * OperationFuture<Index, IndexOperationMetadata> future = firestoreAdminClient.createIndexOperationCallable().futureCall(request);
+ * // Do something
+ * Index response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* Index index = Index.newBuilder().build();
* CreateIndexRequest request = CreateIndexRequest.newBuilder()
* .setParent(parent.toString())
@@ -296,7 +587,7 @@ public final UnaryCallable createIndexCallable()
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* for (Index element : firestoreAdminClient.listIndexes(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -307,7 +598,7 @@ public final UnaryCallable createIndexCallable()
* `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListIndexesPagedResponse listIndexes(ParentName parent) {
+ public final ListIndexesPagedResponse listIndexes(CollectionGroupName parent) {
ListIndexesRequest request =
ListIndexesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -323,7 +614,7 @@ public final ListIndexesPagedResponse listIndexes(ParentName parent) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* for (Index element : firestoreAdminClient.listIndexes(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -347,7 +638,7 @@ public final ListIndexesPagedResponse listIndexes(String parent) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* ListIndexesRequest request = ListIndexesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -372,7 +663,7 @@ public final ListIndexesPagedResponse listIndexes(ListIndexesRequest request) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* ListIndexesRequest request = ListIndexesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -397,7 +688,7 @@ public final ListIndexesPagedResponse listIndexes(ListIndexesRequest request) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
* ListIndexesRequest request = ListIndexesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -428,7 +719,7 @@ public final UnaryCallable listIndexesC
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
* Index response = firestoreAdminClient.getIndex(name);
* }
*
@@ -451,7 +742,7 @@ public final Index getIndex(IndexName name) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
* Index response = firestoreAdminClient.getIndex(name.toString());
* }
*
@@ -473,7 +764,7 @@ public final Index getIndex(String name) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
* GetIndexRequest request = GetIndexRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -496,7 +787,7 @@ public final Index getIndex(GetIndexRequest request) {
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
+ * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[INDEX]");
* GetIndexRequest request = GetIndexRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -512,194 +803,246 @@ public final UnaryCallable getIndexCallable() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a composite index.
+ * Gets the metadata and configuration for a Field.
*
* Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
- * firestoreAdminClient.deleteIndex(name);
+ * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]");
+ * Field response = firestoreAdminClient.getField(name);
* }
*
*
* @param name Required. A name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteIndex(IndexName name) {
- DeleteIndexRequest request =
- DeleteIndexRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteIndex(request);
+ public final Field getField(FieldName name) {
+ GetFieldRequest request =
+ GetFieldRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getField(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a composite index.
+ * Gets the metadata and configuration for a Field.
*
* Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
- * firestoreAdminClient.deleteIndex(name.toString());
+ * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]");
+ * Field response = firestoreAdminClient.getField(name.toString());
* }
*
*
* @param name Required. A name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteIndex(String name) {
- DeleteIndexRequest request = DeleteIndexRequest.newBuilder().setName(name).build();
- deleteIndex(request);
+ public final Field getField(String name) {
+ GetFieldRequest request = GetFieldRequest.newBuilder().setName(name).build();
+ return getField(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a composite index.
+ * Gets the metadata and configuration for a Field.
*
* Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
- * DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+ * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]");
+ * GetFieldRequest request = GetFieldRequest.newBuilder()
* .setName(name.toString())
* .build();
- * firestoreAdminClient.deleteIndex(request);
+ * Field response = firestoreAdminClient.getField(request);
* }
*
*
* @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 void deleteIndex(DeleteIndexRequest request) {
- deleteIndexCallable().call(request);
+ public final Field getField(GetFieldRequest request) {
+ return getFieldCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a composite index.
+ * Gets the metadata and configuration for a Field.
*
* Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * IndexName name = IndexName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[INDEX_ID]");
- * DeleteIndexRequest request = DeleteIndexRequest.newBuilder()
+ * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]", "[FIELD]");
+ * GetFieldRequest request = GetFieldRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Void> future = firestoreAdminClient.deleteIndexCallable().futureCall(request);
+ * ApiFuture<Field> future = firestoreAdminClient.getFieldCallable().futureCall(request);
* // Do something
- * future.get();
+ * Field response = future.get();
* }
*
*/
- public final UnaryCallable deleteIndexCallable() {
- return stub.deleteIndexCallable();
+ public final UnaryCallable getFieldCallable() {
+ return stub.getFieldCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * 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`.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * Operation response = firestoreAdminClient.importDocuments(name);
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * for (Field element : firestoreAdminClient.listFields(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param name Required. Database to import into. Should be of the form:
- * `projects/{project_id}/databases/{database_id}`.
+ * @param parent Required. A parent name of the form
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation importDocuments(DatabaseName name) {
- ImportDocumentsRequest request =
- ImportDocumentsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return importDocuments(request);
+ public final ListFieldsPagedResponse listFields(CollectionGroupName parent) {
+ ListFieldsRequest request =
+ ListFieldsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listFields(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * 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`.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * Operation response = firestoreAdminClient.importDocuments(name.toString());
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * for (Field element : firestoreAdminClient.listFields(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param name Required. Database to import into. Should be of the form:
- * `projects/{project_id}/databases/{database_id}`.
+ * @param parent Required. A parent name of the form
+ * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation importDocuments(String name) {
- ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder().setName(name).build();
- return importDocuments(request);
+ public final ListFieldsPagedResponse listFields(String parent) {
+ ListFieldsRequest request = ListFieldsRequest.newBuilder().setParent(parent).build();
+ return listFields(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * 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`.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
- * .setName(name.toString())
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * ListFieldsRequest request = ListFieldsRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * Operation response = firestoreAdminClient.importDocuments(request);
+ * for (Field element : firestoreAdminClient.listFields(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
* @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 Operation importDocuments(ImportDocumentsRequest request) {
- return importDocumentsCallable().call(request);
+ public final ListFieldsPagedResponse listFields(ListFieldsRequest request) {
+ return listFieldsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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.
+ * 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`.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
- * .setName(name.toString())
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * ListFieldsRequest request = ListFieldsRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * ApiFuture<Operation> future = firestoreAdminClient.importDocumentsCallable().futureCall(request);
+ * ApiFuture<ListFieldsPagedResponse> future = firestoreAdminClient.listFieldsPagedCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * for (Field element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*/
- public final UnaryCallable importDocumentsCallable() {
- return stub.importDocumentsCallable();
+ public final UnaryCallable listFieldsPagedCallable() {
+ return stub.listFieldsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * 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`.
+ *
+ *
Sample code:
+ *
+ *
+ * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
+ * CollectionGroupName parent = CollectionGroupName.of("[PROJECT]", "[DATABASE]", "[COLLECTION]");
+ * ListFieldsRequest request = ListFieldsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * while (true) {
+ * ListFieldsResponse response = firestoreAdminClient.listFieldsCallable().call(request);
+ * for (Field element : response.getFieldsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable listFieldsCallable() {
+ return stub.listFieldsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -716,7 +1059,7 @@ public final UnaryCallable importDocumentsCal
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * Operation response = firestoreAdminClient.exportDocuments(name);
+ * ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(name).get();
* }
*
*
@@ -724,10 +1067,13 @@ public final UnaryCallable importDocumentsCal
* `projects/{project_id}/databases/{database_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation exportDocuments(DatabaseName name) {
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ exportDocumentsAsync(DatabaseName name) {
ExportDocumentsRequest request =
ExportDocumentsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return exportDocuments(request);
+ return exportDocumentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -744,7 +1090,7 @@ public final Operation exportDocuments(DatabaseName name) {
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
- * Operation response = firestoreAdminClient.exportDocuments(name.toString());
+ * ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(name.toString()).get();
* }
*
*
@@ -752,9 +1098,12 @@ public final Operation exportDocuments(DatabaseName name) {
* `projects/{project_id}/databases/{database_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Operation exportDocuments(String name) {
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ exportDocumentsAsync(String name) {
ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder().setName(name).build();
- return exportDocuments(request);
+ return exportDocumentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -774,15 +1123,18 @@ public final Operation exportDocuments(String name) {
* ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder()
* .setName(name.toString())
* .build();
- * Operation response = firestoreAdminClient.exportDocuments(request);
+ * ExportDocumentsResponse response = firestoreAdminClient.exportDocumentsAsync(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 Operation exportDocuments(ExportDocumentsRequest request) {
- return exportDocumentsCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture
+ exportDocumentsAsync(ExportDocumentsRequest request) {
+ return exportDocumentsOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -802,360 +1154,181 @@ public final Operation exportDocuments(ExportDocumentsRequest request) {
* ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Operation> future = firestoreAdminClient.exportDocumentsCallable().futureCall(request);
+ * OperationFuture<ExportDocumentsResponse, ExportDocumentsMetadata> future = firestoreAdminClient.exportDocumentsOperationCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * ExportDocumentsResponse response = future.get();
* }
*
*/
- public final UnaryCallable exportDocumentsCallable() {
- return stub.exportDocumentsCallable();
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationCallable() {
+ return stub.exportDocumentsOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets the metadata and configuration for a Field.
- *
- * Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
- * Field response = firestoreAdminClient.getField(name);
- * }
- *
- *
- * @param name Required. A name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Field getField(FieldName name) {
- GetFieldRequest request =
- GetFieldRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- return getField(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the metadata and configuration for a Field.
- *
- * Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
- * Field response = firestoreAdminClient.getField(name.toString());
- * }
- *
- *
- * @param name Required. A name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Field getField(String name) {
- GetFieldRequest request = GetFieldRequest.newBuilder().setName(name).build();
- return getField(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the metadata and configuration for a Field.
- *
- * Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
- * GetFieldRequest request = GetFieldRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * Field response = firestoreAdminClient.getField(request);
- * }
- *
- *
- * @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 Field getField(GetFieldRequest request) {
- return getFieldCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the metadata and configuration for a Field.
+ * 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.
*
* Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * FieldName name = FieldName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]", "[FIELD_ID]");
- * GetFieldRequest request = GetFieldRequest.newBuilder()
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * ExportDocumentsRequest request = ExportDocumentsRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Field> future = firestoreAdminClient.getFieldCallable().futureCall(request);
+ * ApiFuture<Operation> future = firestoreAdminClient.exportDocumentsCallable().futureCall(request);
* // Do something
- * Field response = future.get();
+ * Operation response = future.get();
* }
*
*/
- public final UnaryCallable getFieldCallable() {
- return stub.getFieldCallable();
+ public final UnaryCallable exportDocumentsCallable() {
+ return stub.exportDocumentsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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`.
+ * 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.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * for (Field element : firestoreAdminClient.listFields(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * firestoreAdminClient.importDocumentsAsync(name).get();
* }
*
*
- * @param parent Required. A parent name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+ * @param name Required. Database to import into. Should be of the form:
+ * `projects/{project_id}/databases/{database_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListFieldsPagedResponse listFields(ParentName parent) {
- ListFieldsRequest request =
- ListFieldsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
- return listFields(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importDocumentsAsync(
+ DatabaseName name) {
+ ImportDocumentsRequest request =
+ ImportDocumentsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return importDocumentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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`.
+ * 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.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * for (Field element : firestoreAdminClient.listFields(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * firestoreAdminClient.importDocumentsAsync(name.toString()).get();
* }
*
*
- * @param parent Required. A parent name of the form
- * `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
+ * @param name Required. Database to import into. Should be of the form:
+ * `projects/{project_id}/databases/{database_id}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListFieldsPagedResponse listFields(String parent) {
- ListFieldsRequest request = ListFieldsRequest.newBuilder().setParent(parent).build();
- return listFields(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importDocumentsAsync(String name) {
+ ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder().setName(name).build();
+ return importDocumentsAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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`.
+ * 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.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * ListFieldsRequest request = ListFieldsRequest.newBuilder()
- * .setParent(parent.toString())
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * for (Field element : firestoreAdminClient.listFields(request).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * firestoreAdminClient.importDocumentsAsync(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 ListFieldsPagedResponse listFields(ListFieldsRequest request) {
- return listFieldsPagedCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture importDocumentsAsync(
+ ImportDocumentsRequest request) {
+ return importDocumentsOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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`.
+ * 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.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * ListFieldsRequest request = ListFieldsRequest.newBuilder()
- * .setParent(parent.toString())
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<ListFieldsPagedResponse> future = firestoreAdminClient.listFieldsPagedCallable().futureCall(request);
+ * OperationFuture<Empty, ImportDocumentsMetadata> future = firestoreAdminClient.importDocumentsOperationCallable().futureCall(request);
* // Do something
- * for (Field element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable listFieldsPagedCallable() {
- return stub.listFieldsPagedCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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`.
- *
- *
Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * ParentName parent = ParentName.of("[PROJECT]", "[DATABASE]", "[COLLECTION_ID]");
- * ListFieldsRequest request = ListFieldsRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListFieldsResponse response = firestoreAdminClient.listFieldsCallable().call(request);
- * for (Field element : response.getFieldsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- */
- public final UnaryCallable listFieldsCallable() {
- return stub.listFieldsCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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/*`.
- *
- *
Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * Field field = Field.newBuilder().build();
- * Operation response = firestoreAdminClient.updateField(field);
- * }
- *
- *
- * @param field Required. The field to be updated.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Operation updateField(Field field) {
- UpdateFieldRequest request = UpdateFieldRequest.newBuilder().setField(field).build();
- return updateField(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * 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/*`.
- *
- *
Sample code:
- *
- *
- * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * Field field = Field.newBuilder().build();
- * UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
- * .setField(field)
- * .build();
- * Operation response = firestoreAdminClient.updateField(request);
+ * future.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 Operation updateField(UpdateFieldRequest request) {
- return updateFieldCallable().call(request);
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ importDocumentsOperationCallable() {
+ return stub.importDocumentsOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * 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/*`.
+ * 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.
*
*
Sample code:
*
*
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
- * Field field = Field.newBuilder().build();
- * UpdateFieldRequest request = UpdateFieldRequest.newBuilder()
- * .setField(field)
+ * DatabaseName name = DatabaseName.of("[PROJECT]", "[DATABASE]");
+ * ImportDocumentsRequest request = ImportDocumentsRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<Operation> future = firestoreAdminClient.updateFieldCallable().futureCall(request);
+ * ApiFuture<Operation> future = firestoreAdminClient.importDocumentsCallable().futureCall(request);
* // Do something
- * Operation response = future.get();
+ * future.get();
* }
*
*/
- public final UnaryCallable updateFieldCallable() {
- return stub.updateFieldCallable();
+ public final UnaryCallable importDocumentsCallable() {
+ return stub.importDocumentsCallable();
}
@Override
diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
index f06f5e6ed..0f295bac1 100644
--- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
+++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminSettings.java
@@ -26,18 +26,24 @@
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
+import com.google.firestore.admin.v1.ExportDocumentsMetadata;
import com.google.firestore.admin.v1.ExportDocumentsRequest;
+import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
+import com.google.firestore.admin.v1.FieldOperationMetadata;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
+import com.google.firestore.admin.v1.ImportDocumentsMetadata;
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
+import com.google.firestore.admin.v1.IndexOperationMetadata;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
@@ -64,16 +70,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of createIndex to 30 seconds:
+ *
For example, to set the total timeout of deleteIndex to 30 seconds:
*
*
*
* FirestoreAdminSettings.Builder firestoreAdminSettingsBuilder =
* FirestoreAdminSettings.newBuilder();
* firestoreAdminSettingsBuilder
- * .createIndexSettings()
+ * .deleteIndexSettings()
* .setRetrySettings(
- * firestoreAdminSettingsBuilder.createIndexSettings().getRetrySettings().toBuilder()
+ * firestoreAdminSettingsBuilder.deleteIndexSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* FirestoreAdminSettings firestoreAdminSettings = firestoreAdminSettingsBuilder.build();
@@ -83,11 +89,37 @@
@Generated("by gapic-generator")
@BetaApi
public class FirestoreAdminSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteIndex. */
+ public UnaryCallSettings deleteIndexSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).deleteIndexSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateField. */
+ public UnaryCallSettings updateFieldSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).updateFieldSettings();
+ }
+
+ /** Returns the object with the settings used for calls to updateField. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ updateFieldOperationSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).updateFieldOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to createIndex. */
public UnaryCallSettings createIndexSettings() {
return ((FirestoreAdminStubSettings) getStubSettings()).createIndexSettings();
}
+ /** Returns the object with the settings used for calls to createIndex. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ createIndexOperationSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).createIndexOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to listIndexes. */
public PagedCallSettings
listIndexesSettings() {
@@ -99,14 +131,15 @@ public UnaryCallSettings getIndexSettings() {
return ((FirestoreAdminStubSettings) getStubSettings()).getIndexSettings();
}
- /** Returns the object with the settings used for calls to deleteIndex. */
- public UnaryCallSettings deleteIndexSettings() {
- return ((FirestoreAdminStubSettings) getStubSettings()).deleteIndexSettings();
+ /** Returns the object with the settings used for calls to getField. */
+ public UnaryCallSettings getFieldSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).getFieldSettings();
}
- /** Returns the object with the settings used for calls to importDocuments. */
- public UnaryCallSettings importDocumentsSettings() {
- return ((FirestoreAdminStubSettings) getStubSettings()).importDocumentsSettings();
+ /** Returns the object with the settings used for calls to listFields. */
+ public PagedCallSettings
+ listFieldsSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).listFieldsSettings();
}
/** Returns the object with the settings used for calls to exportDocuments. */
@@ -114,20 +147,26 @@ public UnaryCallSettings exportDocumentsSetti
return ((FirestoreAdminStubSettings) getStubSettings()).exportDocumentsSettings();
}
- /** Returns the object with the settings used for calls to getField. */
- public UnaryCallSettings getFieldSettings() {
- return ((FirestoreAdminStubSettings) getStubSettings()).getFieldSettings();
+ /** Returns the object with the settings used for calls to exportDocuments. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).exportDocumentsOperationSettings();
}
- /** Returns the object with the settings used for calls to listFields. */
- public PagedCallSettings
- listFieldsSettings() {
- return ((FirestoreAdminStubSettings) getStubSettings()).listFieldsSettings();
+ /** Returns the object with the settings used for calls to importDocuments. */
+ public UnaryCallSettings importDocumentsSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).importDocumentsSettings();
}
- /** Returns the object with the settings used for calls to updateField. */
- public UnaryCallSettings updateFieldSettings() {
- return ((FirestoreAdminStubSettings) getStubSettings()).updateFieldSettings();
+ /** Returns the object with the settings used for calls to importDocuments. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ importDocumentsOperationSettings() {
+ return ((FirestoreAdminStubSettings) getStubSettings()).importDocumentsOperationSettings();
}
public static final FirestoreAdminSettings create(FirestoreAdminStubSettings stub)
@@ -227,11 +266,37 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteIndex. */
+ public UnaryCallSettings.Builder deleteIndexSettings() {
+ return getStubSettingsBuilder().deleteIndexSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateField. */
+ public UnaryCallSettings.Builder updateFieldSettings() {
+ return getStubSettingsBuilder().updateFieldSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to updateField. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ updateFieldOperationSettings() {
+ return getStubSettingsBuilder().updateFieldOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to createIndex. */
public UnaryCallSettings.Builder createIndexSettings() {
return getStubSettingsBuilder().createIndexSettings();
}
+ /** Returns the builder for the settings used for calls to createIndex. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ createIndexOperationSettings() {
+ return getStubSettingsBuilder().createIndexOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to listIndexes. */
public PagedCallSettings.Builder<
ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse>
@@ -244,14 +309,15 @@ public UnaryCallSettings.Builder getIndexSettings() {
return getStubSettingsBuilder().getIndexSettings();
}
- /** Returns the builder for the settings used for calls to deleteIndex. */
- public UnaryCallSettings.Builder deleteIndexSettings() {
- return getStubSettingsBuilder().deleteIndexSettings();
+ /** Returns the builder for the settings used for calls to getField. */
+ public UnaryCallSettings.Builder getFieldSettings() {
+ return getStubSettingsBuilder().getFieldSettings();
}
- /** Returns the builder for the settings used for calls to importDocuments. */
- public UnaryCallSettings.Builder importDocumentsSettings() {
- return getStubSettingsBuilder().importDocumentsSettings();
+ /** Returns the builder for the settings used for calls to listFields. */
+ public PagedCallSettings.Builder
+ listFieldsSettings() {
+ return getStubSettingsBuilder().listFieldsSettings();
}
/** Returns the builder for the settings used for calls to exportDocuments. */
@@ -259,20 +325,26 @@ public UnaryCallSettings.Builder exportDocume
return getStubSettingsBuilder().exportDocumentsSettings();
}
- /** Returns the builder for the settings used for calls to getField. */
- public UnaryCallSettings.Builder getFieldSettings() {
- return getStubSettingsBuilder().getFieldSettings();
+ /** Returns the builder for the settings used for calls to exportDocuments. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings() {
+ return getStubSettingsBuilder().exportDocumentsOperationSettings();
}
- /** Returns the builder for the settings used for calls to listFields. */
- public PagedCallSettings.Builder
- listFieldsSettings() {
- return getStubSettingsBuilder().listFieldsSettings();
+ /** Returns the builder for the settings used for calls to importDocuments. */
+ public UnaryCallSettings.Builder importDocumentsSettings() {
+ return getStubSettingsBuilder().importDocumentsSettings();
}
- /** Returns the builder for the settings used for calls to updateField. */
- public UnaryCallSettings.Builder updateFieldSettings() {
- return getStubSettingsBuilder().updateFieldSettings();
+ /** Returns the builder for the settings used for calls to importDocuments. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ importDocumentsOperationSettings() {
+ return getStubSettingsBuilder().importDocumentsOperationSettings();
}
@Override
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 cb3a43c77..705c9d537 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
@@ -30,7 +30,6 @@
import com.google.cloud.firestore.v1.stub.FirestoreStub;
import com.google.cloud.firestore.v1.stub.FirestoreStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
-import com.google.firestore.v1.AnyPathName;
import com.google.firestore.v1.BatchGetDocumentsRequest;
import com.google.firestore.v1.BatchGetDocumentsResponse;
import com.google.firestore.v1.BeginTransactionRequest;
@@ -194,9 +193,9 @@ public FirestoreStub getStub() {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String name = "";
* GetDocumentRequest request = GetDocumentRequest.newBuilder()
- * .setName(name.toString())
+ * .setName(name)
* .build();
* Document response = firestoreClient.getDocument(request);
* }
@@ -217,9 +216,9 @@ public final Document getDocument(GetDocumentRequest request) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String name = "";
* GetDocumentRequest request = GetDocumentRequest.newBuilder()
- * .setName(name.toString())
+ * .setName(name)
* .build();
* ApiFuture<Document> future = firestoreClient.getDocumentCallable().futureCall(request);
* // Do something
@@ -239,10 +238,10 @@ public final UnaryCallable getDocumentCallable() {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* String collectionId = "";
* ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .setCollectionId(collectionId)
* .build();
* for (Document element : firestoreClient.listDocuments(request).iterateAll()) {
@@ -266,10 +265,10 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* String collectionId = "";
* ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .setCollectionId(collectionId)
* .build();
* ApiFuture<ListDocumentsPagedResponse> future = firestoreClient.listDocumentsPagedCallable().futureCall(request);
@@ -293,10 +292,10 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* String collectionId = "";
* ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .setCollectionId(collectionId)
* .build();
* while (true) {
@@ -326,14 +325,12 @@ public final UnaryCallable listDocu
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* String collectionId = "";
- * String documentId = "";
* Document document = Document.newBuilder().build();
* CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .setCollectionId(collectionId)
- * .setDocumentId(documentId)
* .setDocument(document)
* .build();
* Document response = firestoreClient.createDocument(request);
@@ -355,14 +352,12 @@ public final Document createDocument(CreateDocumentRequest request) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* String collectionId = "";
- * String documentId = "";
* Document document = Document.newBuilder().build();
* CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .setCollectionId(collectionId)
- * .setDocumentId(documentId)
* .setDocument(document)
* .build();
* ApiFuture<Document> future = firestoreClient.createDocumentCallable().futureCall(request);
@@ -413,10 +408,8 @@ public final Document updateDocument(Document document, DocumentMask updateMask)
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
* Document document = Document.newBuilder().build();
- * DocumentMask updateMask = DocumentMask.newBuilder().build();
* UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder()
* .setDocument(document)
- * .setUpdateMask(updateMask)
* .build();
* Document response = firestoreClient.updateDocument(request);
* }
@@ -438,10 +431,8 @@ public final Document updateDocument(UpdateDocumentRequest request) {
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
* Document document = Document.newBuilder().build();
- * DocumentMask updateMask = DocumentMask.newBuilder().build();
* UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder()
* .setDocument(document)
- * .setUpdateMask(updateMask)
* .build();
* ApiFuture<Document> future = firestoreClient.updateDocumentCallable().futureCall(request);
* // Do something
@@ -461,7 +452,7 @@ public final UnaryCallable updateDocumentCallab
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String name = "";
* firestoreClient.deleteDocument(name);
* }
*
@@ -470,29 +461,6 @@ public final UnaryCallable updateDocumentCallab
* `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteDocument(AnyPathName name) {
- DeleteDocumentRequest request =
- DeleteDocumentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteDocument(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a document.
- *
- * Sample code:
- *
- *
- * try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
- * firestoreClient.deleteDocument(name.toString());
- * }
- *
- *
- * @param name Required. The resource name of the Document to delete. In the format:
- * `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
public final void deleteDocument(String name) {
DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build();
deleteDocument(request);
@@ -506,9 +474,9 @@ public final void deleteDocument(String name) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String name = "";
* DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
- * .setName(name.toString())
+ * .setName(name)
* .build();
* firestoreClient.deleteDocument(request);
* }
@@ -529,9 +497,9 @@ public final void deleteDocument(DeleteDocumentRequest request) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * AnyPathName name = AnyPathName.of("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String name = "";
* DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
- * .setName(name.toString())
+ * .setName(name)
* .build();
* ApiFuture<Void> future = firestoreClient.deleteDocumentCallable().futureCall(request);
* // Do something
@@ -554,11 +522,9 @@ public final UnaryCallable deleteDocumentCallable(
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
- * List<String> documents = new ArrayList<>();
+ * String database = "";
* BatchGetDocumentsRequest request = BatchGetDocumentsRequest.newBuilder()
- * .setDatabase(formattedDatabase)
- * .addAllDocuments(documents)
+ * .setDatabase(database)
* .build();
*
* ServerStream<BatchGetDocumentsResponse> stream = firestoreClient.batchGetDocumentsCallable().call(request);
@@ -581,8 +547,8 @@ public final UnaryCallable deleteDocumentCallable(
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
- * BeginTransactionResponse response = firestoreClient.beginTransaction(formattedDatabase);
+ * String database = "";
+ * BeginTransactionResponse response = firestoreClient.beginTransaction(database);
* }
*
*
@@ -604,9 +570,9 @@ public final BeginTransactionResponse beginTransaction(String database) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* BeginTransactionRequest request = BeginTransactionRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .build();
* BeginTransactionResponse response = firestoreClient.beginTransaction(request);
* }
@@ -627,9 +593,9 @@ public final BeginTransactionResponse beginTransaction(BeginTransactionRequest r
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* BeginTransactionRequest request = BeginTransactionRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .build();
* ApiFuture<BeginTransactionResponse> future = firestoreClient.beginTransactionCallable().futureCall(request);
* // Do something
@@ -650,9 +616,9 @@ public final BeginTransactionResponse beginTransaction(BeginTransactionRequest r
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* List<Write> writes = new ArrayList<>();
- * CommitResponse response = firestoreClient.commit(formattedDatabase, writes);
+ * CommitResponse response = firestoreClient.commit(database, writes);
* }
*
*
@@ -676,11 +642,9 @@ public final CommitResponse commit(String database, List writes) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
- * List<Write> writes = new ArrayList<>();
+ * String database = "";
* CommitRequest request = CommitRequest.newBuilder()
- * .setDatabase(formattedDatabase)
- * .addAllWrites(writes)
+ * .setDatabase(database)
* .build();
* CommitResponse response = firestoreClient.commit(request);
* }
@@ -701,11 +665,9 @@ public final CommitResponse commit(CommitRequest request) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
- * List<Write> writes = new ArrayList<>();
+ * String database = "";
* CommitRequest request = CommitRequest.newBuilder()
- * .setDatabase(formattedDatabase)
- * .addAllWrites(writes)
+ * .setDatabase(database)
* .build();
* ApiFuture<CommitResponse> future = firestoreClient.commitCallable().futureCall(request);
* // Do something
@@ -725,9 +687,9 @@ public final UnaryCallable commitCallable() {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* ByteString transaction = ByteString.copyFromUtf8("");
- * firestoreClient.rollback(formattedDatabase, transaction);
+ * firestoreClient.rollback(database, transaction);
* }
*
*
@@ -750,10 +712,10 @@ public final void rollback(String database, ByteString transaction) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* ByteString transaction = ByteString.copyFromUtf8("");
* RollbackRequest request = RollbackRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .setTransaction(transaction)
* .build();
* firestoreClient.rollback(request);
@@ -775,10 +737,10 @@ public final void rollback(RollbackRequest request) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* ByteString transaction = ByteString.copyFromUtf8("");
* RollbackRequest request = RollbackRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .setTransaction(transaction)
* .build();
* ApiFuture<Void> future = firestoreClient.rollbackCallable().futureCall(request);
@@ -799,9 +761,9 @@ public final UnaryCallable rollbackCallable() {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* RunQueryRequest request = RunQueryRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .build();
*
* ServerStream<RunQueryResponse> stream = firestoreClient.runQueryCallable().call(request);
@@ -826,9 +788,9 @@ public final ServerStreamingCallable runQuery
* BidiStream<WriteRequest, WriteResponse> bidiStream =
* firestoreClient.writeCallable().call();
*
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* WriteRequest request = WriteRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .build();
* bidiStream.send(request);
* for (WriteResponse response : bidiStream) {
@@ -852,9 +814,9 @@ public final BidiStreamingCallable writeCallable()
* BidiStream<ListenRequest, ListenResponse> bidiStream =
* firestoreClient.listenCallable().call();
*
- * String formattedDatabase = DatabaseRootName.format("[PROJECT]", "[DATABASE]");
+ * String database = "";
* ListenRequest request = ListenRequest.newBuilder()
- * .setDatabase(formattedDatabase)
+ * .setDatabase(database)
* .build();
* bidiStream.send(request);
* for (ListenResponse response : bidiStream) {
@@ -875,8 +837,8 @@ public final BidiStreamingCallable listenCallable
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
- * for (String element : firestoreClient.listCollectionIds(formattedParent).iterateAll()) {
+ * String parent = "";
+ * for (String element : firestoreClient.listCollectionIds(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -901,9 +863,9 @@ public final ListCollectionIdsPagedResponse listCollectionIds(String parent) {
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .build();
* for (String element : firestoreClient.listCollectionIds(request).iterateAll()) {
* // doThingsWith(element);
@@ -926,9 +888,9 @@ public final ListCollectionIdsPagedResponse listCollectionIds(ListCollectionIdsR
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .build();
* ApiFuture<ListCollectionIdsPagedResponse> future = firestoreClient.listCollectionIdsPagedCallable().futureCall(request);
* // Do something
@@ -951,9 +913,9 @@ public final ListCollectionIdsPagedResponse listCollectionIds(ListCollectionIdsR
*
*
* try (FirestoreClient firestoreClient = FirestoreClient.create()) {
- * String formattedParent = AnyPathName.format("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]");
+ * String parent = "";
* ListCollectionIdsRequest request = ListCollectionIdsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent)
* .build();
* while (true) {
* ListCollectionIdsResponse response = firestoreClient.listCollectionIdsCallable().call(request);
diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
index d847aaad5..579adc2c3 100644
--- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
+++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStub.java
@@ -20,21 +20,28 @@
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
+import com.google.firestore.admin.v1.ExportDocumentsMetadata;
import com.google.firestore.admin.v1.ExportDocumentsRequest;
+import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
+import com.google.firestore.admin.v1.FieldOperationMetadata;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
+import com.google.firestore.admin.v1.ImportDocumentsMetadata;
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
+import com.google.firestore.admin.v1.IndexOperationMetadata;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
import com.google.firestore.admin.v1.UpdateFieldRequest;
import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import javax.annotation.Generated;
@@ -48,6 +55,31 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class FirestoreAdminStub implements BackgroundResource {
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationsStub getOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ }
+
+ public UnaryCallable deleteIndexCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteIndexCallable()");
+ }
+
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ updateFieldOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateFieldOperationCallable()");
+ }
+
+ public UnaryCallable updateFieldCallable() {
+ throw new UnsupportedOperationException("Not implemented: updateFieldCallable()");
+ }
+
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ createIndexOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: createIndexOperationCallable()");
+ }
+
public UnaryCallable createIndexCallable() {
throw new UnsupportedOperationException("Not implemented: createIndexCallable()");
}
@@ -64,18 +96,6 @@ public UnaryCallable getIndexCallable() {
throw new UnsupportedOperationException("Not implemented: getIndexCallable()");
}
- public UnaryCallable deleteIndexCallable() {
- throw new UnsupportedOperationException("Not implemented: deleteIndexCallable()");
- }
-
- public UnaryCallable importDocumentsCallable() {
- throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()");
- }
-
- public UnaryCallable exportDocumentsCallable() {
- throw new UnsupportedOperationException("Not implemented: exportDocumentsCallable()");
- }
-
public UnaryCallable getFieldCallable() {
throw new UnsupportedOperationException("Not implemented: getFieldCallable()");
}
@@ -88,8 +108,24 @@ public UnaryCallable listFieldsCallable()
throw new UnsupportedOperationException("Not implemented: listFieldsCallable()");
}
- public UnaryCallable updateFieldCallable() {
- throw new UnsupportedOperationException("Not implemented: updateFieldCallable()");
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ exportDocumentsOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: exportDocumentsOperationCallable()");
+ }
+
+ public UnaryCallable exportDocumentsCallable() {
+ throw new UnsupportedOperationException("Not implemented: exportDocumentsCallable()");
+ }
+
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallable
+ importDocumentsOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: importDocumentsOperationCallable()");
+ }
+
+ public UnaryCallable importDocumentsCallable() {
+ throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()");
}
@Override
diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
index def68553b..a249a4256 100644
--- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
+++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java
@@ -27,10 +27,14 @@
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.longrunning.OperationSnapshot;
+import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
@@ -46,12 +50,17 @@
import com.google.common.collect.Lists;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
+import com.google.firestore.admin.v1.ExportDocumentsMetadata;
import com.google.firestore.admin.v1.ExportDocumentsRequest;
+import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
+import com.google.firestore.admin.v1.FieldOperationMetadata;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
+import com.google.firestore.admin.v1.ImportDocumentsMetadata;
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
+import com.google.firestore.admin.v1.IndexOperationMetadata;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
@@ -79,16 +88,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of createIndex to 30 seconds:
+ *
For example, to set the total timeout of deleteIndex to 30 seconds:
*
*
*
* FirestoreAdminStubSettings.Builder firestoreAdminSettingsBuilder =
* FirestoreAdminStubSettings.newBuilder();
* firestoreAdminSettingsBuilder
- * .createIndexSettings()
+ * .deleteIndexSettings()
* .setRetrySettings(
- * firestoreAdminSettingsBuilder.createIndexSettings().getRetrySettings().toBuilder()
+ * firestoreAdminSettingsBuilder.deleteIndexSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* FirestoreAdminStubSettings firestoreAdminSettings = firestoreAdminSettingsBuilder.build();
@@ -105,23 +114,56 @@ public class FirestoreAdminStubSettings extends StubSettings deleteIndexSettings;
+ private final UnaryCallSettings updateFieldSettings;
+ private final OperationCallSettings
+ updateFieldOperationSettings;
private final UnaryCallSettings createIndexSettings;
+ private final OperationCallSettings
+ createIndexOperationSettings;
private final PagedCallSettings
listIndexesSettings;
private final UnaryCallSettings getIndexSettings;
- private final UnaryCallSettings deleteIndexSettings;
- private final UnaryCallSettings importDocumentsSettings;
- private final UnaryCallSettings exportDocumentsSettings;
private final UnaryCallSettings getFieldSettings;
private final PagedCallSettings
listFieldsSettings;
- private final UnaryCallSettings updateFieldSettings;
+ private final UnaryCallSettings exportDocumentsSettings;
+ private final OperationCallSettings<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings;
+ private final UnaryCallSettings importDocumentsSettings;
+ private final OperationCallSettings
+ importDocumentsOperationSettings;
+
+ /** Returns the object with the settings used for calls to deleteIndex. */
+ public UnaryCallSettings deleteIndexSettings() {
+ return deleteIndexSettings;
+ }
+
+ /** Returns the object with the settings used for calls to updateField. */
+ public UnaryCallSettings updateFieldSettings() {
+ return updateFieldSettings;
+ }
+
+ /** Returns the object with the settings used for calls to updateField. */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings
+ updateFieldOperationSettings() {
+ return updateFieldOperationSettings;
+ }
/** Returns the object with the settings used for calls to createIndex. */
public UnaryCallSettings createIndexSettings() {
return createIndexSettings;
}
+ /** Returns the object with the settings used for calls to createIndex. */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings
+ createIndexOperationSettings() {
+ return createIndexOperationSettings;
+ }
+
/** Returns the object with the settings used for calls to listIndexes. */
public PagedCallSettings
listIndexesSettings() {
@@ -133,14 +175,15 @@ public UnaryCallSettings getIndexSettings() {
return getIndexSettings;
}
- /** Returns the object with the settings used for calls to deleteIndex. */
- public UnaryCallSettings deleteIndexSettings() {
- return deleteIndexSettings;
+ /** Returns the object with the settings used for calls to getField. */
+ public UnaryCallSettings getFieldSettings() {
+ return getFieldSettings;
}
- /** Returns the object with the settings used for calls to importDocuments. */
- public UnaryCallSettings importDocumentsSettings() {
- return importDocumentsSettings;
+ /** Returns the object with the settings used for calls to listFields. */
+ public PagedCallSettings
+ listFieldsSettings() {
+ return listFieldsSettings;
}
/** Returns the object with the settings used for calls to exportDocuments. */
@@ -148,20 +191,24 @@ public UnaryCallSettings exportDocumentsSetti
return exportDocumentsSettings;
}
- /** Returns the object with the settings used for calls to getField. */
- public UnaryCallSettings getFieldSettings() {
- return getFieldSettings;
+ /** Returns the object with the settings used for calls to exportDocuments. */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings() {
+ return exportDocumentsOperationSettings;
}
- /** Returns the object with the settings used for calls to listFields. */
- public PagedCallSettings
- listFieldsSettings() {
- return listFieldsSettings;
+ /** Returns the object with the settings used for calls to importDocuments. */
+ public UnaryCallSettings importDocumentsSettings() {
+ return importDocumentsSettings;
}
- /** Returns the object with the settings used for calls to updateField. */
- public UnaryCallSettings updateFieldSettings() {
- return updateFieldSettings;
+ /** Returns the object with the settings used for calls to importDocuments. */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings
+ importDocumentsOperationSettings() {
+ return importDocumentsOperationSettings;
}
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
@@ -233,15 +280,19 @@ public Builder toBuilder() {
protected FirestoreAdminStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
+ deleteIndexSettings = settingsBuilder.deleteIndexSettings().build();
+ updateFieldSettings = settingsBuilder.updateFieldSettings().build();
+ updateFieldOperationSettings = settingsBuilder.updateFieldOperationSettings().build();
createIndexSettings = settingsBuilder.createIndexSettings().build();
+ createIndexOperationSettings = settingsBuilder.createIndexOperationSettings().build();
listIndexesSettings = settingsBuilder.listIndexesSettings().build();
getIndexSettings = settingsBuilder.getIndexSettings().build();
- deleteIndexSettings = settingsBuilder.deleteIndexSettings().build();
- importDocumentsSettings = settingsBuilder.importDocumentsSettings().build();
- exportDocumentsSettings = settingsBuilder.exportDocumentsSettings().build();
getFieldSettings = settingsBuilder.getFieldSettings().build();
listFieldsSettings = settingsBuilder.listFieldsSettings().build();
- updateFieldSettings = settingsBuilder.updateFieldSettings().build();
+ exportDocumentsSettings = settingsBuilder.exportDocumentsSettings().build();
+ exportDocumentsOperationSettings = settingsBuilder.exportDocumentsOperationSettings().build();
+ importDocumentsSettings = settingsBuilder.importDocumentsSettings().build();
+ importDocumentsOperationSettings = settingsBuilder.importDocumentsOperationSettings().build();
}
private static final PagedListDescriptor
@@ -354,21 +405,31 @@ public ApiFuture getFuturePagedResponse(
public static class Builder extends StubSettings.Builder {
private final ImmutableList> unaryMethodSettingsBuilders;
+ private final UnaryCallSettings.Builder deleteIndexSettings;
+ private final UnaryCallSettings.Builder updateFieldSettings;
+ private final OperationCallSettings.Builder
+ updateFieldOperationSettings;
private final UnaryCallSettings.Builder createIndexSettings;
+ private final OperationCallSettings.Builder
+ createIndexOperationSettings;
private final PagedCallSettings.Builder<
ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse>
listIndexesSettings;
private final UnaryCallSettings.Builder getIndexSettings;
- private final UnaryCallSettings.Builder deleteIndexSettings;
- private final UnaryCallSettings.Builder
- importDocumentsSettings;
- private final UnaryCallSettings.Builder
- exportDocumentsSettings;
private final UnaryCallSettings.Builder getFieldSettings;
private final PagedCallSettings.Builder<
ListFieldsRequest, ListFieldsResponse, ListFieldsPagedResponse>
listFieldsSettings;
- private final UnaryCallSettings.Builder updateFieldSettings;
+ private final UnaryCallSettings.Builder
+ exportDocumentsSettings;
+ private final OperationCallSettings.Builder<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings;
+ private final UnaryCallSettings.Builder
+ importDocumentsSettings;
+ private final OperationCallSettings.Builder<
+ ImportDocumentsRequest, Empty, ImportDocumentsMetadata>
+ importDocumentsOperationSettings;
private static final ImmutableMap>
RETRYABLE_CODE_DEFINITIONS;
@@ -380,9 +441,7 @@ public static class Builder extends StubSettings.BuildernewArrayList(
- StatusCode.Code.DEADLINE_EXCEEDED,
- StatusCode.Code.INTERNAL,
- StatusCode.Code.UNAVAILABLE)));
+ StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
@@ -413,35 +472,43 @@ protected Builder() {
protected Builder(ClientContext clientContext) {
super(clientContext);
+ deleteIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ updateFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ updateFieldOperationSettings = OperationCallSettings.newBuilder();
+
createIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ createIndexOperationSettings = OperationCallSettings.newBuilder();
+
listIndexesSettings = PagedCallSettings.newBuilder(LIST_INDEXES_PAGE_STR_FACT);
getIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
- deleteIndexSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ getFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
- importDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ listFieldsSettings = PagedCallSettings.newBuilder(LIST_FIELDS_PAGE_STR_FACT);
exportDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
- getFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ exportDocumentsOperationSettings = OperationCallSettings.newBuilder();
- listFieldsSettings = PagedCallSettings.newBuilder(LIST_FIELDS_PAGE_STR_FACT);
+ importDocumentsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
- updateFieldSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ importDocumentsOperationSettings = OperationCallSettings.newBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
+ deleteIndexSettings,
+ updateFieldSettings,
createIndexSettings,
listIndexesSettings,
getIndexSettings,
- deleteIndexSettings,
- importDocumentsSettings,
- exportDocumentsSettings,
getFieldSettings,
listFieldsSettings,
- updateFieldSettings);
+ exportDocumentsSettings,
+ importDocumentsSettings);
initDefaults(this);
}
@@ -457,6 +524,16 @@ private static Builder createDefault() {
private static Builder initDefaults(Builder builder) {
+ builder
+ .deleteIndexSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .updateFieldSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
builder
.createIndexSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -473,13 +550,13 @@ private static Builder initDefaults(Builder builder) {
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .deleteIndexSettings()
+ .getFieldSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .importDocumentsSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .listFieldsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
@@ -488,19 +565,99 @@ private static Builder initDefaults(Builder builder) {
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
builder
- .getFieldSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .importDocumentsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
builder
- .listFieldsSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
- .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
+ .updateFieldOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings.newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Field.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(FieldOperationMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
+ .setInitialRpcTimeout(Duration.ZERO) // ignored
+ .setRpcTimeoutMultiplier(1.0) // ignored
+ .setMaxRpcTimeout(Duration.ZERO) // ignored
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
builder
- .updateFieldSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
- .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+ .createIndexOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings.newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Index.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(IndexOperationMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
+ .setInitialRpcTimeout(Duration.ZERO) // ignored
+ .setRpcTimeoutMultiplier(1.0) // ignored
+ .setMaxRpcTimeout(Duration.ZERO) // ignored
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
+ builder
+ .exportDocumentsOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(ExportDocumentsResponse.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(ExportDocumentsMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
+ .setInitialRpcTimeout(Duration.ZERO) // ignored
+ .setRpcTimeoutMultiplier(1.0) // ignored
+ .setMaxRpcTimeout(Duration.ZERO) // ignored
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
+ builder
+ .importDocumentsOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(ImportDocumentsMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.ofMillis(500L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelay(Duration.ofMillis(5000L))
+ .setInitialRpcTimeout(Duration.ZERO) // ignored
+ .setRpcTimeoutMultiplier(1.0) // ignored
+ .setMaxRpcTimeout(Duration.ZERO) // ignored
+ .setTotalTimeout(Duration.ofMillis(300000L))
+ .build()));
return builder;
}
@@ -508,27 +665,31 @@ private static Builder initDefaults(Builder builder) {
protected Builder(FirestoreAdminStubSettings settings) {
super(settings);
+ deleteIndexSettings = settings.deleteIndexSettings.toBuilder();
+ updateFieldSettings = settings.updateFieldSettings.toBuilder();
+ updateFieldOperationSettings = settings.updateFieldOperationSettings.toBuilder();
createIndexSettings = settings.createIndexSettings.toBuilder();
+ createIndexOperationSettings = settings.createIndexOperationSettings.toBuilder();
listIndexesSettings = settings.listIndexesSettings.toBuilder();
getIndexSettings = settings.getIndexSettings.toBuilder();
- deleteIndexSettings = settings.deleteIndexSettings.toBuilder();
- importDocumentsSettings = settings.importDocumentsSettings.toBuilder();
- exportDocumentsSettings = settings.exportDocumentsSettings.toBuilder();
getFieldSettings = settings.getFieldSettings.toBuilder();
listFieldsSettings = settings.listFieldsSettings.toBuilder();
- updateFieldSettings = settings.updateFieldSettings.toBuilder();
+ exportDocumentsSettings = settings.exportDocumentsSettings.toBuilder();
+ exportDocumentsOperationSettings = settings.exportDocumentsOperationSettings.toBuilder();
+ importDocumentsSettings = settings.importDocumentsSettings.toBuilder();
+ importDocumentsOperationSettings = settings.importDocumentsOperationSettings.toBuilder();
unaryMethodSettingsBuilders =
ImmutableList.>of(
+ deleteIndexSettings,
+ updateFieldSettings,
createIndexSettings,
listIndexesSettings,
getIndexSettings,
- deleteIndexSettings,
- importDocumentsSettings,
- exportDocumentsSettings,
getFieldSettings,
listFieldsSettings,
- updateFieldSettings);
+ exportDocumentsSettings,
+ importDocumentsSettings);
}
// NEXT_MAJOR_VER: remove 'throws Exception'
@@ -547,11 +708,37 @@ public Builder applyToAllUnaryMethods(
return unaryMethodSettingsBuilders;
}
+ /** Returns the builder for the settings used for calls to deleteIndex. */
+ public UnaryCallSettings.Builder deleteIndexSettings() {
+ return deleteIndexSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to updateField. */
+ public UnaryCallSettings.Builder updateFieldSettings() {
+ return updateFieldSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to updateField. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ updateFieldOperationSettings() {
+ return updateFieldOperationSettings;
+ }
+
/** Returns the builder for the settings used for calls to createIndex. */
public UnaryCallSettings.Builder createIndexSettings() {
return createIndexSettings;
}
+ /** Returns the builder for the settings used for calls to createIndex. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ createIndexOperationSettings() {
+ return createIndexOperationSettings;
+ }
+
/** Returns the builder for the settings used for calls to listIndexes. */
public PagedCallSettings.Builder<
ListIndexesRequest, ListIndexesResponse, ListIndexesPagedResponse>
@@ -564,14 +751,15 @@ public UnaryCallSettings.Builder getIndexSettings() {
return getIndexSettings;
}
- /** Returns the builder for the settings used for calls to deleteIndex. */
- public UnaryCallSettings.Builder deleteIndexSettings() {
- return deleteIndexSettings;
+ /** Returns the builder for the settings used for calls to getField. */
+ public UnaryCallSettings.Builder getFieldSettings() {
+ return getFieldSettings;
}
- /** Returns the builder for the settings used for calls to importDocuments. */
- public UnaryCallSettings.Builder importDocumentsSettings() {
- return importDocumentsSettings;
+ /** Returns the builder for the settings used for calls to listFields. */
+ public PagedCallSettings.Builder
+ listFieldsSettings() {
+ return listFieldsSettings;
}
/** Returns the builder for the settings used for calls to exportDocuments. */
@@ -579,20 +767,26 @@ public UnaryCallSettings.Builder exportDocume
return exportDocumentsSettings;
}
- /** Returns the builder for the settings used for calls to getField. */
- public UnaryCallSettings.Builder getFieldSettings() {
- return getFieldSettings;
+ /** Returns the builder for the settings used for calls to exportDocuments. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder<
+ ExportDocumentsRequest, ExportDocumentsResponse, ExportDocumentsMetadata>
+ exportDocumentsOperationSettings() {
+ return exportDocumentsOperationSettings;
}
- /** Returns the builder for the settings used for calls to listFields. */
- public PagedCallSettings.Builder
- listFieldsSettings() {
- return listFieldsSettings;
+ /** Returns the builder for the settings used for calls to importDocuments. */
+ public UnaryCallSettings.Builder importDocumentsSettings() {
+ return importDocumentsSettings;
}
- /** Returns the builder for the settings used for calls to updateField. */
- public UnaryCallSettings.Builder updateFieldSettings() {
- return updateFieldSettings;
+ /** Returns the builder for the settings used for calls to importDocuments. */
+ @BetaApi(
+ "The surface for use by generated code is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ importDocumentsOperationSettings() {
+ return importDocumentsOperationSettings;
}
@Override
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 6272c4e94..22f861ec8 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
@@ -434,9 +434,7 @@ public static class Builder extends StubSettings.BuildernewArrayList(
- StatusCode.Code.DEADLINE_EXCEEDED,
- StatusCode.Code.INTERNAL,
- StatusCode.Code.UNAVAILABLE)));
+ StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE)));
definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}
@@ -582,7 +580,7 @@ private static Builder initDefaults(Builder builder) {
builder
.listCollectionIdsSettings()
- .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
return builder;
diff --git a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
index 90396949d..010701dc9 100644
--- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
+++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/GrpcFirestoreAdminStub.java
@@ -24,23 +24,30 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.common.collect.ImmutableMap;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.DeleteIndexRequest;
+import com.google.firestore.admin.v1.ExportDocumentsMetadata;
import com.google.firestore.admin.v1.ExportDocumentsRequest;
+import com.google.firestore.admin.v1.ExportDocumentsResponse;
import com.google.firestore.admin.v1.Field;
+import com.google.firestore.admin.v1.FieldOperationMetadata;
import com.google.firestore.admin.v1.GetFieldRequest;
import com.google.firestore.admin.v1.GetIndexRequest;
+import com.google.firestore.admin.v1.ImportDocumentsMetadata;
import com.google.firestore.admin.v1.ImportDocumentsRequest;
import com.google.firestore.admin.v1.Index;
+import com.google.firestore.admin.v1.IndexOperationMetadata;
import com.google.firestore.admin.v1.ListFieldsRequest;
import com.google.firestore.admin.v1.ListFieldsResponse;
import com.google.firestore.admin.v1.ListIndexesRequest;
import com.google.firestore.admin.v1.ListIndexesResponse;
import com.google.firestore.admin.v1.UpdateFieldRequest;
import com.google.longrunning.Operation;
+import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
@@ -59,6 +66,20 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public class GrpcFirestoreAdminStub extends FirestoreAdminStub {
+ private static final MethodDescriptor deleteIndexMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteIndex")
+ .setRequestMarshaller(ProtoUtils.marshaller(DeleteIndexRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor updateFieldMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateField")
+ .setRequestMarshaller(ProtoUtils.marshaller(UpdateFieldRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
private static final MethodDescriptor createIndexMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
@@ -82,31 +103,6 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub {
.setRequestMarshaller(ProtoUtils.marshaller(GetIndexRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Index.getDefaultInstance()))
.build();
- private static final MethodDescriptor deleteIndexMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/DeleteIndex")
- .setRequestMarshaller(ProtoUtils.marshaller(DeleteIndexRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
- .build();
- private static final MethodDescriptor
- importDocumentsMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ImportDocuments")
- .setRequestMarshaller(
- ProtoUtils.marshaller(ImportDocumentsRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
- private static final MethodDescriptor
- exportDocumentsMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ExportDocuments")
- .setRequestMarshaller(
- ProtoUtils.marshaller(ExportDocumentsRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
private static final MethodDescriptor getFieldMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
@@ -122,28 +118,49 @@ public class GrpcFirestoreAdminStub extends FirestoreAdminStub {
.setRequestMarshaller(ProtoUtils.marshaller(ListFieldsRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListFieldsResponse.getDefaultInstance()))
.build();
- private static final MethodDescriptor updateFieldMethodDescriptor =
- MethodDescriptor.newBuilder()
- .setType(MethodDescriptor.MethodType.UNARY)
- .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/UpdateField")
- .setRequestMarshaller(ProtoUtils.marshaller(UpdateFieldRequest.getDefaultInstance()))
- .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
- .build();
+ private static final MethodDescriptor
+ exportDocumentsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ExportDocuments")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ExportDocumentsRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
+ private static final MethodDescriptor
+ importDocumentsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.firestore.admin.v1.FirestoreAdmin/ImportDocuments")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ImportDocumentsRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .build();
private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
+ private final UnaryCallable deleteIndexCallable;
+ private final UnaryCallable updateFieldCallable;
+ private final OperationCallable
+ updateFieldOperationCallable;
private final UnaryCallable createIndexCallable;
+ private final OperationCallable
+ createIndexOperationCallable;
private final UnaryCallable listIndexesCallable;
private final UnaryCallable
listIndexesPagedCallable;
private final UnaryCallable getIndexCallable;
- private final UnaryCallable deleteIndexCallable;
- private final UnaryCallable importDocumentsCallable;
- private final UnaryCallable exportDocumentsCallable;
private final UnaryCallable