use of com.google.logging.v2.DeleteBucketRequest in project gapic-generator-java by googleapis.
the class SyncDeleteBucket method syncDeleteBucket.
public static void syncDeleteBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).build();
configClient.deleteBucket(request);
}
}
use of com.google.logging.v2.DeleteBucketRequest in project gapic-generator-java by googleapis.
the class AsyncDeleteBucket method asyncDeleteBucket.
public static void asyncDeleteBucket() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<Empty> future = storageClient.deleteBucketCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations