use of com.google.bigtable.admin.v2.DeleteAppProfileRequest in project java-bigtable by googleapis.
the class BigtableInstanceAdminClient method deleteAppProfileAsync.
/**
* Asynchronously deletes the specified app profile with an option to force deletion.
*
* <p>Sample code:
*
* <pre>{@code
* ApiFuture<Void> deleteFuture = client.deleteAppProfileAsync("my-instance", "my-app-profile", true);
*
* deleteFuture.get();
* }</pre>
*/
@SuppressWarnings("WeakerAccess")
public ApiFuture<Void> deleteAppProfileAsync(String instanceId, String appProfileId, boolean forceDelete) {
String name = NameUtil.formatAppProfileName(projectId, instanceId, appProfileId);
DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder().setName(name).setIgnoreWarnings(forceDelete).build();
return ApiFutures.transform(stub.deleteAppProfileCallable().futureCall(request), new ApiFunction<Empty, Void>() {
@Override
public Void apply(Empty input) {
return null;
}
}, MoreExecutors.directExecutor());
}
use of com.google.bigtable.admin.v2.DeleteAppProfileRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClient method deleteAppProfile.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an app profile from an instance.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* String name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
* baseBigtableInstanceAdminClient.deleteAppProfile(name);
* }
* }</pre>
*
* @param name Required. The unique name of the app profile to be deleted. Values are of the form
* `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteAppProfile(String name) {
DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder().setName(name).build();
deleteAppProfile(request);
}
use of com.google.bigtable.admin.v2.DeleteAppProfileRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClientTest method deleteAppProfileTest.
@Test
public void deleteAppProfileTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockBigtableInstanceAdmin.addResponse(expectedResponse);
AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
client.deleteAppProfile(name);
List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.bigtable.admin.v2.DeleteAppProfileRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClientTest method deleteAppProfileTest2.
@Test
public void deleteAppProfileTest2() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockBigtableInstanceAdmin.addResponse(expectedResponse);
String name = "name3373707";
client.deleteAppProfile(name);
List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteAppProfileRequest actualRequest = ((DeleteAppProfileRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.bigtable.admin.v2.DeleteAppProfileRequest in project java-bigtable by googleapis.
the class BaseBigtableInstanceAdminClient method deleteAppProfile.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an app profile from an instance.
*
* <p>Sample code:
*
* <pre>{@code
* try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
* BaseBigtableInstanceAdminClient.create()) {
* AppProfileName name = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
* baseBigtableInstanceAdminClient.deleteAppProfile(name);
* }
* }</pre>
*
* @param name Required. The unique name of the app profile to be deleted. Values are of the form
* `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteAppProfile(AppProfileName name) {
DeleteAppProfileRequest request = DeleteAppProfileRequest.newBuilder().setName(name == null ? null : name.toString()).build();
deleteAppProfile(request);
}
Aggregations