use of com.google.storage.v2.ComposeObjectRequest in project gapic-generator-java by googleapis.
the class SyncComposeObject method syncComposeObject.
public static void syncComposeObject() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
ComposeObjectRequest request = ComposeObjectRequest.newBuilder().setDestination(Object.newBuilder().build()).addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>()).setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setIfGenerationMatch(-1086241088).setIfMetagenerationMatch(1043427781).setKmsKey(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
Object response = storageClient.composeObject(request);
}
}
use of com.google.storage.v2.ComposeObjectRequest in project gapic-generator-java by googleapis.
the class AsyncComposeObject method asyncComposeObject.
public static void asyncComposeObject() throws Exception {
// It may require modifications to work in your environment.
try (StorageClient storageClient = StorageClient.create()) {
ComposeObjectRequest request = ComposeObjectRequest.newBuilder().setDestination(Object.newBuilder().build()).addAllSourceObjects(new ArrayList<ComposeObjectRequest.SourceObject>()).setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setIfGenerationMatch(-1086241088).setIfMetagenerationMatch(1043427781).setKmsKey(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
ApiFuture<Object> future = storageClient.composeObjectCallable().futureCall(request);
// Do something.
Object response = future.get();
}
}
Aggregations