use of com.google.storage.v2.LockBucketRetentionPolicyRequest in project gapic-generator-java by googleapis.
the class AsyncLockBucketRetentionPolicy method asyncLockBucketRetentionPolicy.
public static void asyncLockBucketRetentionPolicy() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
LockBucketRetentionPolicyRequest request = LockBucketRetentionPolicyRequest.newBuilder().setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()).setIfMetagenerationMatch(1043427781).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<Bucket> future = storageClient.lockBucketRetentionPolicyCallable().futureCall(request);
// Do something.
Bucket response = future.get();
}
}
use of com.google.storage.v2.LockBucketRetentionPolicyRequest in project gapic-generator-java by googleapis.
the class SyncLockBucketRetentionPolicy method syncLockBucketRetentionPolicy.
public static void syncLockBucketRetentionPolicy() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
LockBucketRetentionPolicyRequest request = LockBucketRetentionPolicyRequest.newBuilder().setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()).setIfMetagenerationMatch(1043427781).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
Bucket response = storageClient.lockBucketRetentionPolicy(request);
}
}
Aggregations