Search in sources :

Example 1 with UpdateObjectRequest

use of com.google.storage.v2.UpdateObjectRequest in project gapic-generator-java by googleapis.

the class SyncUpdateObject method syncUpdateObject.

public static void syncUpdateObject() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateObjectRequest request = UpdateObjectRequest.newBuilder().setObject(Object.newBuilder().build()).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setUpdateMask(FieldMask.newBuilder().build()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        Object response = storageClient.updateObject(request);
    }
}
Also used : UpdateObjectRequest(com.google.storage.v2.UpdateObjectRequest) StorageClient(com.google.storage.v2.StorageClient) Object(com.google.storage.v2.Object)

Example 2 with UpdateObjectRequest

use of com.google.storage.v2.UpdateObjectRequest in project gapic-generator-java by googleapis.

the class AsyncUpdateObject method asyncUpdateObject.

public static void asyncUpdateObject() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        UpdateObjectRequest request = UpdateObjectRequest.newBuilder().setObject(Object.newBuilder().build()).setIfGenerationMatch(-1086241088).setIfGenerationNotMatch(1475720404).setIfMetagenerationMatch(1043427781).setIfMetagenerationNotMatch(1025430873).setPredefinedAcl(PredefinedObjectAcl.forNumber(0)).setUpdateMask(FieldMask.newBuilder().build()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<Object> future = storageClient.updateObjectCallable().futureCall(request);
        // Do something.
        Object response = future.get();
    }
}
Also used : UpdateObjectRequest(com.google.storage.v2.UpdateObjectRequest) StorageClient(com.google.storage.v2.StorageClient) Object(com.google.storage.v2.Object)

Aggregations

Object (com.google.storage.v2.Object)2 StorageClient (com.google.storage.v2.StorageClient)2 UpdateObjectRequest (com.google.storage.v2.UpdateObjectRequest)2