|
38 | 38 | import com.google.firestore.admin.v1.BulkDeleteDocumentsMetadata; |
39 | 39 | import com.google.firestore.admin.v1.BulkDeleteDocumentsRequest; |
40 | 40 | import com.google.firestore.admin.v1.BulkDeleteDocumentsResponse; |
| 41 | +import com.google.firestore.admin.v1.CloneDatabaseMetadata; |
| 42 | +import com.google.firestore.admin.v1.CloneDatabaseRequest; |
41 | 43 | import com.google.firestore.admin.v1.CollectionGroupName; |
42 | 44 | import com.google.firestore.admin.v1.CreateBackupScheduleRequest; |
43 | 45 | import com.google.firestore.admin.v1.CreateDatabaseMetadata; |
|
755 | 757 | * </ul> |
756 | 758 | * </td> |
757 | 759 | * </tr> |
| 760 | + * <tr> |
| 761 | + * <td><p> CloneDatabase</td> |
| 762 | + * <td><p> Creates a new database by cloning an existing one. |
| 763 | + * <p> The new database must be in the same cloud region or multi-region location as the existing database. This behaves similar to [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] except instead of creating a new empty database, a new database is created with the database type, index configuration, and documents from an existing database. |
| 764 | + * <p> The [long-running operation][google.longrunning.Operation] can be used to track the progress of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The [response][google.longrunning.Operation.response] type is the [Database][google.firestore.admin.v1.Database] if the clone was successful. The new database is not readable or writeable until the LRO has completed.</td> |
| 765 | + * <td> |
| 766 | + * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p> |
| 767 | + * <ul> |
| 768 | + * <li><p> cloneDatabaseAsync(CloneDatabaseRequest request) |
| 769 | + * </ul> |
| 770 | + * <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p> |
| 771 | + * <ul> |
| 772 | + * <li><p> cloneDatabaseOperationCallable() |
| 773 | + * <li><p> cloneDatabaseCallable() |
| 774 | + * </ul> |
| 775 | + * </td> |
| 776 | + * </tr> |
758 | 777 | * </table> |
759 | 778 | * |
760 | 779 | * <p>See the individual methods for example code. |
@@ -4990,6 +5009,143 @@ public final UnaryCallable<DeleteBackupScheduleRequest, Empty> deleteBackupSched |
4990 | 5009 | return stub.deleteBackupScheduleCallable(); |
4991 | 5010 | } |
4992 | 5011 |
|
| 5012 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5013 | + /** |
| 5014 | + * Creates a new database by cloning an existing one. |
| 5015 | + * |
| 5016 | + * <p>The new database must be in the same cloud region or multi-region location as the existing |
| 5017 | + * database. This behaves similar to |
| 5018 | + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] except |
| 5019 | + * instead of creating a new empty database, a new database is created with the database type, |
| 5020 | + * index configuration, and documents from an existing database. |
| 5021 | + * |
| 5022 | + * <p>The [long-running operation][google.longrunning.Operation] can be used to track the progress |
| 5023 | + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type |
| 5024 | + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The |
| 5025 | + * [response][google.longrunning.Operation.response] type is the |
| 5026 | + * [Database][google.firestore.admin.v1.Database] if the clone was successful. The new database is |
| 5027 | + * not readable or writeable until the LRO has completed. |
| 5028 | + * |
| 5029 | + * <p>Sample code: |
| 5030 | + * |
| 5031 | + * <pre>{@code |
| 5032 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5033 | + * // It will require modifications to work: |
| 5034 | + * // - It may require correct/in-range values for request initialization. |
| 5035 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5036 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5037 | + * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) { |
| 5038 | + * CloneDatabaseRequest request = |
| 5039 | + * CloneDatabaseRequest.newBuilder() |
| 5040 | + * .setParent(ProjectName.of("[PROJECT]").toString()) |
| 5041 | + * .setDatabaseId("databaseId1688905718") |
| 5042 | + * .setPitrSnapshot(PitrSnapshot.newBuilder().build()) |
| 5043 | + * .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) |
| 5044 | + * .putAllTags(new HashMap<String, String>()) |
| 5045 | + * .build(); |
| 5046 | + * Database response = firestoreAdminClient.cloneDatabaseAsync(request).get(); |
| 5047 | + * } |
| 5048 | + * }</pre> |
| 5049 | + * |
| 5050 | + * @param request The request object containing all of the parameters for the API call. |
| 5051 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 5052 | + */ |
| 5053 | + public final OperationFuture<Database, CloneDatabaseMetadata> cloneDatabaseAsync( |
| 5054 | + CloneDatabaseRequest request) { |
| 5055 | + return cloneDatabaseOperationCallable().futureCall(request); |
| 5056 | + } |
| 5057 | + |
| 5058 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5059 | + /** |
| 5060 | + * Creates a new database by cloning an existing one. |
| 5061 | + * |
| 5062 | + * <p>The new database must be in the same cloud region or multi-region location as the existing |
| 5063 | + * database. This behaves similar to |
| 5064 | + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] except |
| 5065 | + * instead of creating a new empty database, a new database is created with the database type, |
| 5066 | + * index configuration, and documents from an existing database. |
| 5067 | + * |
| 5068 | + * <p>The [long-running operation][google.longrunning.Operation] can be used to track the progress |
| 5069 | + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type |
| 5070 | + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The |
| 5071 | + * [response][google.longrunning.Operation.response] type is the |
| 5072 | + * [Database][google.firestore.admin.v1.Database] if the clone was successful. The new database is |
| 5073 | + * not readable or writeable until the LRO has completed. |
| 5074 | + * |
| 5075 | + * <p>Sample code: |
| 5076 | + * |
| 5077 | + * <pre>{@code |
| 5078 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5079 | + * // It will require modifications to work: |
| 5080 | + * // - It may require correct/in-range values for request initialization. |
| 5081 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5082 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5083 | + * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) { |
| 5084 | + * CloneDatabaseRequest request = |
| 5085 | + * CloneDatabaseRequest.newBuilder() |
| 5086 | + * .setParent(ProjectName.of("[PROJECT]").toString()) |
| 5087 | + * .setDatabaseId("databaseId1688905718") |
| 5088 | + * .setPitrSnapshot(PitrSnapshot.newBuilder().build()) |
| 5089 | + * .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) |
| 5090 | + * .putAllTags(new HashMap<String, String>()) |
| 5091 | + * .build(); |
| 5092 | + * OperationFuture<Database, CloneDatabaseMetadata> future = |
| 5093 | + * firestoreAdminClient.cloneDatabaseOperationCallable().futureCall(request); |
| 5094 | + * // Do something. |
| 5095 | + * Database response = future.get(); |
| 5096 | + * } |
| 5097 | + * }</pre> |
| 5098 | + */ |
| 5099 | + public final OperationCallable<CloneDatabaseRequest, Database, CloneDatabaseMetadata> |
| 5100 | + cloneDatabaseOperationCallable() { |
| 5101 | + return stub.cloneDatabaseOperationCallable(); |
| 5102 | + } |
| 5103 | + |
| 5104 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 5105 | + /** |
| 5106 | + * Creates a new database by cloning an existing one. |
| 5107 | + * |
| 5108 | + * <p>The new database must be in the same cloud region or multi-region location as the existing |
| 5109 | + * database. This behaves similar to |
| 5110 | + * [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase] except |
| 5111 | + * instead of creating a new empty database, a new database is created with the database type, |
| 5112 | + * index configuration, and documents from an existing database. |
| 5113 | + * |
| 5114 | + * <p>The [long-running operation][google.longrunning.Operation] can be used to track the progress |
| 5115 | + * of the clone, with the Operation's [metadata][google.longrunning.Operation.metadata] field type |
| 5116 | + * being the [CloneDatabaseMetadata][google.firestore.admin.v1.CloneDatabaseMetadata]. The |
| 5117 | + * [response][google.longrunning.Operation.response] type is the |
| 5118 | + * [Database][google.firestore.admin.v1.Database] if the clone was successful. The new database is |
| 5119 | + * not readable or writeable until the LRO has completed. |
| 5120 | + * |
| 5121 | + * <p>Sample code: |
| 5122 | + * |
| 5123 | + * <pre>{@code |
| 5124 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 5125 | + * // It will require modifications to work: |
| 5126 | + * // - It may require correct/in-range values for request initialization. |
| 5127 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 5128 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 5129 | + * try (FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient.create()) { |
| 5130 | + * CloneDatabaseRequest request = |
| 5131 | + * CloneDatabaseRequest.newBuilder() |
| 5132 | + * .setParent(ProjectName.of("[PROJECT]").toString()) |
| 5133 | + * .setDatabaseId("databaseId1688905718") |
| 5134 | + * .setPitrSnapshot(PitrSnapshot.newBuilder().build()) |
| 5135 | + * .setEncryptionConfig(Database.EncryptionConfig.newBuilder().build()) |
| 5136 | + * .putAllTags(new HashMap<String, String>()) |
| 5137 | + * .build(); |
| 5138 | + * ApiFuture<Operation> future = |
| 5139 | + * firestoreAdminClient.cloneDatabaseCallable().futureCall(request); |
| 5140 | + * // Do something. |
| 5141 | + * Operation response = future.get(); |
| 5142 | + * } |
| 5143 | + * }</pre> |
| 5144 | + */ |
| 5145 | + public final UnaryCallable<CloneDatabaseRequest, Operation> cloneDatabaseCallable() { |
| 5146 | + return stub.cloneDatabaseCallable(); |
| 5147 | + } |
| 5148 | + |
4993 | 5149 | @Override |
4994 | 5150 | public final void close() { |
4995 | 5151 | stub.close(); |
|
0 commit comments