Skip to content

Commit

Permalink
feat: publish proto definitions for SUM/AVG in Firestore (#1304)
Browse files Browse the repository at this point in the history
* feat: publish proto definitions for SUM/AVG in Firestore

PiperOrigin-RevId: 552607134

Source-Link: googleapis/googleapis@88a9a5f

Source-Link: googleapis/googleapis-gen@047d73a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDQ3ZDczYWUyZmQ0ZTUyNmI0NzRhNjE3ZTE2ODMzOWQ2OTFiMjUxMCJ9

chore: Update the Java code generator (gapic-generator-java) to 2.23.1

PiperOrigin-RevId: 549674836

Source-Link: googleapis/googleapis@3b7a121

Source-Link: googleapis/googleapis-gen@2d643a4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmQ2NDNhNGVmZjhjOGVmNGM5ZDVhMmU1OWQyYTBjYTdjOTkxZWFiNiJ9

chore: Add bloom filter related comments

PiperOrigin-RevId: 538646627

Source-Link: googleapis/googleapis@1ceef69

Source-Link: googleapis/googleapis-gen@fb7c4c4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmI3YzRjNGFlZjYzMGY0OTU3ZmE1MDFjNDg1ODdmOTgzZTE3NjQ0YSJ9

chore(deps): Update gapic-generator-java to 2.21.0

PiperOrigin-RevId: 538365689

Source-Link: googleapis/googleapis@7ac8a24

Source-Link: googleapis/googleapis-gen@e58eedb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTU4ZWVkYjc1ZDNjMDc4NzgwOTdjZGZiZmQzZmZkYjc2NDY3NjNhMyJ9

feat: add CreateDatabase API

PiperOrigin-RevId: 537397252

Source-Link: googleapis/googleapis@b4481e1

Source-Link: googleapis/googleapis-gen@6b4b12a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmI0YjEyYWJlOWVjZTYzODJlYThkNmZmZDVjNTBlMzZiMzI5MDVmOCJ9

chore: upgrading protobuf to 23.2 for code generation

PiperOrigin-RevId: 537035741

Source-Link: googleapis/googleapis@640f743

Source-Link: googleapis/googleapis-gen@5ec02ed
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWVjMDJlZDIwMjI4NzhmOTljOTRjNzYzMDYwZmY2YTAxODg5NmI2ZSJ9

chore: upgrading Protobuf to 23.1 and gRPC to 1.55.0 in code generation

PiperOrigin-RevId: 534084593

Source-Link: googleapis/googleapis@aa4559a

Source-Link: googleapis/googleapis-gen@370325a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwMzI1YWY4MjM2NzMyZjU4ODVmNTk0MGUwZWY0ODFmZWU4MzAwMyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Accept interface change

* Accept interface change

* Accept interface change

* Accept interface change

* Accept interface change

* Apply x-goog-request-params workaround.

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 2, 2023
1 parent ab082f4 commit b025d11
Show file tree
Hide file tree
Showing 226 changed files with 14,162 additions and 2,440 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,8 @@
import com.google.cloud.firestore.v1.stub.FirestoreAdminStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.firestore.admin.v1.CollectionGroupName;
import com.google.firestore.admin.v1.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
import com.google.firestore.admin.v1.DatabaseName;
Expand Down Expand Up @@ -1642,6 +1644,176 @@ public final UnaryCallable<ImportDocumentsRequest, Operation> importDocumentsCal
return stub.importDocumentsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a database.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* Database database = Database.newBuilder().build();
* String databaseId = "databaseId1688905718";
* Database response =
* firestoreAdminClient.createDatabaseAsync(parent, database, databaseId).get();
* }
* }</pre>
*
* @param parent Required. A parent name of the form `projects/{project_id}`
* @param database Required. The Database to create.
* @param databaseId Required. The ID to use for the database, which will become the final
* component of the database's resource name.
* <p>The value must be set to "(default)".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsync(
ProjectName parent, Database database, String databaseId) {
CreateDatabaseRequest request =
CreateDatabaseRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setDatabase(database)
.setDatabaseId(databaseId)
.build();
return createDatabaseAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a database.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* Database database = Database.newBuilder().build();
* String databaseId = "databaseId1688905718";
* Database response =
* firestoreAdminClient.createDatabaseAsync(parent, database, databaseId).get();
* }
* }</pre>
*
* @param parent Required. A parent name of the form `projects/{project_id}`
* @param database Required. The Database to create.
* @param databaseId Required. The ID to use for the database, which will become the final
* component of the database's resource name.
* <p>The value must be set to "(default)".
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Database, CreateDatabaseMetadata> createDatabaseAsync(
String parent, Database database, String databaseId) {
CreateDatabaseRequest request =
CreateDatabaseRequest.newBuilder()
.setParent(parent)
.setDatabase(database)
.setDatabaseId(databaseId)
.build();
return createDatabaseAsync(request);
}

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

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a database.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* CreateDatabaseRequest request =
* CreateDatabaseRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setDatabase(Database.newBuilder().build())
* .setDatabaseId("databaseId1688905718")
* .build();
* OperationFuture<Database, CreateDatabaseMetadata> future =
* firestoreAdminClient.createDatabaseOperationCallable().futureCall(request);
* // Do something.
* Database response = future.get();
* }
* }</pre>
*/
public final OperationCallable<CreateDatabaseRequest, Database, CreateDatabaseMetadata>
createDatabaseOperationCallable() {
return stub.createDatabaseOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a database.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) {
* CreateDatabaseRequest request =
* CreateDatabaseRequest.newBuilder()
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setDatabase(Database.newBuilder().build())
* .setDatabaseId("databaseId1688905718")
* .build();
* ApiFuture<Operation> future =
* firestoreAdminClient.createDatabaseCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<CreateDatabaseRequest, Operation> createDatabaseCallable() {
return stub.createDatabaseCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets information about a database.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,6 +33,8 @@
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.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
import com.google.firestore.admin.v1.DeleteIndexRequest;
Expand Down Expand Up @@ -175,6 +177,17 @@ public UnaryCallSettings<ImportDocumentsRequest, Operation> importDocumentsSetti
return ((FirestoreAdminStubSettings) getStubSettings()).importDocumentsOperationSettings();
}

/** Returns the object with the settings used for calls to createDatabase. */
public UnaryCallSettings<CreateDatabaseRequest, Operation> createDatabaseSettings() {
return ((FirestoreAdminStubSettings) getStubSettings()).createDatabaseSettings();
}

/** Returns the object with the settings used for calls to createDatabase. */
public OperationCallSettings<CreateDatabaseRequest, Database, CreateDatabaseMetadata>
createDatabaseOperationSettings() {
return ((FirestoreAdminStubSettings) getStubSettings()).createDatabaseOperationSettings();
}

/** Returns the object with the settings used for calls to getDatabase. */
public UnaryCallSettings<GetDatabaseRequest, Database> getDatabaseSettings() {
return ((FirestoreAdminStubSettings) getStubSettings()).getDatabaseSettings();
Expand Down Expand Up @@ -384,6 +397,17 @@ public UnaryCallSettings.Builder<ImportDocumentsRequest, Operation> importDocume
return getStubSettingsBuilder().importDocumentsOperationSettings();
}

/** Returns the builder for the settings used for calls to createDatabase. */
public UnaryCallSettings.Builder<CreateDatabaseRequest, Operation> createDatabaseSettings() {
return getStubSettingsBuilder().createDatabaseSettings();
}

/** Returns the builder for the settings used for calls to createDatabase. */
public OperationCallSettings.Builder<CreateDatabaseRequest, Database, CreateDatabaseMetadata>
createDatabaseOperationSettings() {
return getStubSettingsBuilder().createDatabaseOperationSettings();
}

/** Returns the builder for the settings used for calls to getDatabase. */
public UnaryCallSettings.Builder<GetDatabaseRequest, Database> getDatabaseSettings() {
return getStubSettingsBuilder().getDatabaseSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"grpc": {
"libraryClient": "FirestoreAdminClient",
"rpcs": {
"CreateDatabase": {
"methods": ["createDatabaseAsync", "createDatabaseAsync", "createDatabaseAsync", "createDatabaseOperationCallable", "createDatabaseCallable"]
},
"CreateIndex": {
"methods": ["createIndexAsync", "createIndexAsync", "createIndexAsync", "createIndexOperationCallable", "createIndexCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,8 @@
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.CreateDatabaseMetadata;
import com.google.firestore.admin.v1.CreateDatabaseRequest;
import com.google.firestore.admin.v1.CreateIndexRequest;
import com.google.firestore.admin.v1.Database;
import com.google.firestore.admin.v1.DeleteIndexRequest;
Expand Down Expand Up @@ -132,6 +134,15 @@ public UnaryCallable<ImportDocumentsRequest, Operation> importDocumentsCallable(
throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()");
}

public OperationCallable<CreateDatabaseRequest, Database, CreateDatabaseMetadata>
createDatabaseOperationCallable() {
throw new UnsupportedOperationException("Not implemented: createDatabaseOperationCallable()");
}

public UnaryCallable<CreateDatabaseRequest, Operation> createDatabaseCallable() {
throw new UnsupportedOperationException("Not implemented: createDatabaseCallable()");
}

public UnaryCallable<GetDatabaseRequest, Database> getDatabaseCallable() {
throw new UnsupportedOperationException("Not implemented: getDatabaseCallable()");
}
Expand Down
Loading

0 comments on commit b025d11

Please sign in to comment.