Search in sources :

Example 1 with StartResumableWriteResponse

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

the class AsyncStartResumableWrite method asyncStartResumableWrite.

public static void asyncStartResumableWrite() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        StartResumableWriteRequest request = StartResumableWriteRequest.newBuilder().setWriteObjectSpec(WriteObjectSpec.newBuilder().build()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        ApiFuture<StartResumableWriteResponse> future = storageClient.startResumableWriteCallable().futureCall(request);
        // Do something.
        StartResumableWriteResponse response = future.get();
    }
}
Also used : StartResumableWriteResponse(com.google.storage.v2.StartResumableWriteResponse) StorageClient(com.google.storage.v2.StorageClient) StartResumableWriteRequest(com.google.storage.v2.StartResumableWriteRequest)

Example 2 with StartResumableWriteResponse

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

the class SyncStartResumableWrite method syncStartResumableWrite.

public static void syncStartResumableWrite() throws Exception {
    // It may require modifications to work in your environment.
    try (StorageClient storageClient = StorageClient.create()) {
        StartResumableWriteRequest request = StartResumableWriteRequest.newBuilder().setWriteObjectSpec(WriteObjectSpec.newBuilder().build()).setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()).setCommonRequestParams(CommonRequestParams.newBuilder().build()).build();
        StartResumableWriteResponse response = storageClient.startResumableWrite(request);
    }
}
Also used : StartResumableWriteResponse(com.google.storage.v2.StartResumableWriteResponse) StorageClient(com.google.storage.v2.StorageClient) StartResumableWriteRequest(com.google.storage.v2.StartResumableWriteRequest)

Aggregations

StartResumableWriteRequest (com.google.storage.v2.StartResumableWriteRequest)2 StartResumableWriteResponse (com.google.storage.v2.StartResumableWriteResponse)2 StorageClient (com.google.storage.v2.StorageClient)2