Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you are using Maven without the BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.20.0')
implementation platform('com.google.cloud:libraries-bom:26.21.0')

implementation 'com.google.cloud:google-cloud-firestore'
```
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 @@ -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