diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java index aeeef3d28..0ff74e0d5 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/FirestoreAdminClient.java @@ -119,19 +119,290 @@ *

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

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

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

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

+ *

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

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

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

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

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

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

Lists composite indexes.

+ *

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

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

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

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

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

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

Gets a composite index.

+ *

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

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

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

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

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

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

Deletes a composite index.

+ *

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

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

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

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

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

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

Gets the metadata and configuration for a Field.

+ *

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

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

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

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

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

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

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

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

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

+ *

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

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

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

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

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

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

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

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

+ *

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

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

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

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

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

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

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

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

+ *

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

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

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

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

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

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

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

+ *

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

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

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

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

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

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

Create a database.

+ *

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

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

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

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

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

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

Gets information about a database.

+ *

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

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

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

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

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

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

List all the databases in the project.

+ *

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

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

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

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

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

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

Updates a database.

+ *

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

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

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

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

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

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

Deletes a database.

+ *

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

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

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

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

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

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

See the individual methods for example code. * diff --git a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java index c2979c2d4..2be7176ac 100644 --- a/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java +++ b/google-cloud-firestore-admin/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreAdminStubSettings.java @@ -403,6 +403,12 @@ public FirestoreAdminStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "firestore"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); 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 7e491f6c1..5e472ac97 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/FirestoreClient.java @@ -99,19 +99,250 @@ *

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

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

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

Gets a single document.

+ *

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

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

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

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

Lists documents.

+ *

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

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

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

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

Updates or inserts a document.

+ *

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

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

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

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

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

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

Deletes a document.

+ *

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

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

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

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

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

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

Gets multiple documents. + *

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

+ *

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

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

Starts a new transaction.

+ *

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

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

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

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

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

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

Commits a transaction, while optionally updating documents.

+ *

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

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

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

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

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

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

Rolls back a transaction.

+ *

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

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

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

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

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

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

Runs a query.

+ *

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

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

Runs an aggregation query. + *

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

High-Level Example: + *

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

+ *

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

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

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

+ *

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

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

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

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

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

+ *

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

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

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

+ *

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

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

Lists all the collection IDs underneath a document.

+ *

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

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

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

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

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

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

Applies a batch of write operations. + *

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

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

+ *

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

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

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

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

Creates a new document.

+ *

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

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

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

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

See the individual methods for example code. * 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 a9548229b..65345559b 100644 --- a/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java +++ b/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1/stub/FirestoreStubSettings.java @@ -426,6 +426,12 @@ public FirestoreStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "firestore"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder();