From d3b7bb38537117c508527fd843bc9450ebbfe1ee Mon Sep 17 00:00:00 2001 From: BenWhitehead Date: Tue, 14 Nov 2023 13:52:32 -0500 Subject: [PATCH] docs: add @TransportCompatibility to StorageBatch (#2276) --- .../main/java/com/google/cloud/storage/StorageBatch.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageBatch.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageBatch.java index 0a3e49ab80..9a1f125df5 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageBatch.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageBatch.java @@ -23,6 +23,7 @@ import com.google.cloud.storage.Storage.BlobGetOption; import com.google.cloud.storage.Storage.BlobSourceOption; import com.google.cloud.storage.Storage.BlobTargetOption; +import com.google.cloud.storage.TransportCompatibility.Transport; import com.google.cloud.storage.UnifiedOpts.Opts; import com.google.cloud.storage.spi.v1.RpcBatch; import com.google.cloud.storage.spi.v1.StorageRpc; @@ -53,6 +54,7 @@ * Blob blob = result.get(); // returns get result or throws StorageException * } */ +@TransportCompatibility(Transport.HTTP) public class StorageBatch { private final RpcBatch batch; @@ -86,6 +88,7 @@ StorageOptions getOptions() { * {@code false} if the blob was not found, or throws a {@link StorageException} if the operation * failed. */ + @TransportCompatibility(Transport.HTTP) public StorageBatchResult delete( String bucket, String blob, BlobSourceOption... options) { return delete(BlobId.of(bucket, blob), options); @@ -97,6 +100,7 @@ public StorageBatchResult delete( * {@code false} if the blob was not found, or throws a {@link StorageException} if the operation * failed. */ + @TransportCompatibility(Transport.HTTP) public StorageBatchResult delete(BlobId blob, BlobSourceOption... options) { StorageBatchResult result = new StorageBatchResult<>(); RpcBatch.Callback callback = createDeleteCallback(result); @@ -111,6 +115,7 @@ public StorageBatchResult delete(BlobId blob, BlobSourceOption... optio * {@link StorageBatchResult#get()} on the return value yields the updated {@link Blob} if * successful, or throws a {@link StorageException} if the operation failed. */ + @TransportCompatibility(Transport.HTTP) public StorageBatchResult update(BlobInfo blobInfo, BlobTargetOption... options) { StorageBatchResult result = new StorageBatchResult<>(); RpcBatch.Callback callback = createUpdateCallback(this.options, result); @@ -127,6 +132,7 @@ public StorageBatchResult update(BlobInfo blobInfo, BlobTargetOption... op * {@code null} if no such blob exists, or throws a {@link StorageException} if the operation * failed. */ + @TransportCompatibility(Transport.HTTP) public StorageBatchResult get(String bucket, String blob, BlobGetOption... options) { return get(BlobId.of(bucket, blob), options); } @@ -138,6 +144,7 @@ public StorageBatchResult get(String bucket, String blob, BlobGetOption... * {@code null} if no such blob exists, or throws a {@link StorageException} if the operation * failed. */ + @TransportCompatibility(Transport.HTTP) public StorageBatchResult get(BlobId blob, BlobGetOption... options) { StorageBatchResult result = new StorageBatchResult<>(); RpcBatch.Callback callback = createGetCallback(this.options, result); @@ -147,6 +154,7 @@ public StorageBatchResult get(BlobId blob, BlobGetOption... options) { } /** Submits this batch for processing using a single RPC request. */ + @TransportCompatibility(Transport.HTTP) public void submit() { batch.submit(); }