From ac9ee6330b688f1b3eeea77548f1897be25782da Mon Sep 17 00:00:00 2001 From: Rabab Ibrahim Date: Thu, 12 Sep 2024 00:48:51 -0700 Subject: [PATCH] Revert "Blobs Sync Stack Migration (#40812)" (#41819) This reverts commit 37d8cdca1cb211077b78d7aca97d07adb2e03d83. --- eng/versioning/version_client.txt | 3 - .../checkstyle-suppressions.xml | 7 - sdk/storage/azure-storage-blob/pom.xml | 4 +- .../azure-storage-blob/spotbugs-exclude.xml | 5 - .../com/azure/storage/blob/BlobClient.java | 74 +- .../azure/storage/blob/BlobClientBuilder.java | 36 +- .../blob/BlobContainerAsyncClient.java | 48 +- .../storage/blob/BlobContainerClient.java | 409 +- .../blob/BlobContainerClientBuilder.java | 33 +- .../storage/blob/BlobServiceAsyncClient.java | 92 +- .../azure/storage/blob/BlobServiceClient.java | 307 +- .../blob/BlobServiceClientBuilder.java | 47 +- .../blob/implementation/AppendBlobsImpl.java | 1189 +--- .../blob/implementation/BlobsImpl.java | 5940 +++-------------- .../blob/implementation/BlockBlobsImpl.java | 3104 ++------- .../blob/implementation/ContainersImpl.java | 2947 +------- .../blob/implementation/PageBlobsImpl.java | 2683 +------- .../blob/implementation/ServicesImpl.java | 1460 +--- .../implementation/util/BlobQueryReader.java | 193 - .../blob/implementation/util/ModelHelper.java | 231 - .../specialized/AppendBlobAsyncClient.java | 3 +- .../blob/specialized/AppendBlobClient.java | 138 +- .../blob/specialized/BlobAsyncClientBase.java | 47 +- .../blob/specialized/BlobClientBase.java | 689 +- .../blob/specialized/BlobLeaseClient.java | 174 +- .../specialized/BlobLeaseClientBuilder.java | 7 +- .../specialized/BlockBlobAsyncClient.java | 7 +- .../blob/specialized/BlockBlobClient.java | 59 +- .../blob/specialized/PageBlobAsyncClient.java | 27 +- .../blob/specialized/PageBlobClient.java | 421 +- .../src/main/java/module-info.java | 1 - .../blob/specialized/BlobBaseApiTests.java | 4 +- .../azure-storage-blob/swagger/README.md | 1 - .../azure-storage-file-datalake/pom.xml | 4 +- .../storage/file/datalake/FileApiTest.java | 5 +- 35 files changed, 2824 insertions(+), 17575 deletions(-) diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 58c448e4bf885..904f58c5b88ba 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -492,9 +492,6 @@ unreleased_com.azure:azure-json;1.3.0 unreleased_com.azure:azure-core-amqp;2.10.0-beta.1 -unreleased_com.azure:azure-core;1.52.0-beta.1 -unreleased_com.azure:azure-core-http-okhttp;1.13.0-beta.1 - # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid # for dependency versions. These entries are specifically for when we've released a beta for diff --git a/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml b/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml index d2e954d56ed63..f106f985d40b3 100644 --- a/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml +++ b/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml @@ -35,14 +35,7 @@ - - - - - - - diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml index de8794e58472c..1e89f040f855a 100644 --- a/sdk/storage/azure-storage-blob/pom.xml +++ b/sdk/storage/azure-storage-blob/pom.xml @@ -70,7 +70,7 @@ com.azure azure-core - 1.52.0-beta.1 + 1.51.0 com.azure @@ -182,7 +182,7 @@ com.azure azure-core-http-okhttp - 1.13.0-beta.1 + 1.12.2 test diff --git a/sdk/storage/azure-storage-blob/spotbugs-exclude.xml b/sdk/storage/azure-storage-blob/spotbugs-exclude.xml index 8b12ac100b680..1d9d591bb4dd3 100644 --- a/sdk/storage/azure-storage-blob/spotbugs-exclude.xml +++ b/sdk/storage/azure-storage-blob/spotbugs-exclude.xml @@ -8,7 +8,6 @@ - @@ -186,8 +185,4 @@ - - - - diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java index 2951e455c2256..360104fb2f524 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java @@ -6,16 +6,13 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.blob.implementation.models.EncryptionScope; import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AccessTier; -import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.options.BlobParallelUploadOptions; import com.azure.storage.blob.models.BlobRequestConditions; @@ -35,8 +32,6 @@ import java.io.InputStream; import java.io.UncheckedIOException; -import java.nio.channels.AsynchronousFileChannel; -import java.nio.file.Path; import java.time.Duration; import java.util.Map; import java.util.Objects; @@ -66,26 +61,19 @@ public class BlobClient extends BlobClientBase { /** * The block size to use if none is specified in parallel operations. */ - public static final int BLOB_DEFAULT_UPLOAD_BLOCK_SIZE = 4 * Constants.MB; + public static final int BLOB_DEFAULT_UPLOAD_BLOCK_SIZE = BlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE; /** * The number of buffers to use if none is specied on the buffered upload method. */ - public static final int BLOB_DEFAULT_NUMBER_OF_BUFFERS = 8; + public static final int BLOB_DEFAULT_NUMBER_OF_BUFFERS = BlobAsyncClient.BLOB_DEFAULT_NUMBER_OF_BUFFERS; /** * If a blob is known to be greater than 100MB, using a larger block size will trigger some server-side * optimizations. If the block size is not set and the size of the blob is known to be greater than 100MB, this * value will be used. */ - public static final int BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE = 8 * Constants.MB; + public static final int BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE = BlobAsyncClient.BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE; - /** - * The default block size used in {@link FluxUtil#readFile(AsynchronousFileChannel)}. - * This is to make sure we're using same size when using {@link BinaryData#fromFile(Path, int)} - * and {@link BinaryData#fromFile(Path, Long, Long, int)} - * to represent the content. - */ - private static final int DEFAULT_FILE_READ_CHUNK_SIZE = 1024 * 64; private final BlobAsyncClient client; private BlockBlobClient blockBlobClient; @@ -101,31 +89,6 @@ protected BlobClient(BlobAsyncClient client) { this.client = client; } - /** - * Protected constructor for use by {@link BlobClientBuilder}. - * - * @param client the async blob client - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param blobName The blob name. - * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version. - */ - protected BlobClient(BlobAsyncClient client, HttpPipeline pipeline, String url, BlobServiceVersion serviceVersion, - String accountName, String containerName, String blobName, String snapshot, CpkInfo customerProvidedKey, - EncryptionScope encryptionScope, String versionId) { - super(client, pipeline, url, serviceVersion, accountName, containerName, blobName, snapshot, customerProvidedKey, - encryptionScope, versionId); - this.client = client; - } - /** * Creates a new {@link BlobClient} linked to the {@code snapshot} of this blob resource. * @@ -134,11 +97,7 @@ protected BlobClient(BlobAsyncClient client, HttpPipeline pipeline, String url, */ @Override public BlobClient getSnapshotClient(String snapshot) { - BlobAsyncClient asyncClient = new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(), - getAccountName(), getContainerName(), getBlobName(), snapshot, getCustomerProvidedKey(), - encryptionScope, getVersionId()); - return new BlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), - getContainerName(), getBlobName(), snapshot, getCustomerProvidedKey(), encryptionScope, getVersionId()); + return new BlobClient(client.getSnapshotClient(snapshot)); } /** @@ -150,11 +109,7 @@ public BlobClient getSnapshotClient(String snapshot) { */ @Override public BlobClient getVersionClient(String versionId) { - BlobAsyncClient asyncClient = new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(), - getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), getCustomerProvidedKey(), - encryptionScope, versionId); - return new BlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), - getContainerName(), getBlobName(), getSnapshotId(), getCustomerProvidedKey(), encryptionScope, versionId); + return new BlobClient(client.getVersionClient(versionId)); } /** @@ -165,13 +120,7 @@ public BlobClient getVersionClient(String versionId) { */ @Override public BlobClient getEncryptionScopeClient(String encryptionScope) { - EncryptionScope finalEncryptionScope = null; - if (encryptionScope != null) { - finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope); - } - return new BlobClient(this.client.getEncryptionScopeAsyncClient(encryptionScope), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), - getCustomerProvidedKey(), finalEncryptionScope, getVersionId()); + return new BlobClient(client.getEncryptionScopeAsyncClient(encryptionScope)); } /** @@ -183,16 +132,7 @@ public BlobClient getEncryptionScopeClient(String encryptionScope) { */ @Override public BlobClient getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) { - CpkInfo finalCustomerProvidedKey = null; - if (customerProvidedKey != null) { - finalCustomerProvidedKey = new CpkInfo() - .setEncryptionKey(customerProvidedKey.getKey()) - .setEncryptionKeySha256(customerProvidedKey.getKeySha256()) - .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm()); - } - return new BlobClient(this.client.getCustomerProvidedKeyAsyncClient(customerProvidedKey), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), - finalCustomerProvidedKey, encryptionScope, getVersionId()); + return new BlobClient(client.getCustomerProvidedKeyAsyncClient(customerProvidedKey)); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java index c980ef37a0715..9f68b931df66c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java @@ -127,29 +127,7 @@ public BlobClientBuilder() { * and {@link #retryOptions(RequestRetryOptions)} have been set. */ public BlobClient buildClient() { - Objects.requireNonNull(blobName, "'blobName' cannot be null."); - Objects.requireNonNull(endpoint, "'endpoint' cannot be null"); - - BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER); - - if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption " - + "scope cannot both be set")); - } - - /* - Implicit and explicit root container access are functionally equivalent, but explicit references are easier - to read and debug. - */ - String blobContainerName = CoreUtils.isNullOrEmpty(containerName) ? BlobContainerClient.ROOT_CONTAINER_NAME - : containerName; - - BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - - BlobAsyncClient asyncClient = buildAsyncClient(); - - return new BlobClient(asyncClient, asyncClient.getHttpPipeline(), endpoint, serviceVersion, accountName, - blobContainerName, blobName, snapshot, customerProvidedKey, encryptionScope, versionId); + return new BlobClient(buildAsyncClient()); } /** @@ -193,17 +171,13 @@ public BlobAsyncClient buildAsyncClient() { BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - HttpPipeline pipeline = constructPipeline(); - - return new BlobAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, blobName, - snapshot, customerProvidedKey, encryptionScope, versionId); - } - - private HttpPipeline constructPipeline() { - return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( + HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken, endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); + + return new BlobAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, blobName, + snapshot, customerProvidedKey, encryptionScope, versionId); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java index adb06e7e29214..753176857abc4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java @@ -56,6 +56,7 @@ import java.net.URI; import java.time.Duration; import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -314,19 +315,6 @@ public String getEncryptionScope() { return encryptionScope.getEncryptionScope(); } - /** - * Gets the {@link EncryptionScope} used to encrypt this blob's content on the server. - * - * @return the encryption scope used for encryption. - */ - BlobContainerEncryptionScope getBlobContainerEncryptionScope() { - if (blobContainerEncryptionScope == null) { - return null; - } - return blobContainerEncryptionScope; - } - - /** * Gets if the container this client represents exists in the cloud. * @@ -577,7 +565,7 @@ public Mono> deleteWithResponse(BlobRequestConditions requestCond Mono> deleteWithResponse(BlobRequestConditions requestConditions, Context context) { requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - if (!ModelHelper.validateNoETag(requestConditions)) { + if (!validateNoETag(requestConditions)) { // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until // subscription. throw LOGGER.logExceptionAsError( @@ -803,7 +791,7 @@ Mono> setMetadataWithResponse(Map metadata, BlobRequestConditions requestConditions, Context context) { context = context == null ? Context.NONE : context; requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - if (!ModelHelper.validateNoETag(requestConditions) || requestConditions.getIfUnmodifiedSince() != null) { + if (!validateNoETag(requestConditions) || requestConditions.getIfUnmodifiedSince() != null) { // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until // subscription. throw LOGGER.logExceptionAsError(new UnsupportedOperationException( @@ -973,19 +961,36 @@ Mono> setAccessPolicyWithResponse(PublicAccessType accessType, List identifiers, BlobRequestConditions requestConditions, Context context) { requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - if (!ModelHelper.validateNoETag(requestConditions)) { + if (!validateNoETag(requestConditions)) { // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until // subscription. throw LOGGER.logExceptionAsError( new UnsupportedOperationException("ETag access conditions are not supported for this API.")); } - List finalIdentifiers = ModelHelper.truncateTimeForBlobSignedIdentifier(identifiers); + /* + We truncate to seconds because the service only supports nanoseconds or seconds, but doing an + OffsetDateTime.now will only give back milliseconds (more precise fields are zeroed and not serialized). This + allows for proper serialization with no real detriment to users as sub-second precision on active time for + signed identifiers is not really necessary. + */ + if (identifiers != null) { + for (BlobSignedIdentifier identifier : identifiers) { + if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getStartsOn() != null) { + identifier.getAccessPolicy().setStartsOn( + identifier.getAccessPolicy().getStartsOn().truncatedTo(ChronoUnit.SECONDS)); + } + if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getExpiresOn() != null) { + identifier.getAccessPolicy().setExpiresOn( + identifier.getAccessPolicy().getExpiresOn().truncatedTo(ChronoUnit.SECONDS)); + } + } + } context = context == null ? Context.NONE : context; return this.azureBlobStorage.getContainers().setAccessPolicyNoCustomHeadersWithResponseAsync(containerName, null, requestConditions.getLeaseId(), accessType, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, finalIdentifiers, context); + requestConditions.getIfUnmodifiedSince(), null, identifiers, context); } /** @@ -1720,6 +1725,13 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context); } + private static boolean validateNoETag(BlobRequestConditions modifiedRequestConditions) { + if (modifiedRequestConditions == null) { + return true; + } + return modifiedRequestConditions.getIfMatch() == null && modifiedRequestConditions.getIfNoneMatch() == null; + } + // private boolean validateNoTime(BlobRequestConditions modifiedRequestConditions) { // if (modifiedRequestConditions == null) { // return true; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java index aac26a1fd1eaa..cc5528333cb56 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java @@ -6,47 +6,16 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.SharedExecutorService; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.blob.implementation.AzureBlobStorageImpl; -import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder; -import com.azure.storage.blob.implementation.accesshelpers.BlobItemConstructorProxy; -import com.azure.storage.blob.implementation.models.BlobHierarchyListSegment; -import com.azure.storage.blob.implementation.models.BlobSignedIdentifierWrapper; -import com.azure.storage.blob.implementation.models.ContainersFilterBlobsHeaders; -import com.azure.storage.blob.implementation.models.ContainersGetAccessPolicyHeaders; -import com.azure.storage.blob.implementation.models.ContainersGetAccountInfoHeaders; -import com.azure.storage.blob.implementation.models.ContainersGetPropertiesHeaders; -import com.azure.storage.blob.implementation.models.ContainersListBlobFlatSegmentHeaders; -import com.azure.storage.blob.implementation.models.ContainersListBlobHierarchySegmentHeaders; -import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.models.FilterBlobSegment; -import com.azure.storage.blob.implementation.models.ListBlobsFlatSegmentResponse; -import com.azure.storage.blob.implementation.models.ListBlobsHierarchySegmentResponse; -import com.azure.storage.blob.implementation.util.BlobSasImplUtil; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.BlobContainerAccessPolicies; -import com.azure.storage.blob.models.BlobContainerEncryptionScope; import com.azure.storage.blob.models.BlobContainerProperties; -import com.azure.storage.blob.models.BlobErrorCode; import com.azure.storage.blob.models.BlobItem; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.BlobSignedIdentifier; -import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; -import com.azure.storage.blob.models.CustomerProvidedKey; -import com.azure.storage.blob.models.ListBlobsIncludeItem; import com.azure.storage.blob.models.ListBlobsOptions; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.StorageAccountInfo; @@ -56,27 +25,16 @@ import com.azure.storage.blob.options.FindBlobsOptions; import com.azure.storage.blob.sas.BlobServiceSasSignatureValues; import com.azure.storage.common.StorageSharedKeyCredential; -import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.common.implementation.StorageImplUtils; +import reactor.core.publisher.Mono; -import java.net.URI; import java.time.Duration; import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; -import java.util.function.BiFunction; -import java.util.function.Supplier; -import java.util.stream.Collectors; import java.util.function.Consumer; -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapServiceCallWithExceptionMapping; -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; +import static com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout; /** * Client to a container. It may only be instantiated through a {@link BlobContainerClientBuilder} or via the method @@ -94,6 +52,8 @@ */ @ServiceClient(builder = BlobContainerClientBuilder.class) public final class BlobContainerClient { + private final BlobContainerAsyncClient client; + /** * Special container name for the root container in the Storage account. */ @@ -108,15 +68,6 @@ public final class BlobContainerClient { * Special container name for the logs container in the Storage account. */ public static final String LOG_CONTAINER_NAME = BlobContainerAsyncClient.LOG_CONTAINER_NAME; - private static final ClientLogger LOGGER = new ClientLogger(BlobContainerClient.class); - private final AzureBlobStorageImpl azureBlobStorage; - - private final String accountName; - private final String containerName; - private final BlobServiceVersion serviceVersion; - private final CpkInfo customerProvidedKey; // only used to pass down to blob clients - private final EncryptionScope encryptionScope; // only used to pass down to blob clients - private final BlobContainerEncryptionScope blobContainerEncryptionScope; /** * Package-private constructor for use by {@link BlobContainerClientBuilder}. @@ -124,47 +75,7 @@ public final class BlobContainerClient { * @param client the async container client */ BlobContainerClient(BlobContainerAsyncClient client) { - this(client.getHttpPipeline(), client.getAccountUrl(), client.getServiceVersion(), - client.getAccountName(), client.getBlobContainerName(), client.getCustomerProvidedKey(), - new EncryptionScope().setEncryptionScope(client.getEncryptionScope()), - client.getBlobContainerEncryptionScope()); - } - - /** - * Package-private constructor for use by {@link BlobContainerClientBuilder}. - * - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - */ - BlobContainerClient(HttpPipeline pipeline, String url, BlobServiceVersion serviceVersion, String accountName, - String containerName, CpkInfo customerProvidedKey, EncryptionScope encryptionScope, - BlobContainerEncryptionScope blobContainerEncryptionScope) { - this.azureBlobStorage = new AzureBlobStorageImplBuilder() - .pipeline(pipeline) - .url(url) - .version(serviceVersion.getVersion()) - .buildClient(); - this.serviceVersion = serviceVersion; - - this.accountName = accountName; - this.containerName = containerName; - this.customerProvidedKey = customerProvidedKey; - this.encryptionScope = encryptionScope; - this.blobContainerEncryptionScope = blobContainerEncryptionScope; - /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer - when the sas token has already been applied. */ - try { - URI.create(getBlobContainerUrl()); - } catch (IllegalArgumentException ex) { - throw LOGGER.logExceptionAsError(ex); - } + this.client = client; } @@ -185,7 +96,7 @@ public final class BlobContainerClient { * @return A new {@link BlobClient} object which references the blob with the specified name in this container. */ public BlobClient getBlobClient(String blobName) { - return getBlobClient(blobName, null); + return new BlobClient(client.getBlobAsyncClient(blobName)); } /** @@ -206,8 +117,7 @@ public BlobClient getBlobClient(String blobName) { * @return A new {@link BlobClient} object which references the blob with the specified name in this container. */ public BlobClient getBlobClient(String blobName, String snapshot) { - return new BlobClient(new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(), - getAccountName(), getBlobContainerName(), blobName, snapshot, getCustomerProvidedKey(), encryptionScope)); + return new BlobClient(client.getBlobAsyncClient(blobName, snapshot)); } /** @@ -220,9 +130,7 @@ public BlobClient getBlobClient(String blobName, String snapshot) { * @return A new {@link BlobClient} object which references the blob with the specified name in this container. */ public BlobClient getBlobVersionClient(String blobName, String versionId) { - return new BlobClient(new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(), - getAccountName(), getBlobContainerName(), blobName, null, getCustomerProvidedKey(), encryptionScope, - versionId)); + return new BlobClient(client.getBlobVersionAsyncClient(blobName, versionId)); } /** @@ -240,7 +148,7 @@ public BlobClient getBlobVersionClient(String blobName, String versionId) { * @return The name of container. */ public String getBlobContainerName() { - return containerName; + return this.client.getBlobContainerName(); } /** @@ -249,7 +157,7 @@ public String getBlobContainerName() { * @return the URL of the storage account */ public String getAccountUrl() { - return azureBlobStorage.getUrl(); + return this.client.getAccountUrl(); } /** @@ -258,7 +166,7 @@ public String getAccountUrl() { * @return the URL. */ public String getBlobContainerUrl() { - return azureBlobStorage.getUrl() + "/" + containerName; + return client.getBlobContainerUrl(); } /** @@ -267,7 +175,7 @@ public String getBlobContainerUrl() { * @return account name associated with this storage resource. */ public String getAccountName() { - return this.accountName; + return this.client.getAccountName(); } /** @@ -276,15 +184,7 @@ public String getAccountName() { * @return {@link BlobServiceClient} */ public BlobServiceClient getServiceClient() { - CustomerProvidedKey encryptionKey = this.customerProvidedKey == null ? null - : new CustomerProvidedKey(this.customerProvidedKey.getEncryptionKey()); - return new BlobServiceClientBuilder() - .endpoint(this.getBlobContainerUrl()) - .pipeline(this.getHttpPipeline()) - .serviceVersion(this.serviceVersion) - .blobContainerEncryptionScope(this.blobContainerEncryptionScope) - .encryptionScope(this.getEncryptionScope()) - .customerProvidedKey(encryptionKey).buildClient(); + return this.client.getServiceClientBuilder().buildClient(); } /** @@ -293,7 +193,7 @@ public BlobServiceClient getServiceClient() { * @return the service version the client is using. */ public BlobServiceVersion getServiceVersion() { - return serviceVersion; + return this.client.getServiceVersion(); } /** @@ -302,7 +202,7 @@ public BlobServiceVersion getServiceVersion() { * @return The pipeline. */ public HttpPipeline getHttpPipeline() { - return azureBlobStorage.getHttpPipeline(); + return client.getHttpPipeline(); } /** @@ -312,7 +212,7 @@ public HttpPipeline getHttpPipeline() { * @return the customer provided key used for encryption. */ public CpkInfo getCustomerProvidedKey() { - return customerProvidedKey; + return client.getCustomerProvidedKey(); } /** @@ -321,10 +221,7 @@ public CpkInfo getCustomerProvidedKey() { * @return the encryption scope used for encryption. */ public String getEncryptionScope() { - if (encryptionScope == null) { - return null; - } - return encryptionScope.getEncryptionScope(); + return client.getEncryptionScope(); } /** @@ -362,18 +259,9 @@ public boolean exists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response existsWithResponse(Duration timeout, Context context) { - try { - Response response = getPropertiesWithResponse(null, timeout, context); - return new SimpleResponse<>(response, true); - } catch (RuntimeException e) { - if (ModelHelper.checkContainerDoesNotExistStatusCode(e) && e instanceof HttpResponseException) { - HttpResponse response = ((HttpResponseException) e).getResponse(); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), false); - } else { - throw LOGGER.logExceptionAsError(e); - } - } + Mono> response = client.existsWithResponse(context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -429,11 +317,8 @@ public void create() { @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(Map metadata, PublicAccessType accessType, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureBlobStorage.getContainers() - .createNoCustomHeadersWithResponse(containerName, null, metadata, accessType, null, - blobContainerEncryptionScope, finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = client.createWithResponse(metadata, accessType, context); + return blockWithOptionalTimeout(response, timeout); } /** @@ -487,21 +372,8 @@ public boolean createIfNotExists() { @ServiceMethod(returns = ReturnType.SINGLE) public Response createIfNotExistsWithResponse(BlobContainerCreateOptions options, Duration timeout, Context context) { - BlobContainerCreateOptions finalOptions = options == null ? new BlobContainerCreateOptions() : options; - try { - Response response = createWithResponse(finalOptions.getMetadata(), finalOptions.getPublicAccessType(), - timeout, context); - return new SimpleResponse<>(response, true); - } catch (BlobStorageException e) { - if (e.getStatusCode() == 409 && e.getErrorCode().equals(BlobErrorCode.CONTAINER_ALREADY_EXISTS)) { - HttpResponse res = e.getResponse(); - return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), false); - } else { - throw LOGGER.logExceptionAsError(e); - } - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } + return StorageImplUtils.blockWithOptionalTimeout(client. + createIfNotExistsWithResponse(options, context), timeout); } /** @@ -556,22 +428,9 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() - : requestConditions; - if (!ModelHelper.validateNoETag(requestConditions)) { - // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("ETag access conditions are not supported for this API.")); - } - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().deleteNoCustomHeadersWithResponse(containerName, null, - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), null, finalContext)); + Mono> response = client.deleteWithResponse(requestConditions, context); - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(response, timeout); } /** @@ -626,17 +485,7 @@ public boolean deleteIfExists() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteIfExistsWithResponse(BlobRequestConditions requestConditions, Duration timeout, Context context) { - try { - Response response = this.deleteWithResponse(requestConditions, timeout, context); - return new SimpleResponse<>(response, true); - } catch (BlobStorageException e) { - if (e.getStatusCode() == 404 && e.getErrorCode().equals(BlobErrorCode.CONTAINER_NOT_FOUND)) { - HttpResponse res = e.getResponse(); - return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), false); - } else { - throw LOGGER.logExceptionAsError(e); - } - } + return blockWithOptionalTimeout(client.deleteIfExistsWithResponse(requestConditions, context), timeout); } /** @@ -689,20 +538,7 @@ public BlobContainerProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(String leaseId, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().getPropertiesWithResponse(containerName, null, leaseId, null, - finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - ContainersGetPropertiesHeaders hd = response.getDeserializedHeaders(); - BlobContainerProperties properties = new BlobContainerProperties(hd.getXMsMeta(), hd.getETag(), - hd.getLastModified(), hd.getXMsLeaseDuration(), hd.getXMsLeaseState(), hd.getXMsLeaseStatus(), - hd.getXMsBlobPublicAccess(), Boolean.TRUE.equals(hd.isXMsHasImmutabilityPolicy()), - Boolean.TRUE.equals(hd.isXMsHasLegalHold()), hd.getXMsDefaultEncryptionScope(), - hd.isXMsDenyEncryptionScopeOverride(), hd.isXMsImmutableStorageWithVersioningEnabled()); - return new SimpleResponse<>(response, properties); + return blockWithOptionalTimeout(client.getPropertiesWithResponse(leaseId, context), timeout); } /** @@ -759,20 +595,9 @@ public void setMetadata(Map metadata) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setMetadataWithResponse(Map metadata, BlobRequestConditions requestConditions, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() - : requestConditions; - if (!ModelHelper.validateNoETag(finalRequestConditions) || finalRequestConditions.getIfUnmodifiedSince() != null) { - // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError(new UnsupportedOperationException( - "If-Modified-Since is the only HTTP access condition supported for this API")); - } - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - azureBlobStorage.getContainers().setMetadataWithResponse(containerName, null, - finalRequestConditions.getLeaseId(), metadata, finalRequestConditions.getIfModifiedSince(), null, - finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = client.setMetadataWithResponse(metadata, requestConditions, + context); + return blockWithOptionalTimeout(response, timeout); } /** @@ -832,15 +657,7 @@ public BlobContainerAccessPolicies getAccessPolicy() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getAccessPolicyWithResponse(String leaseId, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().getAccessPolicyWithResponse(containerName, null, leaseId, null, - finalContext)); - ResponseBase response = sendRequest(operation, - timeout, BlobStorageException.class); - return new SimpleResponse<>(response, new BlobContainerAccessPolicies( - response.getDeserializedHeaders().getXMsBlobPublicAccess(), response.getValue().items())); + return blockWithOptionalTimeout(client.getAccessPolicyWithResponse(leaseId, context), timeout); } /** @@ -929,21 +746,10 @@ public void setAccessPolicy(PublicAccessType accessType, public Response setAccessPolicyWithResponse(PublicAccessType accessType, List identifiers, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; + Mono> response = client + .setAccessPolicyWithResponse(accessType, identifiers, requestConditions, context); - if (!ModelHelper.validateNoETag(requestConditions)) { - // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("ETag access conditions are not supported for this API.")); - } - List finalIdentifiers = ModelHelper.truncateTimeForBlobSignedIdentifier(identifiers); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().setAccessPolicyNoCustomHeadersWithResponse(containerName, null, - finalRequestConditions.getLeaseId(), accessType, finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), null, finalIdentifiers, finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(response, timeout); } /** @@ -1053,42 +859,7 @@ public PagedIterable listBlobs(ListBlobsOptions options, Duration time */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBlobs(ListBlobsOptions options, String continuationToken, Duration timeout) { - BiFunction> retriever = (nextMarker, pageSize) -> { - ListBlobsOptions finalOptions = options == null ? new ListBlobsOptions() : options; - if (pageSize != null) { - finalOptions.setMaxResultsPerPage(pageSize); - } - ArrayList include = - finalOptions.getDetails().toList().isEmpty() ? null : finalOptions.getDetails().toList(); - - Supplier> operation = () -> { - ResponseBase response = - wrapServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().listBlobFlatSegmentWithResponse(containerName, - finalOptions.getPrefix(), nextMarker, finalOptions.getMaxResultsPerPage(), include, null, - null, Context.NONE)); - - List value = response.getValue().getSegment() == null ? Collections.emptyList() - : response.getValue().getSegment().getBlobItems().stream() - .map(ModelHelper::populateBlobItem) - .collect(Collectors.toList()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - response.getValue().getNextMarker(), - response.getDeserializedHeaders()); - }; - try { - return timeout != null ? CoreUtils.getResultWithTimeout(SharedExecutorService.getInstance() - .submit(operation::get), timeout) : operation.get(); - } catch (InterruptedException | ExecutionException | TimeoutException e) { - throw LOGGER.logExceptionAsError(new RuntimeException("Failed to retrieve blobs with timeout.", e)); - } - }; - return new PagedIterable<>(pageSize -> retriever.apply(continuationToken, pageSize), retriever); + return new PagedIterable<>(client.listBlobsFlatWithOptionalTimeout(options, continuationToken, timeout)); } /** @@ -1183,54 +954,8 @@ public PagedIterable listBlobsByHierarchy(String directory) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBlobsByHierarchy(String delimiter, ListBlobsOptions options, Duration timeout) { - BiFunction> func = (marker, pageSize) -> { - ListBlobsOptions finalOptions; - if (pageSize != null) { - if (options == null) { - finalOptions = new ListBlobsOptions().setMaxResultsPerPage(pageSize); - } else { - // Note that this prefers the value passed to .byPage(int) over the value on the options - finalOptions = new ListBlobsOptions() - .setMaxResultsPerPage(pageSize) - .setPrefix(options.getPrefix()) - .setDetails(options.getDetails()); - } - } else { - finalOptions = options == null ? new ListBlobsOptions() : options; - } - return listBlobsHierarchySegment(marker, delimiter, finalOptions, timeout); - }; - return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func); - } - - private PagedResponse listBlobsHierarchySegment(String marker, String delimiter, ListBlobsOptions options, - Duration timeout) { - if (options.getDetails().getRetrieveSnapshots()) { - throw LOGGER.logExceptionAsError( - new UnsupportedOperationException("Including snapshots in a hierarchical listing is not supported.")); - } - ArrayList include = options.getDetails().toList().isEmpty() ? null - : options.getDetails().toList(); - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> azureBlobStorage.getContainers().listBlobHierarchySegmentWithResponse(containerName, delimiter, - options.getPrefix(), marker, options.getMaxResultsPerPage(), include, null, null, Context.NONE)); - - ResponseBase response = - StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class); - - BlobHierarchyListSegment segment = response.getValue().getSegment(); - List value = new ArrayList<>(); - if (segment != null) { - segment.getBlobItems().forEach(item -> value.add(BlobItemConstructorProxy.create(item))); - segment.getBlobPrefixes().forEach(prefix -> value.add(new BlobItem() - .setName(ModelHelper.toBlobNameString(prefix.getName())) - .setIsPrefix(true))); - } - - return new PagedResponseBase<>( - response.getRequest(), response.getStatusCode(), response.getHeaders(), value, - response.getValue().getNextMarker(), response.getDeserializedHeaders()); + return new PagedIterable<>(client + .listBlobsHierarchyWithOptionalTimeout(delimiter, options, timeout)); } /** @@ -1278,40 +1003,7 @@ public PagedIterable findBlobsByTags(String query) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable findBlobsByTags(FindBlobsOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - BiFunction> func = (marker, pageSize) -> { - // Use pageSize if provided, otherwise use maxResultsPerPage from options - FindBlobsOptions finalOptions = (pageSize != null) - ? new FindBlobsOptions(options.getQuery()).setMaxResultsPerPage(pageSize) : options; - - return findBlobsByTagsHelper(finalOptions, marker, timeout, context); - }; - return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func); - } - - private PagedResponse findBlobsByTagsHelper( - FindBlobsOptions options, String marker, - Duration timeout, Context context) { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().filterBlobsWithResponse( - containerName, null, null, options.getQuery(), marker, - options.getMaxResultsPerPage(), null, context)); - - ResponseBase response = - StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class); - - List value = response.getValue().getBlobs().stream() - .map(ModelHelper::populateTaggedBlobItem) - .collect(Collectors.toList()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - response.getValue().getNextMarker(), - response.getDeserializedHeaders()); + return new PagedIterable<>(client.findBlobsByTags(options, timeout, context)); } /** @@ -1355,14 +1047,9 @@ public StorageAccountInfo getAccountInfo(Duration timeout) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAccountInfoWithResponse(Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getContainers().getAccountInfoWithResponse(containerName, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - ContainersGetAccountInfoHeaders hd = response.getDeserializedHeaders(); - return new SimpleResponse<>(response, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind())); + Mono> response = client.getAccountInfoWithResponse(context); + + return blockWithOptionalTimeout(response, timeout); } // TODO: Reintroduce this API once service starts supporting it. @@ -1407,8 +1094,7 @@ public Response getAccountInfoWithResponse(Duration timeout, */ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey) { - return generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, getAccountName(), - Context.NONE); + return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey); } /** @@ -1461,8 +1147,8 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic */ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, Consumer stringToSignHandler, Context context) { - return new BlobSasImplUtil(blobServiceSasSignatureValues, getBlobContainerName()) - .generateUserDelegationSas(userDelegationKey, accountName, stringToSignHandler, context); + return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, accountName, + stringToSignHandler, context); } /** @@ -1489,7 +1175,7 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic * @return A {@code String} representing the SAS query parameters. */ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues) { - return generateSas(blobServiceSasSignatureValues, Context.NONE); + return this.client.generateSas(blobServiceSasSignatureValues); } /** @@ -1535,8 +1221,7 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV */ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, Consumer stringToSignHandler, Context context) { - return new BlobSasImplUtil(blobServiceSasSignatureValues, getBlobContainerName()) - .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context); + return this.client.generateSas(blobServiceSasSignatureValues, stringToSignHandler, context); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java index 28c1f10752476..cd4f9e8f9b574 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java @@ -121,26 +121,7 @@ public BlobContainerClientBuilder() { * @throws IllegalStateException If multiple credentials have been specified. */ public BlobContainerClient buildClient() { - BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER); - - if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption " - + "scope cannot both be set")); - } - - /* - Implicit and explicit root container access are functionally equivalent, but explicit references are easier - to read and debug. - */ - String blobContainerName = CoreUtils.isNullOrEmpty(containerName) ? BlobContainerClient.ROOT_CONTAINER_NAME - : containerName; - - BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - - HttpPipeline pipeline = constructPipeline(); - - return new BlobContainerClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, - customerProvidedKey, encryptionScope, blobContainerEncryptionScope); + return new BlobContainerClient(buildAsyncClient()); } /** @@ -179,17 +160,13 @@ public BlobContainerAsyncClient buildAsyncClient() { BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - HttpPipeline pipeline = constructPipeline(); - - return new BlobContainerAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, - customerProvidedKey, encryptionScope, blobContainerEncryptionScope); - } - - private HttpPipeline constructPipeline() { - return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( + HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken, endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); + + return new BlobContainerAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, + customerProvidedKey, encryptionScope, blobContainerEncryptionScope); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java index cec9e88890e46..3842d2b3e6213 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java @@ -25,12 +25,15 @@ import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.BlobContainerEncryptionScope; import com.azure.storage.blob.models.BlobContainerItem; +import com.azure.storage.blob.models.BlobContainerListDetails; import com.azure.storage.blob.models.BlobCorsRule; +import com.azure.storage.blob.models.BlobRetentionPolicy; import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.BlobServiceStatistics; import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.KeyInfo; +import com.azure.storage.blob.models.ListBlobContainersIncludeType; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.StorageAccountInfo; @@ -176,22 +179,6 @@ public BlobServiceVersion getServiceVersion() { return serviceVersion; } - CpkInfo getCustomerProvidedKey() { - return customerProvidedKey; - } - - EncryptionScope getEncryptionScope() { - return encryptionScope; - } - - BlobContainerEncryptionScope getBlobContainerEncryptionScope() { - return blobContainerEncryptionScope; - } - - boolean isAnonymousAccess() { - return anonymousAccess; - } - /** * Creates a new container within a storage account. If a container with the same name already exists, the operation * fails. For more information, see the @@ -551,7 +538,7 @@ private Mono> listBlobContainersSegment(String return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getServices().listBlobContainersSegmentSinglePageAsync( options.getPrefix(), marker, options.getMaxResultsPerPage(), - ModelHelper.toIncludeTypes(options.getDetails()), + toIncludeTypes(options.getDetails()), null, null, Context.NONE), timeout); } @@ -641,6 +628,35 @@ private Mono> findBlobsByTags( }); } + /** + * Converts {@link BlobContainerListDetails} into list of {@link ListBlobContainersIncludeType} + * that contains only options selected. If no option is selected then null is returned. + * + * @return a list of selected options converted into {@link ListBlobContainersIncludeType}, null if none + * of options has been selected. + */ + private List toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { + boolean hasDetails = blobContainerListDetails != null + && (blobContainerListDetails.getRetrieveMetadata() + || blobContainerListDetails.getRetrieveDeleted() + || blobContainerListDetails.getRetrieveSystemContainers()); + if (hasDetails) { + List flags = new ArrayList<>(3); + if (blobContainerListDetails.getRetrieveDeleted()) { + flags.add(ListBlobContainersIncludeType.DELETED); + } + if (blobContainerListDetails.getRetrieveMetadata()) { + flags.add(ListBlobContainersIncludeType.METADATA); + } + if (blobContainerListDetails.getRetrieveSystemContainers()) { + flags.add(ListBlobContainersIncludeType.SYSTEM); + } + return flags; + } else { + return null; + } + } + /** * Gets the properties of a storage account’s Blob service. For more information, see the * Azure Docs. @@ -791,14 +807,14 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, finalProperties.setLogging(properties.getLogging()); if (finalProperties.getLogging() != null) { StorageImplUtils.assertNotNull("Logging Version", finalProperties.getLogging().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy"); + validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy"); } // Hour Metrics finalProperties.setHourMetrics(properties.getHourMetrics()); if (finalProperties.getHourMetrics() != null) { StorageImplUtils.assertNotNull("HourMetrics Version", finalProperties.getHourMetrics().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention " + validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention " + "Policy"); if (finalProperties.getHourMetrics().isEnabled()) { StorageImplUtils.assertNotNull("HourMetrics IncludeApis", @@ -811,7 +827,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, if (finalProperties.getMinuteMetrics() != null) { StorageImplUtils.assertNotNull("MinuteMetrics Version", finalProperties.getMinuteMetrics().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics " + validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics " + "Retention Policy"); if (finalProperties.getMinuteMetrics().isEnabled()) { StorageImplUtils.assertNotNull("MinuteMetrics IncludeApis", @@ -822,7 +838,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, // CORS List corsRules = new ArrayList<>(); for (BlobCorsRule rule : properties.getCors()) { - corsRules.add(ModelHelper.validatedCorsRule(rule)); + corsRules.add(validatedCorsRule(rule)); } finalProperties.setCors(corsRules); @@ -831,7 +847,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, // Delete Retention Policy finalProperties.setDeleteRetentionPolicy(properties.getDeleteRetentionPolicy()); - ModelHelper.validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days"); + validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days"); // Static Website finalProperties.setStaticWebsite(properties.getStaticWebsite()); @@ -843,6 +859,38 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties, .setPropertiesNoCustomHeadersWithResponseAsync(finalProperties, null, null, context); } + /** + * Sets any null fields to "" since the service requires all Cors rules to be set if some are set. + * @param originalRule {@link BlobCorsRule} + * @return The validated {@link BlobCorsRule} + */ + private BlobCorsRule validatedCorsRule(BlobCorsRule originalRule) { + if (originalRule == null) { + return null; + } + BlobCorsRule validRule = new BlobCorsRule(); + validRule.setAllowedHeaders(StorageImplUtils.emptyIfNull(originalRule.getAllowedHeaders())); + validRule.setAllowedMethods(StorageImplUtils.emptyIfNull(originalRule.getAllowedMethods())); + validRule.setAllowedOrigins(StorageImplUtils.emptyIfNull(originalRule.getAllowedOrigins())); + validRule.setExposedHeaders(StorageImplUtils.emptyIfNull(originalRule.getExposedHeaders())); + validRule.setMaxAgeInSeconds(originalRule.getMaxAgeInSeconds()); + return validRule; + } + + /** + * Validates a {@link BlobRetentionPolicy} according to service specs for set properties. + * @param retentionPolicy {@link BlobRetentionPolicy} + * @param policyName The name of the variable for errors. + */ + private void validateRetentionPolicy(BlobRetentionPolicy retentionPolicy, String policyName) { + if (retentionPolicy == null) { + return; + } + if (retentionPolicy.isEnabled()) { + StorageImplUtils.assertInBounds(policyName, retentionPolicy.getDays(), 1, 365); + } + } + /** * Gets a user delegation key for use with this account's blob storage. Note: This method call is only valid when * using {@link TokenCredential} in this object's {@link HttpPipeline}. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java index f6743e2815ae9..2c85fafd7d457 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java @@ -9,35 +9,12 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.storage.blob.implementation.AzureBlobStorageImpl; -import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder; -import com.azure.storage.blob.implementation.models.ContainersRestoreHeaders; -import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.models.FilterBlobSegment; -import com.azure.storage.blob.implementation.models.ServicesFilterBlobsHeaders; -import com.azure.storage.blob.implementation.models.ServicesGetAccountInfoHeaders; -import com.azure.storage.blob.implementation.models.ServicesGetPropertiesHeaders; -import com.azure.storage.blob.implementation.models.ServicesGetStatisticsHeaders; -import com.azure.storage.blob.implementation.models.ServicesGetUserDelegationKeyHeaders; -import com.azure.storage.blob.implementation.util.ModelHelper; -import com.azure.storage.blob.models.BlobContainerEncryptionScope; import com.azure.storage.blob.models.BlobContainerItem; -import com.azure.storage.blob.models.BlobContainerListDetails; -import com.azure.storage.blob.models.BlobCorsRule; import com.azure.storage.blob.models.BlobServiceProperties; import com.azure.storage.blob.models.BlobServiceStatistics; -import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.blob.models.CpkInfo; -import com.azure.storage.blob.models.KeyInfo; -import com.azure.storage.blob.models.ListBlobContainersIncludeType; import com.azure.storage.blob.models.ListBlobContainersOptions; import com.azure.storage.blob.models.PublicAccessType; import com.azure.storage.blob.models.StorageAccountInfo; @@ -47,24 +24,13 @@ import com.azure.storage.blob.options.FindBlobsOptions; import com.azure.storage.blob.options.UndeleteBlobContainerOptions; import com.azure.storage.common.StorageSharedKeyCredential; -import com.azure.storage.common.implementation.AccountSasImplUtil; -import com.azure.storage.common.implementation.Constants; -import com.azure.storage.common.implementation.SasImplUtils; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.sas.AccountSasSignatureValues; +import reactor.core.publisher.Mono; -import java.net.URI; import java.time.Duration; import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.List; import java.util.Map; -import java.util.concurrent.Callable; -import java.util.function.BiFunction; -import java.util.stream.Collectors; - -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; import java.util.function.Consumer; /** @@ -82,51 +48,15 @@ */ @ServiceClient(builder = BlobServiceClientBuilder.class) public final class BlobServiceClient { - private static final ClientLogger LOGGER = new ClientLogger(BlobServiceClient.class); - private final AzureBlobStorageImpl azureBlobStorage; - private final String accountName; - private final BlobServiceVersion serviceVersion; - private final CpkInfo customerProvidedKey; // only used to pass down to blob clients - private final EncryptionScope encryptionScope; // only used to pass down to blob clients - private final BlobContainerEncryptionScope blobContainerEncryptionScope; // only used to pass down to container - // clients - private final boolean anonymousAccess; + private final BlobServiceAsyncClient blobServiceAsyncClient; /** * Package-private constructor for use by {@link BlobServiceClientBuilder}. * - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param anonymousAccess Whether the client was built with anonymousAccess + * @param blobServiceAsyncClient the async storage account client */ - BlobServiceClient(HttpPipeline pipeline, String url, - BlobServiceVersion serviceVersion, String accountName, CpkInfo customerProvidedKey, EncryptionScope encryptionScope, - BlobContainerEncryptionScope blobContainerEncryptionScope, boolean anonymousAccess) { - /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer - when the sas token has already been applied. */ - try { - URI.create(url); - } catch (IllegalArgumentException ex) { - throw LOGGER.logExceptionAsError(ex); - } - this.azureBlobStorage = new AzureBlobStorageImplBuilder() - .pipeline(pipeline) - .url(url) - .version(serviceVersion.getVersion()) - .buildClient(); - this.serviceVersion = serviceVersion; - - this.accountName = accountName; - this.customerProvidedKey = customerProvidedKey; - this.encryptionScope = encryptionScope; - this.blobContainerEncryptionScope = blobContainerEncryptionScope; - this.anonymousAccess = anonymousAccess; + BlobServiceClient(BlobServiceAsyncClient blobServiceAsyncClient) { + this.blobServiceAsyncClient = blobServiceAsyncClient; } /** @@ -145,11 +75,7 @@ public final class BlobServiceClient { * @return A {@link BlobContainerClient} object pointing to the specified container */ public BlobContainerClient getBlobContainerClient(String containerName) { - if (CoreUtils.isNullOrEmpty(containerName)) { - containerName = BlobContainerAsyncClient.ROOT_CONTAINER_NAME; - } - return new BlobContainerClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(), - getAccountName(), containerName, customerProvidedKey, encryptionScope, blobContainerEncryptionScope); + return new BlobContainerClient(blobServiceAsyncClient.getBlobContainerAsyncClient(containerName)); } /** @@ -158,7 +84,7 @@ public BlobContainerClient getBlobContainerClient(String containerName) { * @return The pipeline. */ public HttpPipeline getHttpPipeline() { - return azureBlobStorage.getHttpPipeline(); + return blobServiceAsyncClient.getHttpPipeline(); } /** @@ -167,7 +93,7 @@ public HttpPipeline getHttpPipeline() { * @return the service version the client is using. */ public BlobServiceVersion getServiceVersion() { - return serviceVersion; + return this.blobServiceAsyncClient.getServiceVersion(); } /** @@ -321,7 +247,7 @@ public void deleteBlobContainer(String containerName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteBlobContainerWithResponse(String containerName, Context context) { - return getBlobContainerClient(containerName).deleteWithResponse(null, null, context); + return blobServiceAsyncClient.deleteBlobContainerWithResponse(containerName, context).block(); } /** @@ -373,7 +299,7 @@ public boolean deleteBlobContainerIfExists(String containerName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteBlobContainerIfExistsWithResponse(String containerName, Context context) { - return getBlobContainerClient(containerName).deleteIfExistsWithResponse(null, null, context); + return blobServiceAsyncClient.deleteBlobContainerIfExistsWithResponse(containerName, context).block(); } /** @@ -382,7 +308,7 @@ public Response deleteBlobContainerIfExistsWithResponse(String containe * @return the URL. */ public String getAccountUrl() { - return azureBlobStorage.getUrl(); + return blobServiceAsyncClient.getAccountUrl(); } /** @@ -430,26 +356,7 @@ public PagedIterable listBlobContainers() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBlobContainers(ListBlobContainersOptions options, Duration timeout) { - throwOnAnonymousAccess(); - BiFunction> pageRetriever = (marker, pageSize) -> { - ListBlobContainersOptions finalOptions = options != null ? options : new ListBlobContainersOptions(); - Integer finalPageSize = pageSize != null ? pageSize : finalOptions.getMaxResultsPerPage(); - return listBlobContainersSegment(marker, finalOptions.getDetails(), finalOptions.getPrefix(), finalPageSize, - timeout); - }; - return new PagedIterable<>(pageSize -> pageRetriever.apply(null, pageSize), pageRetriever); - - } - - private PagedResponse listBlobContainersSegment(String marker, BlobContainerListDetails details, - String prefix, Integer maxResultsPerPage, Duration timeout) { - // Set up the include types based on the details provided in the options - List include = ModelHelper.toIncludeTypes(details); - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().listBlobContainersSegmentSinglePage(prefix, marker, maxResultsPerPage, - include, null, null, Context.NONE)); - return sendRequest(operation, timeout, BlobStorageException.class); + return new PagedIterable<>(blobServiceAsyncClient.listBlobContainersWithOptionalTimeout(options, timeout)); } /** @@ -496,40 +403,7 @@ public PagedIterable findBlobsByTags(String query) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable findBlobsByTags(FindBlobsOptions options, Duration timeout, Context context) { - throwOnAnonymousAccess(); - StorageImplUtils.assertNotNull("options", options); - BiFunction> func = (marker, pageSize) -> { - FindBlobsOptions finalOptions = (pageSize != null) - ? new FindBlobsOptions(options.getQuery()).setMaxResultsPerPage(pageSize) : options; - return findBlobsByTagsHelper(finalOptions, marker, timeout, context); - }; - return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func); - } - - private PagedResponse findBlobsByTagsHelper(FindBlobsOptions options, String marker, - Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - - StorageImplUtils.assertNotNull("options", options); - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().filterBlobsWithResponse(null, null, options.getQuery(), marker, - options.getMaxResultsPerPage(), null, finalContext)); - - ResponseBase response = - StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class); - - List value = response.getValue().getBlobs().stream() - .map(ModelHelper::populateTaggedBlobItem) - .collect(Collectors.toList()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - response.getValue().getNextMarker(), - response.getDeserializedHeaders()); + return new PagedIterable<>(blobServiceAsyncClient.findBlobsByTags(options, timeout, context)); } /** @@ -578,15 +452,10 @@ public BlobServiceProperties getProperties() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - throwOnAnonymousAccess(); - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().getPropertiesWithResponse(null, null, finalContext)); - ResponseBase response = - StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getValue()); + Mono> response = blobServiceAsyncClient.getPropertiesWithResponse(context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -684,67 +553,9 @@ public void setProperties(BlobServiceProperties properties) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setPropertiesWithResponse(BlobServiceProperties properties, Duration timeout, Context context) { - throwOnAnonymousAccess(); - BlobServiceProperties finalProperties; - if (properties != null) { - finalProperties = new BlobServiceProperties(); - - // Logging - finalProperties.setLogging(properties.getLogging()); - if (finalProperties.getLogging() != null) { - StorageImplUtils.assertNotNull("Logging Version", finalProperties.getLogging().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy"); - } + Mono> response = blobServiceAsyncClient.setPropertiesWithResponse(properties, context); - // Hour Metrics - finalProperties.setHourMetrics(properties.getHourMetrics()); - if (finalProperties.getHourMetrics() != null) { - StorageImplUtils.assertNotNull("HourMetrics Version", finalProperties.getHourMetrics().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention " - + "Policy"); - if (finalProperties.getHourMetrics().isEnabled()) { - StorageImplUtils.assertNotNull("HourMetrics IncludeApis", - finalProperties.getHourMetrics().isIncludeApis()); - } - } - - // Minute Metrics - finalProperties.setMinuteMetrics(properties.getMinuteMetrics()); - if (finalProperties.getMinuteMetrics() != null) { - StorageImplUtils.assertNotNull("MinuteMetrics Version", - finalProperties.getMinuteMetrics().getVersion()); - ModelHelper.validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics " - + "Retention Policy"); - if (finalProperties.getMinuteMetrics().isEnabled()) { - StorageImplUtils.assertNotNull("MinuteMetrics IncludeApis", - finalProperties.getHourMetrics().isIncludeApis()); - } - } - - // CORS - List corsRules = new ArrayList<>(); - for (BlobCorsRule rule : properties.getCors()) { - corsRules.add(ModelHelper.validatedCorsRule(rule)); - } - finalProperties.setCors(corsRules); - - // Default Service Version - finalProperties.setDefaultServiceVersion(properties.getDefaultServiceVersion()); - - // Delete Retention Policy - finalProperties.setDeleteRetentionPolicy(properties.getDeleteRetentionPolicy()); - ModelHelper.validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days"); - - // Static Website - finalProperties.setStaticWebsite(properties.getStaticWebsite()); - } else { - finalProperties = null; - } - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().setPropertiesNoCustomHeadersWithResponse(finalProperties, null, null, - finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -791,21 +602,10 @@ public UserDelegationKey getUserDelegationKey(OffsetDateTime start, OffsetDateTi @ServiceMethod(returns = ReturnType.SINGLE) public Response getUserDelegationKeyWithResponse(OffsetDateTime start, OffsetDateTime expiry, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("expiry", expiry); - if (start != null && !start.isBefore(expiry)) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("`start` must be null or a datetime before `expiry`.")); - } - throwOnAnonymousAccess(); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().getUserDelegationKeyWithResponse(new KeyInfo() - .setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start)) - .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)), null, null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response, response.getValue()); + Mono> response = blobServiceAsyncClient.getUserDelegationKeyWithResponse(start, + expiry, context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -851,12 +651,9 @@ public BlobServiceStatistics getStatistics() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getStatisticsWithResponse(Duration timeout, Context context) { - throwOnAnonymousAccess(); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().getStatisticsWithResponse(null, null, finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = blobServiceAsyncClient.getStatisticsWithResponse(context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -890,16 +687,9 @@ public StorageAccountInfo getAccountInfo() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAccountInfoWithResponse(Duration timeout, Context context) { - throwOnAnonymousAccess(); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getServices().getAccountInfoWithResponse(finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - ServicesGetAccountInfoHeaders hd = response.getDeserializedHeaders(); - return new SimpleResponse<>(response, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind(), - hd.isXMsIsHnsEnabled())); + Mono> response = blobServiceAsyncClient.getAccountInfoWithResponse(context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -908,17 +698,7 @@ public Response getAccountInfoWithResponse(Duration timeout, * @return account name associated with this storage resource. */ public String getAccountName() { - return this.accountName; - } - - /** - * Checks if service client was built with credentials. - */ - private void throwOnAnonymousAccess() { - if (anonymousAccess) { - throw LOGGER.logExceptionAsError(new IllegalStateException("Service client cannot be accessed without " - + "credentials")); - } + return this.blobServiceAsyncClient.getAccountName(); } /** @@ -951,7 +731,7 @@ private void throwOnAnonymousAccess() { * @return A {@code String} representing the SAS query parameters. */ public String generateAccountSas(AccountSasSignatureValues accountSasSignatureValues) { - return generateAccountSas(accountSasSignatureValues, Context.NONE); + return this.blobServiceAsyncClient.generateAccountSas(accountSasSignatureValues); } /* TODO(gapra): REST Docs*/ @@ -1003,10 +783,7 @@ public String generateAccountSas(AccountSasSignatureValues accountSasSignatureVa */ public String generateAccountSas(AccountSasSignatureValues accountSasSignatureValues, Consumer stringToSignHandler, Context context) { - throwOnAnonymousAccess(); - return new AccountSasImplUtil(accountSasSignatureValues, - this.encryptionScope == null ? null : this.encryptionScope.getEncryptionScope()) - .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context); + return this.blobServiceAsyncClient.generateAccountSas(accountSasSignatureValues, stringToSignHandler, context); } /** @@ -1074,21 +851,13 @@ public BlobContainerClient undeleteBlobContainer(String deletedContainerName, St * to interact with the restored container. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response undeleteBlobContainerWithResponse(UndeleteBlobContainerOptions options, - Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - boolean hasOptionalDestinationContainerName = options.getDestinationContainerName() != null; - String finalDestinationContainerName = - hasOptionalDestinationContainerName ? options.getDestinationContainerName() - : options.getDeletedContainerName(); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getContainers().restoreWithResponse(finalDestinationContainerName, null, null, - options.getDeletedContainerName(), options.getDeletedContainerVersion(), finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response, getBlobContainerClient(finalDestinationContainerName)); + public Response undeleteBlobContainerWithResponse( + UndeleteBlobContainerOptions options, Duration timeout, Context context) { + Mono> response = + this.blobServiceAsyncClient.undeleteBlobContainerWithResponse(options, context) + .map(r -> new SimpleResponse<>(r, getBlobContainerClient(r.getValue().getBlobContainerName()))); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } // /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java index 663ad41d0cbe0..226f3b6dc903d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java @@ -96,7 +96,6 @@ public final class BlobServiceClientBuilder implements private Configuration configuration; private BlobServiceVersion version; private BlobAudience audience; - private boolean anonymousAccess; /** * Creates a builder instance that is able to configure and construct {@link BlobServiceClient BlobServiceClients} @@ -114,44 +113,7 @@ public BlobServiceClientBuilder() { * and {@link #retryOptions(RequestRetryOptions)} have been set. */ public BlobServiceClient buildClient() { - BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER); - - anonymousAccess = false; - - if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption " - + "scope cannot both be set")); - } - - BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - HttpPipeline pipeline = constructPipeline(); - - boolean foundCredential = false; - for (int i = 0; i < pipeline.getPolicyCount(); i++) { - if (pipeline.getPolicy(i) instanceof StorageSharedKeyCredentialPolicy) { - foundCredential = true; - break; - } - if (pipeline.getPolicy(i) instanceof BearerTokenAuthenticationPolicy) { - foundCredential = true; - break; - } - if (pipeline.getPolicy(i) instanceof AzureSasCredentialPolicy) { - foundCredential = true; - break; - } - } - anonymousAccess = !foundCredential; - - return new BlobServiceClient(pipeline, endpoint, serviceVersion, accountName, customerProvidedKey, - encryptionScope, blobContainerEncryptionScope, anonymousAccess); - } - - private HttpPipeline constructPipeline() { - return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( - storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken, - endpoint, retryOptions, coreRetryOptions, logOptions, - clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); + return new BlobServiceClient(buildAsyncClient()); } /** @@ -164,7 +126,7 @@ private HttpPipeline constructPipeline() { public BlobServiceAsyncClient buildAsyncClient() { BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER); - anonymousAccess = false; + boolean anonymousAccess = false; if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) { throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption " @@ -172,7 +134,10 @@ public BlobServiceAsyncClient buildAsyncClient() { } BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); - HttpPipeline pipeline = constructPipeline(); + HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( + storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken, + endpoint, retryOptions, coreRetryOptions, logOptions, + clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); boolean foundCredential = false; for (int i = 0; i < pipeline.getPolicyCount(); i++) { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java index eefcbfced4a74..70bcd8fc25ce2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java @@ -128,60 +128,6 @@ Mono> createNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -274,52 +220,6 @@ Mono> appendBlockNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase appendBlockSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response appendBlockNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -378,64 +278,6 @@ Mono> appendBlockFromUrlNoCustomHeaders(@HostParam("url") String @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase appendBlockFromUrlSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-source") String sourceUrl, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response appendBlockFromUrlNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-source") String sourceUrl, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -463,34 +305,6 @@ Mono> sealNoCustomHeaders(@HostParam("url") String url, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase sealSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response sealNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept, - Context context); } /** @@ -1047,21 +861,28 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai } /** - * The Create Append Blob operation creates a new append blob. + * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block + * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is + * supported only on version 2015-02-21 version or later. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. + * @param body Initial data. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append + * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value + * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - + * Precondition Failed). + * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating + * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it + * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition + * Failed). * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -1071,58 +892,21 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String containerName, String blob, - long contentLength, Integer timeout, Map metadata, String leaseId, + public Mono> appendBlockWithResponseAsync(String containerName, + String blob, long contentLength, Flux body, Integer timeout, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "AppendBlob"; + String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + final String comp = "appendblock"; final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; String encryptionKeyInternal = null; if (cpkInfo != null) { encryptionKeyInternal = cpkInfo.getEncryptionKey(); @@ -1143,257 +927,8 @@ public ResponseBase createWithResponse(String co encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.createSync(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, - contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Create Append Blob operation creates a new append blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String containerName, String blob, long contentLength, Integer timeout, - Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - createWithResponse(containerName, blob, contentLength, timeout, metadata, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, - immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Create Append Blob operation creates a new append blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "AppendBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.createNoCustomHeadersSync(this.client.getUrl(), containerName, blob, blobType, timeout, - contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, - metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block - * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is - * supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> appendBlockWithResponseAsync(String containerName, - String blob, long contentLength, Flux body, Integer timeout, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "appendblock"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted @@ -2194,19 +1729,22 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c } /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block - * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is - * supported only on version 2015-02-21 version or later. + * The Append Block operation commits a new block of data to the end of an existing append blob where the contents + * are read from a source url. The Append Block operation is permitted only if the blob was created with + * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. * * @param containerName The container name. * @param blob The blob name. + * @param sourceUrl Specify a URL to the copy source. * @param contentLength The length of the request. - * @param body Initial data. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy + * source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value @@ -2223,243 +1761,22 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since + * the specified date/time. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase appendBlockWithResponse(String containerName, String blob, - long contentLength, BinaryData body, Integer timeout, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "appendblock"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.appendBlockSync(this.client.getUrl(), containerName, blob, comp, timeout, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block - * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is - * supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void appendBlock(String containerName, String blob, long contentLength, BinaryData body, Integer timeout, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String leaseId, Long maxSize, - Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - appendBlockWithResponse(containerName, blob, contentLength, body, timeout, transactionalContentMD5, - transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block - * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is - * supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response appendBlockNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - BinaryData body, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "appendblock"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.appendBlockNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, - appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob where the contents - * are read from a source url. The Append Block operation is permitted only if the blob was created with - * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> appendBlockFromUrlWithResponseAsync( @@ -2952,311 +2269,37 @@ public Mono> appendBlockFromUrlNoCustomHeadersWithResponseAsync(S } /** - * The Append Block operation commits a new block of data to the end of an existing append blob where the contents - * are read from a source url. The Append Block operation is permitted only if the blob was created with - * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. + * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 + * version or later. * * @param containerName The container name. * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since * the specified date/time. * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. + * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating + * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it + * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition + * Failed). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase appendBlockFromUrlWithResponse(String containerName, - String blob, String sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, byte[] transactionalContentMD5, String leaseId, Long maxSize, - Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "appendblock"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.appendBlockFromUrlSync(this.client.getUrl(), containerName, blob, comp, sourceUrl, - sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, - transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob where the contents - * are read from a source url. The Append Block operation is permitted only if the blob was created with - * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void appendBlockFromUrl(String containerName, String blob, String sourceUrl, long contentLength, - String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, - byte[] transactionalContentMD5, String leaseId, Long maxSize, Long appendPosition, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - appendBlockFromUrlWithResponse(containerName, blob, sourceUrl, contentLength, sourceRange, sourceContentMD5, - sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize, appendPosition, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, - sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam, - Context.NONE); - } - - /** - * The Append Block operation commits a new block of data to the end of an existing append blob where the contents - * are read from a source url. The Append Block operation is permitted only if the blob was created with - * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param contentLength The length of the request. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append - * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value - * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - - * Precondition Failed). - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response appendBlockFromUrlNoCustomHeadersWithResponse(String containerName, String blob, - String sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, - Integer timeout, byte[] transactionalContentMD5, String leaseId, Long maxSize, Long appendPosition, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "appendblock"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.appendBlockFromUrlNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, - transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 - * version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> sealWithResponseAsync(String containerName, String blob, - Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition) { - final String comp = "seal"; + public Mono> sealWithResponseAsync(String containerName, String blob, + Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition) { + final String comp = "seal"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); @@ -3477,132 +2520,4 @@ public Mono> sealNoCustomHeadersWithResponseAsync(String containe appendPosition, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 - * version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase sealWithResponse(String containerName, String blob, - Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition, Context context) { - final String comp = "seal"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.sealSync(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), - requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - appendPosition, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 - * version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void seal(String containerName, String blob, Integer timeout, String requestId, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - Long appendPosition) { - sealWithResponse(containerName, blob, timeout, requestId, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, appendPosition, Context.NONE); - } - - /** - * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 - * version or later. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating - * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it - * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition - * Failed). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response sealNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - String requestId, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, Long appendPosition, Context context) { - final String comp = "seal"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.sealNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, appendPosition, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index 7e9b7354bc7d3..c5770824b839e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -65,7 +65,6 @@ import com.azure.storage.blob.models.DeleteSnapshotsOptionType; import com.azure.storage.blob.models.EncryptionAlgorithmType; import com.azure.storage.blob.models.RehydratePriority; -import java.io.InputStream; import java.nio.ByteBuffer; import java.time.OffsetDateTime; import java.util.Map; @@ -146,46 +145,6 @@ Mono downloadNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase downloadSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-range-get-content-crc64") Boolean rangeGetContentCRC64, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response downloadNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-range-get-content-crc64") Boolean rangeGetContentCRC64, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Head("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -220,40 +179,6 @@ Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Head("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Head("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Delete("/{containerName}/{blob}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -286,38 +211,6 @@ Mono> deleteNoCustomHeaders(@HostParam("url") String url, @QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept, Context context); - @Delete("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept, - Context context); - - @Delete("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -336,24 +229,6 @@ Mono> undeleteNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase undeleteSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response undeleteNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -374,26 +249,6 @@ Mono> setExpiryNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions, @HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setExpirySync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions, - @HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setExpiryNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions, - @HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -434,46 +289,6 @@ Mono> setHttpHeadersNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setHttpHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setHttpHeadersNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -498,30 +313,6 @@ Mono> setImmutabilityPolicyNoCustomHeaders(@HostParam("url") Stri @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setImmutabilityPolicySync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setImmutabilityPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("Accept") String accept, Context context); - @Delete("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -540,24 +331,6 @@ Mono> deleteImmutabilityPolicyNoCustomHeaders(@HostParam("url") S @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Delete("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase deleteImmutabilityPolicySync( - @HostParam("url") String url, @PathParam("containerName") String containerName, - @PathParam("blob") String blob, @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response deleteImmutabilityPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -576,24 +349,6 @@ Mono> setLegalHoldNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setLegalHoldSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setLegalHoldNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -631,16 +386,13 @@ Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, Context context); @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, + Mono> acquireLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, + @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, + @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, + @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @@ -649,16 +401,13 @@ ResponseBase setMetadataSync(@HostParam("url") St Context context); @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, + Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, + @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, + @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, + @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @@ -667,69 +416,9 @@ Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, Context context); @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> acquireLease(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase acquireLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> releaseLease(@HostParam("url") String url, + Mono> releaseLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @@ -754,34 +443,6 @@ Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase releaseLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response releaseLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -810,34 +471,6 @@ Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase renewLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response renewLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -868,36 +501,6 @@ Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase changeLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response changeLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -926,34 +529,6 @@ Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase breakLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response breakLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -990,42 +565,6 @@ Mono> createSnapshotNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase createSnapshotSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response createSnapshotNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1074,54 +613,6 @@ Mono> startCopyFromURLNoCustomHeaders(@HostParam("url") String ur @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase startCopyFromURLSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-source-if-tags") String sourceIfTags, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-seal-blob") Boolean sealBlob, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response startCopyFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-source-if-tags") String sourceIfTags, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-seal-blob") Boolean sealBlob, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1177,63 +668,9 @@ Mono> copyFromURLNoCustomHeaders(@HostParam("url") String url, @HeaderParam("Accept") String accept, Context context); @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase copyFromURLSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response copyFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> abortCopyFromURL(@HostParam("url") String url, + Mono> abortCopyFromURL(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout, @@ -1252,28 +689,6 @@ Mono> abortCopyFromURLNoCustomHeaders(@HostParam("url") String ur @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase abortCopyFromURLSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response abortCopyFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1300,32 +715,6 @@ Mono> setTierNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setTierSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setTierNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1342,22 +731,6 @@ Mono> getAccountInfoNoCustomHeaders(@HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getAccountInfoSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getAccountInfoNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - @Post("/{containerName}/{blob}") @ExpectedResponses({ 200, 206 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1394,42 +767,6 @@ Mono queryNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept, Context context); - @Post("/{containerName}/{blob}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase querySync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept, - Context context); - - @Post("/{containerName}/{blob}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response queryNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept, - Context context); - @Get("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1452,28 +789,6 @@ Mono> getTagsNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getTagsSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getTagsNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -1499,32 +814,6 @@ Mono> setTagsNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setTagsSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, - @QueryParam("timeout") Integer timeout, @QueryParam("versionid") String versionId, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setTagsNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, - @QueryParam("timeout") Integer timeout, @QueryParam("versionid") String versionId, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags, - @HeaderParam("Accept") String accept, Context context); } /** @@ -1904,8 +1193,8 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String cont } /** - * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can - * also call Download to read a snapshot or version. + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties + * for the blob. It does not return the content of the blob. * * @param containerName The container name. * @param blob The blob name. @@ -1918,12 +1207,7 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String cont * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5 - * hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64 - * hash for the range, as long as the range is less than or equal to 4 MB in size. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -1934,17 +1218,16 @@ public Mono downloadNoCustomHeadersWithResponseAsync(String cont * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase downloadWithResponse(String containerName, String blob, - String snapshot, String versionId, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, - Boolean rangeGetContentCRC64, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, Context context) { + public Mono> getPropertiesWithResponseAsync(String containerName, + String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + CpkInfo cpkInfo) { final String accept = "application/xml"; String encryptionKeyInternal = null; if (cpkInfo != null) { @@ -1965,19 +1248,17 @@ public ResponseBase downloadWithResponse(Stri = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.downloadSync(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, range, - leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), containerName, blob, snapshot, + versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can - * also call Download to read a snapshot or version. + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties + * for the blob. It does not return the content of the blob. * * @param containerName The container name. * @param blob The blob name. @@ -1990,12 +1271,7 @@ public ResponseBase downloadWithResponse(Stri * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5 - * hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64 - * hash for the range, as long as the range is less than or equal to 4 MB in size. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -2006,229 +1282,48 @@ public ResponseBase downloadWithResponse(Stri * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. * @param cpkInfo Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream download(String containerName, String blob, String snapshot, String versionId, Integer timeout, - String range, String leaseId, Boolean rangeGetContentMD5, Boolean rangeGetContentCRC64, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo) { - try { - return downloadWithResponse(containerName, blob, snapshot, versionId, timeout, range, leaseId, - rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); + public Mono> getPropertiesWithResponseAsync(String containerName, + String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + CpkInfo cpkInfo, Context context) { + final String accept = "application/xml"; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .getProperties(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can - * also call Download to read a snapshot or version. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5 - * hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64 - * hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadNoCustomHeadersWithResponse(String containerName, String blob, String snapshot, - String versionId, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, - Boolean rangeGetContentCRC64, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, Context context) { - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.downloadNoCustomHeadersSync(this.client.getUrl(), containerName, blob, snapshot, versionId, - timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, - encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String containerName, - String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo) { - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.getProperties(this.client.getUrl(), containerName, blob, snapshot, - versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String containerName, - String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, Context context) { - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .getProperties(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties + * for the blob. It does not return the content of the blob. * * @param containerName The container name. * @param blob The blob name. @@ -2439,8 +1534,21 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String } /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. + * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed + * from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, + * it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or + * snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] + * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently + * removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until + * it is permanently removed. Use the List Blobs API and specify the "include=deleted" query parameter to discover + * which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a + * soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP + * status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when + * a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other + * operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access + * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob + * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC + * permissions. * * @param containerName The container name. * @param blob The blob name. @@ -2454,6 +1562,9 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param deleteSnapshots Required if the blob has associated snapshots. Specify one of the following two options: + * include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob + * itself. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -2463,216 +1574,28 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. + * @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob + * if blob soft delete is enabled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String containerName, String blob, - String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, Context context) { + public Mono> deleteWithResponseAsync(String containerName, String blob, + String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, BlobDeleteType blobDeleteType) { final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPropertiesSync(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String containerName, String blob, String snapshot, String versionId, Integer timeout, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo) { - getPropertiesWithResponse(containerName, blob, snapshot, versionId, timeout, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, Context.NONE); - } - - /** - * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties - * for the blob. It does not return the content of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String containerName, String blob, String snapshot, - String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, Context context) { - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), containerName, blob, snapshot, - versionId, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed - * from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, - * it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or - * snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently - * removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until - * it is permanently removed. Use the List Blobs API and specify the "include=deleted" query parameter to discover - * which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a - * soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP - * status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when - * a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other - * operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access - * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob - * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC - * permissions. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param deleteSnapshots Required if the blob has associated snapshots. Specify one of the following two options: - * include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob - * itself. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob - * if blob soft delete is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String containerName, String blob, - String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, BlobDeleteType blobDeleteType) { - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.delete(this.client.getUrl(), containerName, blob, snapshot, versionId, - timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), containerName, blob, snapshot, versionId, + timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -2992,248 +1915,56 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai } /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed - * from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, - * it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or - * snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently - * removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until - * it is permanently removed. Use the List Blobs API and specify the "include=deleted" query parameter to discover - * which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a - * soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP - * status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when - * a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other - * operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access - * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob - * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC - * permissions. + * Undelete a blob that was previously soft deleted. * * @param containerName The container name. * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param deleteSnapshots Required if the blob has associated snapshots. Specify one of the following two options: - * include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob - * itself. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob - * if blob soft delete is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String containerName, String blob, String snapshot, - String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, BlobDeleteType blobDeleteType, Context context) { + public Mono> undeleteWithResponseAsync(String containerName, String blob, + Integer timeout, String requestId) { + final String comp = "undelete"; final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.deleteSync(this.client.getUrl(), containerName, blob, snapshot, versionId, timeout, leaseId, - deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobDeleteType, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.undelete(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed - * from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, - * it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or - * snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently - * removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until - * it is permanently removed. Use the List Blobs API and specify the "include=deleted" query parameter to discover - * which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a - * soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP - * status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when - * a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other - * operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access - * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob - * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC - * permissions. + * Undelete a blob that was previously soft deleted. * * @param containerName The container name. * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param deleteSnapshots Required if the blob has associated snapshots. Specify one of the following two options: - * include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob - * itself. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob - * if blob soft delete is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String containerName, String blob, String snapshot, String versionId, Integer timeout, - String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - BlobDeleteType blobDeleteType) { - deleteWithResponse(containerName, blob, snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobDeleteType, Context.NONE); - } - - /** - * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed - * from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, - * it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or - * snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] - * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently - * removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until - * it is permanently removed. Use the List Blobs API and specify the "include=deleted" query parameter to discover - * which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a - * soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP - * status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when - * a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other - * operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access - * automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob - * API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC - * permissions. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param deleteSnapshots Required if the blob has associated snapshots. Specify one of the following two options: - * include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob - * itself. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobDeleteType Optional. Only possible value is 'permanent', which specifies to permanently delete a blob - * if blob soft delete is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String containerName, String blob, String snapshot, - String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, BlobDeleteType blobDeleteType, Context context) { - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.deleteNoCustomHeadersSync(this.client.getUrl(), containerName, blob, snapshot, versionId, - timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, blobDeleteType, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Undelete a blob that was previously soft deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> undeleteWithResponseAsync(String containerName, String blob, - Integer timeout, String requestId) { - final String comp = "undelete"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.undelete(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Undelete a blob that was previously soft deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> undeleteWithResponseAsync(String containerName, String blob, - Integer timeout, String requestId, Context context) { - final String comp = "undelete"; - final String accept = "application/xml"; - return service - .undelete(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono> undeleteWithResponseAsync(String containerName, String blob, + Integer timeout, String requestId, Context context) { + final String comp = "undelete"; + final String accept = "application/xml"; + return service + .undelete(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3335,83 +2066,6 @@ public Mono> undeleteNoCustomHeadersWithResponseAsync(String cont .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Undelete a blob that was previously soft deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase undeleteWithResponse(String containerName, String blob, - Integer timeout, String requestId, Context context) { - final String comp = "undelete"; - final String accept = "application/xml"; - try { - return service.undeleteSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Undelete a blob that was previously soft deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void undelete(String containerName, String blob, Integer timeout, String requestId) { - undeleteWithResponse(containerName, blob, timeout, requestId, Context.NONE); - } - - /** - * Undelete a blob that was previously soft deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response undeleteNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - String requestId, Context context) { - final String comp = "undelete"; - final String accept = "application/xml"; - try { - return service.undeleteNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * Sets the time a blob will expire and be deleted. * @@ -3577,90 +2231,6 @@ public Mono> setExpiryNoCustomHeadersWithResponseAsync(String con .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Sets the time a blob will expire and be deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param expiryOptions Required. Indicates mode of the expiry time. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param expiresOn The time to set the blob to expiry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setExpiryWithResponse(String containerName, String blob, - BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { - final String comp = "expiry"; - final String accept = "application/xml"; - try { - return service.setExpirySync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Sets the time a blob will expire and be deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param expiryOptions Required. Indicates mode of the expiry time. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param expiresOn The time to set the blob to expiry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setExpiry(String containerName, String blob, BlobExpiryOptions expiryOptions, Integer timeout, - String requestId, String expiresOn) { - setExpiryWithResponse(containerName, blob, expiryOptions, timeout, requestId, expiresOn, Context.NONE); - } - - /** - * Sets the time a blob will expire and be deleted. - * - * @param containerName The container name. - * @param blob The blob name. - * @param expiryOptions Required. Indicates mode of the expiry time. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param expiresOn The time to set the blob to expiry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setExpiryNoCustomHeadersWithResponse(String containerName, String blob, - BlobExpiryOptions expiryOptions, Integer timeout, String requestId, String expiresOn, Context context) { - final String comp = "expiry"; - final String accept = "application/xml"; - try { - return service.setExpiryNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, expiryOptions, expiresOn, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Set HTTP Headers operation sets system properties on the blob. * @@ -4027,207 +2597,23 @@ public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(Strin } /** - * The Set HTTP Headers operation sets system properties on the blob. + * The Set Immutability Policy operation sets the immutability policy on the blob. * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobHttpHeaders Parameter group. - * @param context The context to associate with this operation. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. + * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setHttpHeadersWithResponse(String containerName, String blob, - Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, BlobHttpHeaders blobHttpHeaders, - Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.setHttpHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, - contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set HTTP Headers operation sets system properties on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobHttpHeaders Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setHttpHeaders(String containerName, String blob, Integer timeout, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, BlobHttpHeaders blobHttpHeaders) { - setHttpHeadersWithResponse(containerName, blob, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, blobHttpHeaders, Context.NONE); - } - - /** - * The Set HTTP Headers operation sets system properties on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobHttpHeaders Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setHttpHeadersNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, BlobHttpHeaders blobHttpHeaders, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.setHttpHeadersNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, contentDisposition, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set Immutability Policy operation sets the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setImmutabilityPolicyWithResponseAsync( @@ -4415,110 +2801,6 @@ public Mono> setImmutabilityPolicyNoCustomHeadersWithResponseAsyn .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Set Immutability Policy operation sets the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setImmutabilityPolicyWithResponse(String containerName, - String blob, Integer timeout, String requestId, OffsetDateTime ifUnmodifiedSince, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Context context) { - final String comp = "immutabilityPolicies"; - final String accept = "application/xml"; - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.setImmutabilityPolicySync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set Immutability Policy operation sets the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setImmutabilityPolicy(String containerName, String blob, Integer timeout, String requestId, - OffsetDateTime ifUnmodifiedSince, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode) { - setImmutabilityPolicyWithResponse(containerName, blob, timeout, requestId, ifUnmodifiedSince, - immutabilityPolicyExpiry, immutabilityPolicyMode, Context.NONE); - } - - /** - * The Set Immutability Policy operation sets the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setImmutabilityPolicyNoCustomHeadersWithResponse(String containerName, String blob, - Integer timeout, String requestId, OffsetDateTime ifUnmodifiedSince, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Context context) { - final String comp = "immutabilityPolicies"; - final String accept = "application/xml"; - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.setImmutabilityPolicyNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - timeout, this.client.getVersion(), requestId, ifUnmodifiedSinceConverted, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Delete Immutability Policy operation deletes the immutability policy on the blob. * @@ -4673,107 +2955,30 @@ public Mono> deleteImmutabilityPolicyNoCustomHeadersWithResponseA } /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob. + * The Set Legal Hold operation sets a legal hold on the blob. * * @param containerName The container name. * @param blob The blob name. + * @param legalHold Specified if a legal hold should be set on the blob. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteImmutabilityPolicyWithResponse( - String containerName, String blob, Integer timeout, String requestId, Context context) { - final String comp = "immutabilityPolicies"; + public Mono> setLegalHoldWithResponseAsync(String containerName, + String blob, boolean legalHold, Integer timeout, String requestId) { + final String comp = "legalhold"; final String accept = "application/xml"; - try { - return service.deleteImmutabilityPolicySync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteImmutabilityPolicy(String containerName, String blob, Integer timeout, String requestId) { - deleteImmutabilityPolicyWithResponse(containerName, blob, timeout, requestId, Context.NONE); - } - - /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteImmutabilityPolicyNoCustomHeadersWithResponse(String containerName, String blob, - Integer timeout, String requestId, Context context) { - final String comp = "immutabilityPolicies"; - final String accept = "application/xml"; - try { - return service.deleteImmutabilityPolicyNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - timeout, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setLegalHoldWithResponseAsync(String containerName, - String blob, boolean legalHold, Integer timeout, String requestId) { - final String comp = "legalhold"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.setLegalHold(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, legalHold, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + return FluxUtil + .withContext(context -> service.setLegalHold(this.client.getUrl(), containerName, blob, comp, timeout, + this.client.getVersion(), requestId, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4908,86 +3113,6 @@ public Mono> setLegalHoldNoCustomHeadersWithResponseAsync(String .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setLegalHoldWithResponse(String containerName, String blob, - boolean legalHold, Integer timeout, String requestId, Context context) { - final String comp = "legalhold"; - final String accept = "application/xml"; - try { - return service.setLegalHoldSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setLegalHold(String containerName, String blob, boolean legalHold, Integer timeout, String requestId) { - setLegalHoldWithResponse(containerName, blob, legalHold, timeout, requestId, Context.NONE); - } - - /** - * The Set Legal Hold operation sets a legal hold on the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setLegalHoldNoCustomHeadersWithResponse(String containerName, String blob, boolean legalHold, - Integer timeout, String requestId, Context context) { - final String comp = "legalhold"; - final String accept = "application/xml"; - try { - return service.setLegalHoldNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value * pairs. @@ -5361,21 +3486,19 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c } /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value - * pairs. + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never + * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or + * change. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5385,71 +3508,43 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String containerName, String blob, - Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "metadata"; + public Mono> acquireLeaseWithResponseAsync(String containerName, + String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + final String comp = "lease"; + final String action = "acquire"; final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.setMetadataSync(this.client.getUrl(), containerName, blob, comp, timeout, metadata, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value - * pairs. + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never + * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or + * change. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5459,36 +3554,45 @@ public ResponseBase setMetadataWithResponse(Strin * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String containerName, String blob, Integer timeout, Map metadata, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - setMetadataWithResponse(containerName, blob, timeout, metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE); + public Mono> acquireLeaseWithResponseAsync(String containerName, + String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + Context context) { + final String comp = "lease"; + final String action = "acquire"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .acquireLease(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, proposedLeaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value - * pairs. + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. * * @param containerName The container name. * @param blob The blob name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never + * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or + * change. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5498,53 +3602,19 @@ public void setMetadata(String containerName, String blob, Integer timeout, Map< * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - metadata, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono acquireLeaseAsync(String containerName, String blob, Integer timeout, Integer duration, + String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId) { + return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5570,27 +3640,20 @@ public Response setMetadataNoCustomHeadersWithResponse(String containerNam * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseWithResponseAsync(String containerName, - String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.acquireLease(this.client.getUrl(), containerName, blob, comp, action, - timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono acquireLeaseAsync(String containerName, String blob, Integer timeout, Integer duration, + String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, Context context) { + return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5616,17 +3679,15 @@ public Mono> acquireLeaseWithRespon * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseWithResponseAsync(String containerName, - String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { + public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; final String action = "acquire"; final String accept = "application/xml"; @@ -5634,10 +3695,10 @@ public Mono> acquireLeaseWithRespon = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .acquireLease(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, proposedLeaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context) + return FluxUtil + .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5664,19 +3725,29 @@ public Mono> acquireLeaseWithRespon * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String containerName, String blob, Integer timeout, Integer duration, - String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId) { - return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + Context context) { + final String comp = "lease"; + final String action = "acquire"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5684,15 +3755,10 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5702,20 +3768,27 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String containerName, String blob, Integer timeout, Integer duration, - String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, Context context) { - return acquireLeaseWithResponseAsync(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono> releaseLeaseWithResponseAsync(String containerName, + String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + final String comp = "lease"; + final String action = "release"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5723,15 +3796,10 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5741,26 +3809,27 @@ public Mono acquireLeaseAsync(String containerName, String blob, Integer t * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + public Mono> releaseLeaseWithResponseAsync(String containerName, + String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "acquire"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - action, timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + return service + .releaseLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5769,15 +3838,10 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5787,29 +3851,19 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono releaseLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId) { + return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + ifMatch, ifNoneMatch, ifTags, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5817,15 +3871,10 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5839,27 +3888,16 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase acquireLeaseWithResponse(String containerName, String blob, - Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.acquireLeaseSync(this.client.getUrl(), containerName, blob, comp, action, timeout, duration, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono releaseLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, Context context) { + return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + ifMatch, ifNoneMatch, ifTags, requestId, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5867,15 +3905,10 @@ public ResponseBase acquireLeaseWithResponse(Str * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5888,13 +3921,24 @@ public ResponseBase acquireLeaseWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void acquireLease(String containerName, String blob, Integer timeout, Integer duration, - String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId) { - acquireLeaseWithResponse(containerName, blob, timeout, duration, proposedLeaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, Context.NONE); + public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + final String comp = "lease"; + final String action = "release"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5902,15 +3946,10 @@ public void acquireLease(String containerName, String blob, Integer timeout, Int * * @param containerName The container name. * @param blob The blob name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -5924,26 +3963,24 @@ public void acquireLease(String containerName, String blob, Integer timeout, Int * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response acquireLeaseNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "acquire"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, action, - timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5970,19 +4007,19 @@ public Response acquireLeaseNoCustomHeadersWithResponse(String containerNa * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String containerName, + public Mono> renewLeaseWithResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "release"; + final String action = "renew"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, blob, comp, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + .withContext(context -> service.renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6012,18 +4049,18 @@ public Mono> releaseLeaseWithRespon * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String containerName, + public Mono> renewLeaseWithResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "release"; + final String action = "renew"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .releaseLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + .renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -6053,10 +4090,10 @@ public Mono> releaseLeaseWithRespon * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, + public Mono renewLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { - return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); @@ -6087,10 +4124,10 @@ public Mono releaseLeaseAsync(String containerName, String blob, String le * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, + public Mono renewLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - return releaseLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); @@ -6120,18 +4157,18 @@ public Mono releaseLeaseAsync(String containerName, String blob, String le * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "release"; + final String action = "renew"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -6162,18 +4199,18 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "release"; + final String action = "renew"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -6185,124 +4222,9 @@ public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase releaseLeaseWithResponse(String containerName, String blob, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.releaseLeaseSync(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void releaseLease(String containerName, String blob, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - releaseLeaseWithResponse(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, Context.NONE); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response releaseLeaseNoCustomHeadersWithResponse(String containerName, String blob, String leaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6321,20 +4243,20 @@ public Response releaseLeaseNoCustomHeadersWithResponse(String containerNa * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseWithResponseAsync(String containerName, - String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + public Mono> changeLeaseWithResponseAsync(String containerName, + String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "renew"; + final String action = "change"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)) + .withContext(context -> service.changeLease(this.client.getUrl(), containerName, blob, comp, action, + timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6344,6 +4266,9 @@ public Mono> renewLeaseWithResponseAs * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6363,18 +4288,19 @@ public Mono> renewLeaseWithResponseAs * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseWithResponseAsync(String containerName, - String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { + public Mono> changeLeaseWithResponseAsync(String containerName, + String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + Context context) { final String comp = "lease"; - final String action = "renew"; + final String action = "change"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .renewLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + .changeLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -6386,6 +4312,9 @@ public Mono> renewLeaseWithResponseAs * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6404,11 +4333,11 @@ public Mono> renewLeaseWithResponseAs * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId) + public Mono changeLeaseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, + Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId) { + return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -6419,6 +4348,9 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6438,11 +4370,11 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String containerName, String blob, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, Context context) { - return renewLeaseWithResponseAsync(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, context) + public Mono changeLeaseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, + Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, Context context) { + return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -6453,6 +4385,9 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6471,20 +4406,20 @@ public Mono renewLeaseAsync(String containerName, String blob, String leas * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "renew"; + final String action = "change"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context)) + .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6494,6 +4429,9 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * @param containerName The container name. * @param blob The blob name. * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -6513,19 +4451,20 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { + public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + Context context) { final String comp = "lease"; - final String action = "renew"; + final String action = "change"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + .changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6535,10 +4474,15 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6548,30 +4492,27 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renewLeaseWithResponse(String containerName, String blob, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { + public Mono> breakLeaseWithResponseAsync(String containerName, + String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "renew"; + final String action = "break"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.renewLeaseSync(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, + breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6579,10 +4520,15 @@ public ResponseBase renewLeaseWithResponse(String * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6592,147 +4538,26 @@ public ResponseBase renewLeaseWithResponse(String * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void renewLease(String containerName, String blob, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - renewLeaseWithResponse(containerName, blob, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, Context.NONE); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewLeaseNoCustomHeadersWithResponse(String containerName, String blob, String leaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "renew"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.renewLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseWithResponseAsync(String containerName, - String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.changeLease(this.client.getUrl(), containerName, blob, comp, action, - timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseWithResponseAsync(String containerName, - String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, + public Mono> breakLeaseWithResponseAsync(String containerName, + String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "change"; + final String action = "break"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .changeLease(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, proposedLeaseId, + .breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -6743,13 +4568,15 @@ public Mono> changeLeaseWithResponse * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6765,10 +4592,10 @@ public Mono> changeLeaseWithResponse * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId) { - return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, + public Mono breakLeaseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId) { + return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); @@ -6779,13 +4606,15 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6802,10 +4631,10 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, Context context) { - return changeLeaseWithResponseAsync(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, + public Mono breakLeaseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, Context context) { + return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); @@ -6816,13 +4645,15 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6838,20 +4669,20 @@ public Mono changeLeaseAsync(String containerName, String blob, String lea * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { + public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String requestId) { final String comp = "lease"; - final String action = "change"; + final String action = "break"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - action, timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6860,13 +4691,15 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in + * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. + * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has + * expired, but the lease may be held for longer than the break period. If this header does not appear with a break + * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks + * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6883,36 +4716,37 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { + public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { final String comp = "lease"; - final String action = "change"; + final String action = "break"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .changeLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value + * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. + * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and + * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names + * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata + * for more information. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -6920,1221 +4754,60 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase changeLeaseWithResponse(String containerName, String blob, - String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { - final String comp = "lease"; - final String action = "change"; + public Mono> createSnapshotWithResponseAsync(String containerName, + String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, + String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + final String comp = "snapshot"; final String accept = "application/xml"; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.changeLeaseSync(this.client.getUrl(), containerName, blob, comp, action, timeout, leaseId, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void changeLease(String containerName, String blob, String leaseId, String proposedLeaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - changeLeaseWithResponse(containerName, blob, leaseId, proposedLeaseId, timeout, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, Context.NONE); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response changeLeaseNoCustomHeadersWithResponse(String containerName, String blob, String leaseId, - String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, action, - timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String containerName, - String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, - breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String containerName, - String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .breakLease(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, Context context) { - return breakLeaseWithResponseAsync(containerName, blob, timeout, breakPeriod, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase breakLeaseWithResponse(String containerName, String blob, - Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.breakLeaseSync(this.client.getUrl(), containerName, blob, comp, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void breakLease(String containerName, String blob, Integer timeout, Integer breakPeriod, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - breakLeaseWithResponse(containerName, blob, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, Context.NONE); - } - - /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response breakLeaseNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, action, - timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotWithResponseAsync(String containerName, - String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, - String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, - metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotWithResponseAsync(String containerName, - String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, - String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, metadata, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String containerName, String blob, Integer timeout, - Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String containerName, String blob, Integer timeout, - Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String containerName, String blob, - Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createSnapshotWithResponse(String containerName, String blob, - Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.createSnapshotSync(this.client.getUrl(), containerName, blob, comp, timeout, metadata, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createSnapshot(String containerName, String blob, Integer timeout, Map metadata, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - createSnapshotWithResponse(containerName, blob, timeout, metadata, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Create Snapshot operation creates a read-only snapshot of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSnapshotNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "snapshot"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.createSnapshotNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyFromURLWithResponseAsync( - String containerName, String blob, String copySource, Integer timeout, Map metadata, - AccessTier tier, RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold) { - final String accept = "application/xml"; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil - .withContext(context -> service.startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, - metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, - sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyFromURLWithResponseAsync( - String containerName, String blob, String copySource, Integer timeout, Map metadata, - AccessTier tier, RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - Context context) { - final String accept = "application/xml"; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service - .startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, metadata, tier, rehydratePriority, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + return FluxUtil + .withContext(context -> service.createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, + metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, + this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8144,15 +4817,6 @@ public Mono> startCopyFromURLWi * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8163,40 +4827,58 @@ public Mono> startCopyFromURLWi * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, - Map metadata, AccessTier tier, RehydratePriority rehydratePriority, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, - Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, - Boolean legalHold) { - return startCopyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, - rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, - blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono> createSnapshotWithResponseAsync(String containerName, + String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, + String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + final String comp = "snapshot"; + final String accept = "application/xml"; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .createSnapshot(this.client.getUrl(), containerName, blob, comp, timeout, metadata, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8206,15 +4888,6 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8225,41 +4898,29 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param context The context to associate with this operation. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, - Map metadata, AccessTier tier, RehydratePriority rehydratePriority, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, - Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, - Boolean legalHold, Context context) { - return startCopyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, - rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, - blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, context) + public Mono createSnapshotAsync(String containerName, String blob, Integer timeout, + Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam) { + return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8269,15 +4930,6 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8288,53 +4940,30 @@ public Mono startCopyFromURLAsync(String containerName, String blob, Strin * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, - RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold) { - final String accept = "application/xml"; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil - .withContext(context -> service.startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, - timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, - this.client.getVersion(), requestId, blobTagsString, sealBlob, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono createSnapshotAsync(String containerName, String blob, Integer timeout, + Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam, Context context) { + return createSnapshotWithResponseAsync(containerName, blob, timeout, metadata, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8344,15 +4973,6 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8363,54 +4983,57 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param context The context to associate with this operation. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, - RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - Context context) { + public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam) { + final String comp = "snapshot"; final String accept = "application/xml"; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service - .startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, timeout, metadata, tier, - rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + return FluxUtil + .withContext(context -> service.createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, metadata, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, + this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * The Create Snapshot operation creates a read-only snapshot of a blob. * * @param containerName The container name. * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -8420,15 +5043,6 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8439,46 +5053,51 @@ public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(Str * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase startCopyFromURLWithResponse(String containerName, - String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, - RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - Context context) { + public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String containerName, String blob, + Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam, Context context) { + final String comp = "snapshot"; final String accept = "application/xml"; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.startCopyFromURLSync(this.client.getUrl(), containerName, blob, timeout, metadata, tier, - rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .createSnapshotNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, metadata, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, leaseId, this.client.getVersion(), requestId, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -8525,19 +5144,34 @@ public ResponseBase startCopyFromURLWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void startCopyFromURL(String containerName, String blob, String copySource, Integer timeout, - Map metadata, AccessTier tier, RehydratePriority rehydratePriority, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, - Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, - Boolean legalHold) { - startCopyFromURLWithResponse(containerName, blob, copySource, timeout, metadata, tier, rehydratePriority, - sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, blobTagsString, - sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, Context.NONE); + public Mono> startCopyFromURLWithResponseAsync( + String containerName, String blob, String copySource, Integer timeout, Map metadata, + AccessTier tier, RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, + OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, + OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold) { + final String accept = "application/xml"; + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 immutabilityPolicyExpiryConverted + = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); + return FluxUtil + .withContext(context -> service.startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, + metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, + sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, + sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -8585,12 +5219,12 @@ public void startCopyFromURL(String containerName, String blob, String copySourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startCopyFromURLNoCustomHeadersWithResponse(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, - RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, + public Mono> startCopyFromURLWithResponseAsync( + String containerName, String blob, String copySource, Integer timeout, Map metadata, + AccessTier tier, RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, @@ -8607,20 +5241,17 @@ public Response startCopyFromURLNoCustomHeadersWithResponse(String contain = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.startCopyFromURLNoCustomHeadersSync(this.client.getUrl(), containerName, blob, timeout, - metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, - sealBlob, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .startCopyFromURL(this.client.getUrl(), containerName, blob, timeout, metadata, tier, rehydratePriority, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response - * until the copy is complete. + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. * * @param containerName The container name. * @param blob The blob name. @@ -8637,12 +5268,14 @@ public Response startCopyFromURLNoCustomHeadersWithResponse(String contain * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. * @param tier Optional. Indicates the tier to be set on the blob. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified * since the specified date/time. * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8653,61 +5286,34 @@ public Response startCopyFromURLNoCustomHeadersWithResponse(String contain * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @param legalHold Specified if a legal hold should be set on the blob. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> copyFromURLWithResponseAsync(String containerName, - String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, + public Mono startCopyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, + Map metadata, AccessTier tier, RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam) { - final String xMsRequiresSync = "true"; - final String accept = "application/xml"; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil - .withContext(context -> service.copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, - timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, - sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, - legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, + Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, + Boolean legalHold) { + return startCopyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, + rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, + blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response - * until the copy is complete. + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. * * @param containerName The container name. * @param blob The blob name. @@ -8724,12 +5330,14 @@ public Mono> copyFromURLWithResponse * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. * @param tier Optional. Indicates the tier to be set on the blob. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified * since the specified date/time. * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8740,62 +5348,35 @@ public Mono> copyFromURLWithResponse * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @param legalHold Specified if a legal hold should be set on the blob. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> copyFromURLWithResponseAsync(String containerName, - String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, Context context) { - final String xMsRequiresSync = "true"; - final String accept = "application/xml"; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service - .copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, tier, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, - encryptionScope, copySourceTags, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startCopyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, + Map metadata, AccessTier tier, RehydratePriority rehydratePriority, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, String blobTagsString, + Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, + Boolean legalHold, Context context) { + return startCopyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, + rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, + blobTagsString, sealBlob, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response - * until the copy is complete. + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. * * @param containerName The container name. * @param blob The blob name. @@ -8812,12 +5393,14 @@ public Mono> copyFromURLWithResponse * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. * @param tier Optional. Indicates the tier to be set on the blob. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified * since the specified date/time. * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8828,40 +5411,47 @@ public Mono> copyFromURLWithResponse * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @param legalHold Specified if a legal hold should be set on the blob. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono copyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, - Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, + public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, + String copySource, Integer timeout, Map metadata, AccessTier tier, + RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, + OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam) { - return copyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, - sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, - immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, - encryptionScopeParam).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, + OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold) { + final String accept = "application/xml"; + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 immutabilityPolicyExpiryConverted + = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); + return FluxUtil + .withContext(context -> service.startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, + timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, + this.client.getVersion(), requestId, blobTagsString, sealBlob, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response - * until the copy is complete. + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. * * @param containerName The container name. * @param blob The blob name. @@ -8878,12 +5468,14 @@ public Mono copyFromURLAsync(String containerName, String blob, String cop * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata * for more information. * @param tier Optional. Indicates the tier to be set on the blob. + * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified * since the specified date/time. * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -8894,38 +5486,44 @@ public Mono copyFromURLAsync(String containerName, String blob, String cop * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer. * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @param legalHold Specified if a legal hold should be set on the blob. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono copyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, - Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, + public Mono> startCopyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, + String copySource, Integer timeout, Map metadata, AccessTier tier, + RehydratePriority rehydratePriority, OffsetDateTime sourceIfModifiedSince, + OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, + String ifTags, String leaseId, String requestId, String blobTagsString, Boolean sealBlob, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, Context context) { - return copyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, - sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, - immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, - encryptionScopeParam, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + final String accept = "application/xml"; + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 immutabilityPolicyExpiryConverted + = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); + return service + .startCopyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, timeout, metadata, tier, + rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, sourceIfTags, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -8976,11 +5574,11 @@ public Mono copyFromURLAsync(String containerName, String blob, String cop * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, + public Mono> copyFromURLWithResponseAsync(String containerName, + String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, @@ -9006,13 +5604,12 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); return FluxUtil - .withContext(context -> service.copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, - xMsRequiresSync, timeout, metadata, tier, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), - requestId, sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, - context)) + .withContext(context -> service.copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, + timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, + sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, + sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, + legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -9065,11 +5662,11 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, + public Mono> copyFromURLWithResponseAsync(String containerName, + String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, @@ -9095,10 +5692,10 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); return service - .copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, - tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + .copyFromURL(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, tier, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -9149,49 +5746,25 @@ public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String c * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the * tags specified by x-ms-tags. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase copyFromURLWithResponse(String containerName, String blob, - String copySource, Integer timeout, Map metadata, AccessTier tier, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, Context context) { - final String xMsRequiresSync = "true"; - final String accept = "application/xml"; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.copyFromURLSync(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, - metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, - encryptionScope, copySourceTags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono copyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, + Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, + OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, + OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, + String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam) { + return copyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, + sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, + immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, + encryptionScopeParam).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -9239,23 +5812,116 @@ public ResponseBase copyFromURLWithResponse(Strin * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the * tags specified by x-ms-tags. * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void copyFromURL(String containerName, String blob, String copySource, Integer timeout, + public Mono copyFromURLAsync(String containerName, String blob, String copySource, Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam) { - copyFromURLWithResponse(containerName, blob, copySource, timeout, metadata, tier, sourceIfModifiedSince, - sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, immutabilityPolicyExpiry, - immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, encryptionScopeParam, - Context.NONE); + String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, + Context context) { + return copyFromURLWithResponseAsync(containerName, blob, copySource, timeout, metadata, tier, + sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, leaseId, requestId, sourceContentMD5, blobTagsString, + immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, copySourceAuthorization, copySourceTags, + encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); + } + + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response + * until the copy is complete. + * + * @param containerName The container name. + * @param blob The blob name. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in + * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. + * The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting + * Timeouts for Blob Service Operations.</a>. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value + * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. + * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and + * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names + * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata + * for more information. + * @param tier Optional. Indicates the tier to be set on the blob. + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since + * the specified date/time. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. + * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. + * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. + * @param legalHold Specified if a legal hold should be set on the blob. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. + * @param encryptionScopeParam Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, + String copySource, Integer timeout, Map metadata, AccessTier tier, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, + String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, + BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, + BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam) { + final String xMsRequiresSync = "true"; + final String accept = "application/xml"; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + DateTimeRfc1123 immutabilityPolicyExpiryConverted + = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); + return FluxUtil + .withContext(context -> service.copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, + xMsRequiresSync, timeout, metadata, tier, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), + requestId, sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, + context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -9307,17 +5973,17 @@ public void copyFromURL(String containerName, String blob, String copySource, In * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response copyFromURLNoCustomHeadersWithResponse(String containerName, String blob, String copySource, - Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, - Context context) { + public Mono> copyFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, + String copySource, Integer timeout, Map metadata, AccessTier tier, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, + String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, + BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, + BlobCopySourceTagsMode copySourceTags, EncryptionScope encryptionScopeParam, Context context) { final String xMsRequiresSync = "true"; final String accept = "application/xml"; String encryptionScopeInternal = null; @@ -9336,16 +6002,14 @@ public Response copyFromURLNoCustomHeadersWithResponse(String containerNam String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.copyFromURLNoCustomHeadersSync(this.client.getUrl(), containerName, blob, xMsRequiresSync, - timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, - sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, - sourceContentMD5Converted, blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, - legalHold, copySourceAuthorization, encryptionScope, copySourceTags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .copyFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, xMsRequiresSync, timeout, metadata, + tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, copySourceAuthorization, + encryptionScope, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -9523,97 +6187,6 @@ public Mono> abortCopyFromURLNoCustomHeadersWithResponseAsync(Str .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with - * zero length and full metadata. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase abortCopyFromURLWithResponse(String containerName, - String blob, String copyId, Integer timeout, String leaseId, String requestId, Context context) { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - try { - return service.abortCopyFromURLSync(this.client.getUrl(), containerName, blob, comp, - copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with - * zero length and full metadata. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void abortCopyFromURL(String containerName, String blob, String copyId, Integer timeout, String leaseId, - String requestId) { - abortCopyFromURLWithResponse(containerName, blob, copyId, timeout, leaseId, requestId, Context.NONE); - } - - /** - * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with - * zero length and full metadata. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response abortCopyFromURLNoCustomHeadersWithResponse(String containerName, String blob, String copyId, - Integer timeout, String leaseId, String requestId, Context context) { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - try { - return service.abortCopyFromURLNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - copyActionAbortConstant, copyId, timeout, leaseId, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's @@ -9687,130 +6260,12 @@ public Mono> setTierWithResponseAsync(St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setTierWithResponseAsync(String containerName, String blob, AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, - String requestId, String leaseId, String ifTags, Context context) { - final String comp = "tier"; - final String accept = "application/xml"; - return service - .setTier(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, - rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage - * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's - * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines - * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * - * @param containerName The container name. - * @param blob The blob name. - * @param tier Indicates the tier to be set on the blob. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setTierAsync(String containerName, String blob, AccessTier tier, String snapshot, - String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, - String ifTags) { - return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, - requestId, leaseId, ifTags) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage - * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's - * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines - * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * - * @param containerName The container name. - * @param blob The blob name. - * @param tier Indicates the tier to be set on the blob. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setTierAsync(String containerName, String blob, AccessTier tier, String snapshot, - String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, - String ifTags, Context context) { - return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, - requestId, leaseId, ifTags, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage - * account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's - * tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines - * Hot/Cool/Archive storage type. This operation does not update the blob's ETag. - * - * @param containerName The container name. - * @param blob The blob name. - * @param tier Indicates the tier to be set on the blob. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param rehydratePriority Optional: Indicates the priority with which to rehydrate an archived blob. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setTierNoCustomHeadersWithResponseAsync(String containerName, String blob, - AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, - String requestId, String leaseId, String ifTags) { + String requestId, String leaseId, String ifTags, Context context) { final String comp = "tier"; final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - snapshot, versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, - ifTags, accept, context)) + return service + .setTier(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, + rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -9837,22 +6292,19 @@ public Mono> setTierNoCustomHeadersWithResponseAsync(String conta * analytics logs when storage analytics logging is enabled. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setTierNoCustomHeadersWithResponseAsync(String containerName, String blob, - AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, - String requestId, String leaseId, String ifTags, Context context) { - final String comp = "tier"; - final String accept = "application/xml"; - return service - .setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, - rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono setTierAsync(String containerName, String blob, AccessTier tier, String snapshot, + String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, + String ifTags) { + return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, + requestId, leaseId, ifTags) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -9882,20 +6334,16 @@ public Mono> setTierNoCustomHeadersWithResponseAsync(String conta * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setTierWithResponse(String containerName, String blob, - AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, - String requestId, String leaseId, String ifTags, Context context) { - final String comp = "tier"; - final String accept = "application/xml"; - try { - return service.setTierSync(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, - tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono setTierAsync(String containerName, String blob, AccessTier tier, String snapshot, + String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, + String ifTags, Context context) { + return setTierWithResponseAsync(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, + requestId, leaseId, ifTags, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -9924,12 +6372,19 @@ public ResponseBase setTierWithResponse(String contai * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void setTier(String containerName, String blob, AccessTier tier, String snapshot, String versionId, - Integer timeout, RehydratePriority rehydratePriority, String requestId, String leaseId, String ifTags) { - setTierWithResponse(containerName, blob, tier, snapshot, versionId, timeout, rehydratePriority, requestId, - leaseId, ifTags, Context.NONE); + public Mono> setTierNoCustomHeadersWithResponseAsync(String containerName, String blob, + AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, + String requestId, String leaseId, String ifTags) { + final String comp = "tier"; + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + snapshot, versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, + ifTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -9959,21 +6414,18 @@ public void setTier(String containerName, String blob, AccessTier tier, String s * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setTierNoCustomHeadersWithResponse(String containerName, String blob, AccessTier tier, - String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, String requestId, - String leaseId, String ifTags, Context context) { + public Mono> setTierNoCustomHeadersWithResponseAsync(String containerName, String blob, + AccessTier tier, String snapshot, String versionId, Integer timeout, RehydratePriority rehydratePriority, + String requestId, String leaseId, String ifTags, Context context) { final String comp = "tier"; final String accept = "application/xml"; - try { - return service.setTierNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, snapshot, - versionId, timeout, tier, rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .setTierNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, versionId, timeout, tier, + rehydratePriority, this.client.getVersion(), requestId, leaseId, ifTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -10100,70 +6552,6 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @param blob The blob name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getAccountInfoWithResponse(String containerName, String blob, - Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.getAccountInfoSync(this.client.getUrl(), containerName, blob, restype, comp, - this.client.getVersion(), accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @param blob The blob name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getAccountInfo(String containerName, String blob) { - getAccountInfoWithResponse(containerName, blob, Context.NONE); - } - - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @param blob The blob name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccountInfoNoCustomHeadersWithResponse(String containerName, String blob, - Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.getAccountInfoNoCustomHeadersSync(this.client.getUrl(), containerName, blob, restype, comp, - this.client.getVersion(), accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Query operation enables users to select/project on blob data by providing simple query expressions. * @@ -10349,152 +6737,25 @@ public Flux queryAsync(String containerName, String blob, String sna * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queryRequest the query request. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux queryAsync(String containerName, String blob, String snapshot, Integer timeout, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, QueryRequest queryRequest, CpkInfo cpkInfo, - Context context) { - return queryWithResponseAsync(containerName, blob, snapshot, timeout, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, queryRequest, cpkInfo, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); - } - - /** - * The Query operation enables users to select/project on blob data by providing simple query expressions. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queryRequest the query request. - * @param cpkInfo Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono queryNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - QueryRequest queryRequest, CpkInfo cpkInfo) { - final String comp = "query"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - snapshot, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, queryRequest, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Query operation enables users to select/project on blob data by providing simple query expressions. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queryRequest the query request. - * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono queryNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - QueryRequest queryRequest, CpkInfo cpkInfo, Context context) { - final String comp = "query"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - queryRequest, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param queryRequest the query request. + * @param cpkInfo Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Flux queryAsync(String containerName, String blob, String snapshot, Integer timeout, + String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, QueryRequest queryRequest, CpkInfo cpkInfo, + Context context) { + return queryWithResponseAsync(containerName, blob, snapshot, timeout, leaseId, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, queryRequest, cpkInfo, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); } /** @@ -10521,17 +6782,16 @@ public Mono queryNoCustomHeadersWithResponseAsync(String contain * analytics logs when storage analytics logging is enabled. * @param queryRequest the query request. * @param cpkInfo Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase queryWithResponse(String containerName, String blob, + public Mono queryNoCustomHeadersWithResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - QueryRequest queryRequest, CpkInfo cpkInfo, Context context) { + QueryRequest queryRequest, CpkInfo cpkInfo) { final String comp = "query"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -10553,56 +6813,12 @@ public ResponseBase queryWithResponse(String con = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.querySync(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - queryRequest, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Query operation enables users to select/project on blob data by providing simple query expressions. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param queryRequest the query request. - * @param cpkInfo Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream query(String containerName, String blob, String snapshot, Integer timeout, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, QueryRequest queryRequest, CpkInfo cpkInfo) { - try { - return queryWithResponse(containerName, blob, snapshot, timeout, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, queryRequest, cpkInfo, Context.NONE) - .getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + snapshot, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, queryRequest, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -10633,13 +6849,13 @@ public InputStream query(String containerName, String blob, String snapshot, Int * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response queryNoCustomHeadersWithResponse(String containerName, String blob, String snapshot, - Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, QueryRequest queryRequest, CpkInfo cpkInfo, - Context context) { + public Mono queryNoCustomHeadersWithResponseAsync(String containerName, String blob, + String snapshot, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + QueryRequest queryRequest, CpkInfo cpkInfo, Context context) { final String comp = "query"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -10661,14 +6877,12 @@ public Response queryNoCustomHeadersWithResponse(String containerNa = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.queryNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, + return service + .queryNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - queryRequest, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + queryRequest, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -10874,115 +7088,6 @@ public Mono> getTagsNoCustomHeadersWithResponseAsync(String c .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Get Tags operation enables users to get the tags associated with a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob tags along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getTagsWithResponse(String containerName, String blob, - Integer timeout, String requestId, String snapshot, String versionId, String ifTags, String leaseId, - Context context) { - final String comp = "tags"; - final String accept = "application/xml"; - try { - return service.getTagsSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Tags operation enables users to get the tags associated with a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob tags. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobTags getTags(String containerName, String blob, Integer timeout, String requestId, String snapshot, - String versionId, String ifTags, String leaseId) { - try { - return getTagsWithResponse(containerName, blob, timeout, requestId, snapshot, versionId, ifTags, leaseId, - Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Tags operation enables users to get the tags associated with a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob tags along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTagsNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - String requestId, String snapshot, String versionId, String ifTags, String leaseId, Context context) { - final String comp = "tags"; - final String accept = "application/xml"; - try { - return service.getTagsNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - this.client.getVersion(), requestId, snapshot, versionId, ifTags, leaseId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Set Tags operation enables users to set tags on a blob. * @@ -11197,113 +7302,4 @@ public Mono> setTagsNoCustomHeadersWithResponseAsync(String conta leaseId, tags, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - - /** - * The Set Tags operation enables users to set tags on a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tags Blob tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setTagsWithResponse(String containerName, String blob, - Integer timeout, String versionId, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - String requestId, String ifTags, String leaseId, BlobTags tags, Context context) { - final String comp = "tags"; - final String accept = "application/xml"; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.setTagsSync(this.client.getUrl(), containerName, blob, comp, this.client.getVersion(), - timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, - ifTags, leaseId, tags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Set Tags operation enables users to set tags on a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tags Blob tags. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setTags(String containerName, String blob, Integer timeout, String versionId, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, String ifTags, - String leaseId, BlobTags tags) { - setTagsWithResponse(containerName, blob, timeout, versionId, transactionalContentMD5, transactionalContentCrc64, - requestId, ifTags, leaseId, tags, Context.NONE); - } - - /** - * The Set Tags operation enables users to set tags on a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version - * of the blob to operate on. It's for service version 2019-10-10 and newer. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tags Blob tags. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setTagsNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout, - String versionId, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, - String ifTags, String leaseId, BlobTags tags, Context context) { - final String comp = "tags"; - final String accept = "application/xml"; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.setTagsNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, - transactionalContentCrc64Converted, requestId, ifTags, leaseId, tags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java index 0015e15e74b03..43e1069e53a93 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java @@ -210,70 +210,6 @@ Mono> uploadNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase uploadSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response uploadNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -348,80 +284,6 @@ Mono> putBlobFromUrlNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase putBlobFromUrlSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-source-if-tags") String sourceIfTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-copy-source-blob-properties") Boolean copySourceBlobProperties, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response putBlobFromUrlNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-source-if-tags") String sourceIfTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-copy-source-blob-properties") Boolean copySourceBlobProperties, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -490,40 +352,6 @@ Mono> stageBlockNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase stageBlockSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("blockid") String blockId, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response stageBlockNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("blockid") String blockId, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -568,50 +396,6 @@ Mono> stageBlockFromURLNoCustomHeaders(@HostParam("url") String u @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase stageBlockFromURLSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("blockid") String blockId, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-copy-source") String sourceUrl, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response stageBlockFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("blockid") String blockId, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-copy-source") String sourceUrl, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -672,103 +456,21 @@ Mono> commitBlockListNoCustomHeaders(@HostParam("url") String url @HeaderParam("x-ms-legal-hold") Boolean legalHold, @BodyParam("application/xml") BlockLookupList blocks, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) + @Get("/{containerName}/{blob}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase commitBlockListSync(@HostParam("url") String url, + Mono> getBlockList(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @BodyParam("application/xml") BlockLookupList blocks, + @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, + @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) + @Get("/{containerName}/{blob}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response commitBlockListNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-access-tier") AccessTier tier, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @BodyParam("application/xml") BlockLookupList blocks, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> getBlockList(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> getBlockListNoCustomHeaders(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getBlockListSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getBlockListNoCustomHeadersSync(@HostParam("url") String url, + Mono> getBlockListNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, @QueryParam("blocklisttype") BlockListType listType, @QueryParam("timeout") Integer timeout, @@ -2010,15 +1712,18 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai } /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob - * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the - * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a - * block blob, use the Put Block List operation. + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given + * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob + * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial + * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put + * Block List. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. - * @param body Initial data. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in + * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. + * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -2038,30 +1743,41 @@ public Mono> uploadNoCustomHeadersWithResponseAsync(String contai * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since + * the specified date/time. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be + * copied. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase uploadWithResponse(String containerName, String blob, - long contentLength, BinaryData body, Integer timeout, byte[] transactionalContentMD5, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, byte[] transactionalContentCrc64, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + public Mono> putBlobFromUrlWithResponseAsync( + String containerName, String blob, long contentLength, String copySource, Integer timeout, + byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, + String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, + String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, + BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam) { final String blobType = "BlockBlob"; final String accept = "application/xml"; String contentTypeInternal = null; @@ -2120,32 +1836,36 @@ public ResponseBase uploadWithResponse(String con = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.uploadSync(this.client.getUrl(), containerName, blob, blobType, timeout, + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + return FluxUtil + .withContext(context -> service.putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob - * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the - * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a - * block blob, use the Put Block List operation. + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given + * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob + * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial + * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put + * Block List. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. - * @param body Initial data. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in + * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. + * The source blob must either be public or must be authenticated via a shared access signature. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -2165,69 +1885,23 @@ public ResponseBase uploadWithResponse(String con * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void upload(String containerName, String blob, long contentLength, BinaryData body, Integer timeout, - byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, byte[] transactionalContentCrc64, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - uploadWithResponse(containerName, blob, contentLength, body, timeout, transactionalContentMD5, metadata, - leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, - immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, blobHttpHeaders, - cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob - * overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the - * existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a - * block blob, use the Put Block List operation. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be + * copied. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. @@ -2235,15 +1909,17 @@ public void upload(String containerName, String blob, long contentLength, Binary * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - BinaryData body, Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, - AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - byte[] transactionalContentCrc64, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, + public Mono> putBlobFromUrlWithResponseAsync( + String containerName, String blob, long contentLength, String copySource, Integer timeout, + byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, + String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, + String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, + BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { final String blobType = "BlockBlob"; final String accept = "application/xml"; @@ -2303,20 +1979,21 @@ public Response uploadNoCustomHeadersWithResponse(String containerName, St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.uploadNoCustomHeadersSync(this.client.getUrl(), containerName, blob, blobType, timeout, + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + return service + .putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, - transactionalContentCrc64Converted, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -2374,91 +2051,24 @@ public Response uploadNoCustomHeadersWithResponse(String containerName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putBlobFromUrlWithResponseAsync( - String containerName, String blob, long contentLength, String copySource, Integer timeout, - byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, + public Mono putBlobFromUrlAsync(String containerName, String blob, long contentLength, String copySource, + Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String blobType = "BlockBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return FluxUtil - .withContext(context -> service.putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, - copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + return putBlobFromUrlWithResponseAsync(containerName, blob, contentLength, copySource, timeout, + transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, + copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -2517,18 +2127,92 @@ public Mono> putBlobFromUrlW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putBlobFromUrlWithResponseAsync( - String containerName, String blob, long contentLength, String copySource, Integer timeout, - byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, + public Mono putBlobFromUrlAsync(String containerName, String blob, long contentLength, String copySource, + Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + return putBlobFromUrlWithResponseAsync(containerName, blob, contentLength, copySource, timeout, + transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, + copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); + } + + /** + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given + * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob + * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial + * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put + * Block List. + * + * @param containerName The container name. + * @param blob The blob name. + * @param contentLength The length of the request. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in + * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. + * The source blob must either be public or must be authenticated via a shared access signature. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting + * Timeouts for Blob Service Operations.</a>. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value + * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. + * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and + * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names + * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata + * for more information. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param tier Optional. Indicates the tier to be set on the blob. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. + * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since + * the specified date/time. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be + * copied. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. + * @param blobHttpHeaders Parameter group. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(String containerName, String blob, + long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, + Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, + Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, + BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String blobType = "BlockBlob"; final String accept = "application/xml"; String contentTypeInternal = null; @@ -2592,15 +2276,15 @@ public Mono> putBlobFromUrlW DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return service - .putBlobFromUrl(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, - copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) + return FluxUtil + .withContext(context -> service.putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, + blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, + contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + sourceIfTags, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, + copySource, copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -2656,1067 +2340,94 @@ public Mono> putBlobFromUrlW * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putBlobFromUrlAsync(String containerName, String blob, long contentLength, String copySource, - Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, - String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - return putBlobFromUrlWithResponseAsync(containerName, blob, contentLength, copySource, timeout, - transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, - copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putBlobFromUrlAsync(String containerName, String blob, long contentLength, String copySource, - Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, - String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - return putBlobFromUrlWithResponseAsync(containerName, blob, contentLength, copySource, timeout, - transactionalContentMD5, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - requestId, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, - copySourceTags, blobHttpHeaders, cpkInfo, encryptionScopeParam, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(String containerName, String blob, - long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, - Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String blobType = "BlockBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return FluxUtil - .withContext(context -> service.putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, - blobType, timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, - contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, - copySource, copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(String containerName, String blob, - long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, - Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "BlockBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - return service - .putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, - copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase putBlobFromUrlWithResponse(String containerName, - String blob, long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, - Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "BlockBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - try { - return service.putBlobFromUrlSync(this.client.getUrl(), containerName, blob, blobType, timeout, - transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, - copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void putBlobFromUrl(String containerName, String blob, long contentLength, String copySource, - Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, - String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, - BlobCopySourceTagsMode copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - putBlobFromUrlWithResponse(containerName, blob, contentLength, copySource, timeout, transactionalContentMD5, - metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, requestId, - sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, copySourceTags, - blobHttpHeaders, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given - * URL. This API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob - * from URL; the content of an existing blob is overwritten with the content of the new blob. To perform partial - * updates to a block blob's contents using a source URL, use the Put Block from URL API in conjunction with Put - * Block List. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param sourceIfTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be - * copied. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putBlobFromUrlNoCustomHeadersWithResponse(String containerName, String blob, - long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, - Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "BlockBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - try { - return service.putBlobFromUrlNoCustomHeadersSync(this.client.getUrl(), containerName, blob, blobType, - timeout, transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, - contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, - this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, - copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockWithResponseAsync(String containerName, - String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil - .withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockWithResponseAsync(String containerName, - String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service - .stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, - Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, - String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, - transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, - Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, - String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, - transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return FluxUtil - .withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - this.client.getVersion(), requestId, body, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service - .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono> putBlobFromUrlNoCustomHeadersWithResponseAsync(String containerName, String blob, + long contentLength, String copySource, Integer timeout, byte[] transactionalContentMD5, + Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, String sourceIfTags, String requestId, byte[] sourceContentMD5, String blobTagsString, + Boolean copySourceBlobProperties, String copySourceAuthorization, BlobCopySourceTagsMode copySourceTags, + BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + final String blobType = "BlockBlob"; + final String accept = "application/xml"; + String contentTypeInternal = null; + if (blobHttpHeaders != null) { + contentTypeInternal = blobHttpHeaders.getContentType(); + } + String contentType = contentTypeInternal; + String contentEncodingInternal = null; + if (blobHttpHeaders != null) { + contentEncodingInternal = blobHttpHeaders.getContentEncoding(); + } + String contentEncoding = contentEncodingInternal; + String contentLanguageInternal = null; + if (blobHttpHeaders != null) { + contentLanguageInternal = blobHttpHeaders.getContentLanguage(); + } + String contentLanguage = contentLanguageInternal; + byte[] contentMd5Internal = null; + if (blobHttpHeaders != null) { + contentMd5Internal = blobHttpHeaders.getContentMd5(); + } + byte[] contentMd5 = contentMd5Internal; + String cacheControlInternal = null; + if (blobHttpHeaders != null) { + cacheControlInternal = blobHttpHeaders.getCacheControl(); + } + String cacheControl = cacheControlInternal; + String contentDispositionInternal = null; + if (blobHttpHeaders != null) { + contentDispositionInternal = blobHttpHeaders.getContentDisposition(); + } + String contentDisposition = contentDispositionInternal; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String contentMd5Converted = Base64Util.encodeToString(contentMd5); + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + return service + .putBlobFromUrlNoCustomHeaders(this.client.getUrl(), containerName, blob, blobType, timeout, + transactionalContentMD5Converted, contentLength, contentType, contentEncoding, contentLanguage, + contentMd5Converted, cacheControl, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, + this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, copySource, + copySourceBlobProperties, copySourceAuthorization, copySourceTags, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -3746,7 +2457,7 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stageBlockWithResponseAsync(String containerName, - String blob, String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "block"; @@ -3809,7 +2520,7 @@ public Mono> stageBlockWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stageBlockWithResponseAsync(String containerName, - String blob, String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + String blob, String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { final String comp = "block"; @@ -3871,7 +2582,7 @@ public Mono> stageBlockWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, - BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, + Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam) @@ -3907,7 +2618,7 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, - BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, + Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, context) @@ -3942,7 +2653,7 @@ public Mono stageBlockAsync(String containerName, String blob, String bloc */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "block"; @@ -4005,169 +2716,9 @@ public Mono> stageBlockNoCustomHeadersWithResponseAsync(String co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service - .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase stageBlockWithResponse(String containerName, String blob, - String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + String blockId, long contentLength, Flux body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.stageBlockSync(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stageBlock(String containerName, String blob, String blockId, long contentLength, BinaryData body, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String leaseId, - String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - stageBlockWithResponse(containerName, blob, blockId, contentLength, body, transactionalContentMD5, - transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Stage Block operation creates a new block to be committed as part of a blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less - * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter - * must be the same size for each block. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stageBlockNoCustomHeadersWithResponse(String containerName, String blob, String blockId, - long contentLength, BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, - Context context) { + EncryptionScope encryptionScopeParam, Context context) { final String comp = "block"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -4192,19 +2743,16 @@ public Response stageBlockNoCustomHeadersWithResponse(String containerName String encryptionScope = encryptionScopeInternal; String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - try { - return service.stageBlockNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), - requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from - * a URL. + * The Stage Block operation creates a new block to be committed as part of a blob. * * @param containerName The container name. * @param blob The blob name. @@ -4212,25 +2760,15 @@ public Response stageBlockNoCustomHeadersWithResponse(String containerName * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter * must be the same size for each block. * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4239,11 +2777,9 @@ public Response stageBlockNoCustomHeadersWithResponse(String containerName * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockFromURLWithResponseAsync( - String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, - byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, + public Mono> stageBlockWithResponseAsync(String containerName, + String blob, String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "block"; final String accept = "application/xml"; @@ -4267,24 +2803,18 @@ public Mono> stageBlockFr encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); return FluxUtil - .withContext(context -> service.stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .withContext(context -> service.stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), + requestId, body, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from - * a URL. + * The Stage Block operation creates a new block to be committed as part of a blob. * * @param containerName The container name. * @param blob The blob name. @@ -4292,25 +2822,15 @@ public Mono> stageBlockFr * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter * must be the same size for each block. * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. @@ -4320,11 +2840,9 @@ public Mono> stageBlockFr * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockFromURLWithResponseAsync( - String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, - byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, + public Mono> stageBlockWithResponseAsync(String containerName, + String blob, String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { final String comp = "block"; final String accept = "application/xml"; @@ -4348,24 +2866,18 @@ public Mono> stageBlockFr encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); return service - .stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, sourceUrl, - sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, - sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, - copySourceAuthorization, accept, context) + .stageBlock(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from - * a URL. + * The Stage Block operation creates a new block to be committed as part of a blob. * * @param containerName The container name. * @param blob The blob name. @@ -4373,25 +2885,15 @@ public Mono> stageBlockFr * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter * must be the same size for each block. * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -4400,21 +2902,17 @@ public Mono> stageBlockFr * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockFromURLAsync(String containerName, String blob, String blockId, long contentLength, - String sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, - String leaseId, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, - sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, - sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam) + public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, + BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, + String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, + transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } /** - * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from - * a URL. + * The Stage Block operation creates a new block to be committed as part of a blob. * * @param containerName The container name. * @param blob The blob name. @@ -4422,25 +2920,15 @@ public Mono stageBlockFromURLAsync(String containerName, String blob, Stri * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter * must be the same size for each block. * @param contentLength The length of the request. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. @@ -4450,18 +2938,140 @@ public Mono stageBlockFromURLAsync(String containerName, String blob, Stri * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono stageBlockFromURLAsync(String containerName, String blob, String blockId, long contentLength, - String sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, - String leaseId, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, - sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, - sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam, - context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + public Mono stageBlockAsync(String containerName, String blob, String blockId, long contentLength, + BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, + String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + return stageBlockWithResponseAsync(containerName, blob, blockId, contentLength, body, transactionalContentMD5, + transactionalContentCrc64, timeout, leaseId, requestId, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } + /** + * The Stage Block operation creates a new block to be committed as part of a blob. + * + * @param containerName The container name. + * @param blob The blob name. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less + * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter + * must be the same size for each block. + * @param contentLength The length of the request. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting + * Timeouts for Blob Service Operations.</a>. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, + String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam) { + final String comp = "block"; + final String accept = "application/xml"; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); + return FluxUtil + .withContext(context -> service.stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + blockId, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + } + + /** + * The Stage Block operation creates a new block to be committed as part of a blob. + * + * @param containerName The container name. + * @param blob The blob name. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less + * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter + * must be the same size for each block. + * @param contentLength The length of the request. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting + * Timeouts for Blob Service Operations.</a>. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stageBlockNoCustomHeadersWithResponseAsync(String containerName, String blob, + String blockId, long contentLength, BinaryData body, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Integer timeout, String leaseId, String requestId, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam, Context context) { + final String comp = "block"; + final String accept = "application/xml"; + String encryptionKeyInternal = null; + if (cpkInfo != null) { + encryptionKeyInternal = cpkInfo.getEncryptionKey(); + } + String encryptionKey = encryptionKeyInternal; + String encryptionKeySha256Internal = null; + if (cpkInfo != null) { + encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); + } + String encryptionKeySha256 = encryptionKeySha256Internal; + EncryptionAlgorithmType encryptionAlgorithmInternal = null; + if (cpkInfo != null) { + encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); + } + EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); + return service + .stageBlockNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, this.client.getVersion(), requestId, body, + accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + } + /** * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from * a URL. @@ -4496,14 +3106,15 @@ public Mono stageBlockFromURLAsync(String containerName, String blob, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, - String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + public Mono> stageBlockFromURLWithResponseAsync( + String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, + byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam) { final String comp = "block"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -4532,11 +3143,12 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil.withContext(context -> service.stageBlockFromURLNoCustomHeaders(this.client.getUrl(), - containerName, blob, comp, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, - sourceContentcrc64Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, - sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + return FluxUtil + .withContext(context -> service.stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, + contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4575,14 +3187,15 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, - String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, - String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + public Mono> stageBlockFromURLWithResponseAsync( + String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, + byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, + OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, + String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, + EncryptionScope encryptionScopeParam, Context context) { final String comp = "block"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -4612,8 +3225,8 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); return service - .stageBlockFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, - sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, + .stageBlockFromURL(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, sourceUrl, + sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context) @@ -4651,55 +3264,22 @@ public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(St * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase stageBlockFromURLWithResponse(String containerName, - String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, - OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, - String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "block"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.stageBlockFromURLSync(this.client.getUrl(), containerName, blob, comp, blockId, - contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono stageBlockFromURLAsync(String containerName, String blob, String blockId, long contentLength, + String sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, + String leaseId, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, + String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, + sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, + sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -4733,20 +3313,23 @@ public ResponseBase stageBlockFromURLW * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void stageBlockFromURL(String containerName, String blob, String blockId, long contentLength, + public Mono stageBlockFromURLAsync(String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - stageBlockFromURLWithResponse(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + return stageBlockFromURLWithResponseAsync(containerName, blob, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, sourceContentcrc64, timeout, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam, - Context.NONE); + context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -4780,18 +3363,17 @@ public void stageBlockFromURL(String containerName, String blob, String blockId, * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response stageBlockFromURLNoCustomHeadersWithResponse(String containerName, String blob, + public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, - String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "block"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -4820,102 +3402,59 @@ public Response stageBlockFromURLNoCustomHeadersWithResponse(String contai = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.stageBlockFromURLNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, - timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil.withContext(context -> service.stageBlockFromURLNoCustomHeaders(this.client.getUrl(), + containerName, blob, comp, blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5Converted, + sourceContentcrc64Converted, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, leaseId, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, + sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order - * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block - * operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then - * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the - * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the - * block, whichever list it may belong to. + * The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from + * a URL. * * @param containerName The container name. * @param blob The blob name. - * @param blocks Blob Blocks. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string must be less + * than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter + * must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy + * source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> commitBlockListWithResponseAsync( - String containerName, String blob, BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "blocklist"; + public Mono> stageBlockFromURLNoCustomHeadersWithResponseAsync(String containerName, String blob, + String blockId, long contentLength, String sourceUrl, String sourceRange, byte[] sourceContentMD5, + byte[] sourceContentcrc64, Integer timeout, String leaseId, OffsetDateTime sourceIfModifiedSince, + OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, + String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + final String comp = "block"; final String accept = "application/xml"; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; String encryptionKeyInternal = null; if (cpkInfo != null) { encryptionKeyInternal = cpkInfo.getEncryptionKey(); @@ -4936,23 +3475,18 @@ public Mono> commitBlockLis encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil - .withContext(context -> service.commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, - cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, - transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, blocks, accept, context)) + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + return service + .stageBlockFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, blockId, contentLength, + sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSinceConverted, + sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4996,7 +3530,6 @@ public Mono> commitBlockLis * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5009,7 +3542,7 @@ public Mono> commitBlockLis OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "blocklist"; final String accept = "application/xml"; String cacheControlInternal = null; @@ -5071,77 +3604,17 @@ public Mono> commitBlockLis = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service - .commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, contentType, - contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, - transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context) + return FluxUtil + .withContext(context -> service.commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, + cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, + transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, blocks, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order - * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block - * operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then - * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the - * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the - * block, whichever list it may belong to. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blocks Blob Blocks. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono commitBlockListAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, - AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, - transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, - blobHttpHeaders, cpkInfo, encryptionScopeParam) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - /** * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block @@ -5186,76 +3659,16 @@ public Mono commitBlockListAsync(String containerName, String blob, BlockL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono commitBlockListAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, - AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, - transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, - blobHttpHeaders, cpkInfo, encryptionScopeParam, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order - * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block - * operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then - * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the - * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the - * block, whichever list it may belong to. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blocks Blob Blocks. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> commitBlockListNoCustomHeadersWithResponseAsync(String containerName, String blob, - BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, + public Mono> commitBlockListWithResponseAsync( + String containerName, String blob, BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Map metadata, String leaseId, AccessTier tier, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { final String comp = "blocklist"; final String accept = "application/xml"; String cacheControlInternal = null; @@ -5317,14 +3730,14 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return FluxUtil - .withContext(context -> service.commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, timeout, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, - transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, blocks, accept, context)) + return service + .commitBlockList(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, contentType, + contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, + transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, + context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5368,90 +3781,24 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> commitBlockListNoCustomHeadersWithResponseAsync(String containerName, String blob, - BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "blocklist"; - final String accept = "application/xml"; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - return service - .commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, - contentType, contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, - transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono commitBlockListAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, + byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, + AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, String blobTagsString, + OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, + BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, + transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, + ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, + blobHttpHeaders, cpkInfo, encryptionScopeParam) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5498,16 +3845,76 @@ public Mono> commitBlockListNoCustomHeadersWithResponseAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase commitBlockListWithResponse(String containerName, - String blob, BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Map metadata, String leaseId, AccessTier tier, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, + public Mono commitBlockListAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, + byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, + AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, String blobTagsString, + OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, + BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + return commitBlockListWithResponseAsync(containerName, blob, blocks, timeout, transactionalContentMD5, + transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, + ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, + blobHttpHeaders, cpkInfo, encryptionScopeParam, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); + } + + /** + * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order + * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block + * operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then + * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the + * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the + * block, whichever list it may belong to. + * + * @param containerName The container name. + * @param blob The blob name. + * @param blocks Blob Blocks. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting + * Timeouts for Blob Service Operations.</a>. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. + * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value + * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. + * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and + * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names + * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata + * for more information. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param tier Optional. Indicates the tier to be set on the blob. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. + * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param blobTagsString Optional. Used to set blob tags in various blob operations. + * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. + * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. + * @param legalHold Specified if a legal hold should be set on the blob. + * @param blobHttpHeaders Parameter group. + * @param cpkInfo Parameter group. + * @param encryptionScopeParam Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> commitBlockListNoCustomHeadersWithResponseAsync(String containerName, String blob, + BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, + Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "blocklist"; final String accept = "application/xml"; String cacheControlInternal = null; @@ -5569,74 +3976,15 @@ public ResponseBase commitBlockListWithR = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.commitBlockListSync(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, - contentType, contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, - transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, - blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order - * to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block - * operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then - * committing the new and existing blocks together. You can do this by specifying whether to commit a block from the - * committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the - * block, whichever list it may belong to. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blocks Blob Blocks. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param tier Optional. Indicates the tier to be set on the blob. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void commitBlockList(String containerName, String blob, BlockLookupList blocks, Integer timeout, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, - AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - commitBlockListWithResponse(containerName, blob, blocks, timeout, transactionalContentMD5, - transactionalContentCrc64, metadata, leaseId, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, - ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, - blobHttpHeaders, cpkInfo, encryptionScopeParam, Context.NONE); + return FluxUtil + .withContext(context -> service.commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, timeout, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, + transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, + contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, + immutabilityPolicyMode, legalHold, blocks, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5683,10 +4031,10 @@ public void commitBlockList(String containerName, String blob, BlockLookupList b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response commitBlockListNoCustomHeadersWithResponse(String containerName, String blob, + public Mono> commitBlockListNoCustomHeadersWithResponseAsync(String containerName, String blob, BlockLookupList blocks, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, @@ -5754,17 +4102,15 @@ public Response commitBlockListNoCustomHeadersWithResponse(String containe = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); DateTimeRfc1123 immutabilityPolicyExpiryConverted = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.commitBlockListNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, - transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted, - immutabilityPolicyMode, legalHold, blocks, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .commitBlockListNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, cacheControl, + contentType, contentEncoding, contentLanguage, contentMd5Converted, transactionalContentMD5Converted, + transactionalContentCrc64Converted, metadata, leaseId, contentDisposition, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, + blobTagsString, immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, blocks, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5970,114 +4316,4 @@ public Mono> getBlockListNoCustomHeadersWithResponseAsync(St leaseId, ifTags, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - - /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both - * lists together. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getBlockListWithResponse(String containerName, - String blob, BlockListType listType, String snapshot, Integer timeout, String leaseId, String ifTags, - String requestId, Context context) { - final String comp = "blocklist"; - final String accept = "application/xml"; - try { - return service.getBlockListSync(this.client.getUrl(), containerName, blob, comp, snapshot, listType, - timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both - * lists together. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlockList getBlockList(String containerName, String blob, BlockListType listType, String snapshot, - Integer timeout, String leaseId, String ifTags, String requestId) { - try { - return getBlockListWithResponse(containerName, blob, listType, snapshot, timeout, leaseId, ifTags, - requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both - * lists together. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBlockListNoCustomHeadersWithResponse(String containerName, String blob, - BlockListType listType, String snapshot, Integer timeout, String leaseId, String ifTags, String requestId, - Context context) { - final String comp = "blocklist"; - final String accept = "application/xml"; - try { - return service.getBlockListNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, snapshot, - listType, timeout, leaseId, ifTags, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java index 98c26465d2b8c..ab18e09328427 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java @@ -54,7 +54,6 @@ import com.azure.storage.blob.models.BlobSignedIdentifier; import com.azure.storage.blob.models.ListBlobsIncludeItem; import com.azure.storage.blob.models.PublicAccessType; -import java.io.InputStream; import java.nio.ByteBuffer; import java.time.OffsetDateTime; import java.util.List; @@ -123,30 +122,6 @@ Mono> createNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-deny-encryption-scope-override") Boolean encryptionScopeOverridePrevented, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-blob-public-access") PublicAccessType access, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-default-encryption-scope") String defaultEncryptionScope, - @HeaderParam("x-ms-deny-encryption-scope-override") Boolean encryptionScopeOverridePrevented, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-blob-public-access") PublicAccessType access, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-default-encryption-scope") String defaultEncryptionScope, - @HeaderParam("x-ms-deny-encryption-scope-override") Boolean encryptionScopeOverridePrevented, - @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -165,24 +140,6 @@ Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Delete("/{containerName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -205,28 +162,6 @@ Mono> deleteNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Delete("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -249,28 +184,6 @@ Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -291,26 +204,6 @@ Mono> getAccessPolicyNoCustomHeaders(@Host @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getAccessPolicySync( - @HostParam("url") String url, @PathParam("containerName") String containerName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -339,34 +232,6 @@ Mono> setAccessPolicyNoCustomHeaders(@HostParam("url") String url @BodyParam("application/xml") BlobSignedIdentifierWrapper containerAcl, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setAccessPolicySync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-public-access") PublicAccessType access, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BlobSignedIdentifierWrapper containerAcl, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-public-access") PublicAccessType access, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BlobSignedIdentifierWrapper containerAcl, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -389,28 +254,6 @@ Mono> restoreNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-deleted-container-version") String deletedContainerVersion, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase restoreSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-container-name") String deletedContainerName, - @HeaderParam("x-ms-deleted-container-version") String deletedContainerVersion, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response restoreNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-container-name") String deletedContainerName, - @HeaderParam("x-ms-deleted-container-version") String deletedContainerVersion, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -433,28 +276,6 @@ Mono> renameNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase renameSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-container-name") String sourceContainerName, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response renameNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-source-container-name") String sourceContainerName, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("Accept") String accept, - Context context); - @Post("/{containerName}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -495,26 +316,6 @@ Mono submitBatchNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Post("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase submitBatchSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-Type") String multipartContentType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - - @Post("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response submitBatchNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-Type") String multipartContentType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -537,28 +338,6 @@ Mono> filterBlobsNoCustomHeaders(@HostParam("url") S @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase filterBlobsSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("where") String where, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response filterBlobsNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("where") String where, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -586,26 +365,12 @@ Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url, @HeaderParam("Accept") String accept, Context context); @Put("/{containerName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase acquireLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 201 }) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url, + Mono> releaseLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, + @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @@ -614,7 +379,7 @@ Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url, @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> releaseLease(@HostParam("url") String url, + Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @@ -626,7 +391,7 @@ Mono> releaseLease(@HostParam( @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, + Mono> renewLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @@ -638,7 +403,7 @@ Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase releaseLeaseSync(@HostParam("url") String url, + Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @@ -648,24 +413,24 @@ ResponseBase releaseLeaseSync(@HostParam("u @HeaderParam("Accept") String accept, Context context); @Put("/{containerName}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response releaseLeaseNoCustomHeadersSync(@HostParam("url") String url, + Mono> breakLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, + @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); @Put("/{containerName}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> renewLease(@HostParam("url") String url, + Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, + @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @@ -674,10 +439,11 @@ Mono> renewLease(@HostParam("url @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url, + Mono> changeLease(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @@ -686,140 +452,29 @@ Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url, @Put("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase renewLeaseSync(@HostParam("url") String url, + Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("comp") String comp, @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") + @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response renewLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, + Mono> listBlobFlatSegment( + @HostParam("url") String url, @PathParam("containerName") String containerName, + @QueryParam("restype") String restype, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, + @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, + @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> breakLease(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase breakLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response breakLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> changeLease(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase changeLeaseSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response changeLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("comp") String comp, - @QueryParam("restype") String restype, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> listBlobFlatSegment( - @HostParam("url") String url, @PathParam("containerName") String containerName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) + @Get("/{containerName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) Mono> listBlobFlatSegmentNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("restype") String restype, @@ -829,28 +484,6 @@ Mono> listBlobFlatSegmentNoCustomHeaders( @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase listBlobFlatSegmentSync( - @HostParam("url") String url, @PathParam("containerName") String containerName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response listBlobFlatSegmentNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -875,30 +508,6 @@ Mono> listBlobHierarchySegmentNoCust @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase - listBlobHierarchySegmentSync(@HostParam("url") String url, @PathParam("containerName") String containerName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("prefix") String prefix, @QueryParam("delimiter") String delimiter, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response listBlobHierarchySegmentNoCustomHeadersSync( - @HostParam("url") String url, @PathParam("containerName") String containerName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("delimiter") String delimiter, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Get("/{containerName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -914,22 +523,6 @@ Mono> getAccountInfoNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @QueryParam("restype") String restype, @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getAccountInfoSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getAccountInfoNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, - @HeaderParam("Accept") String accept, Context context); } /** @@ -1188,210 +781,81 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai } /** - * creates a new container under the specified account. If the container with the same name already exists, the - * operation fails. + * returns all user-defined metadata and system properties for the specified container. The data returned does not + * include the container's list of blobs. * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobContainerEncryptionScope Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String containerName, Integer timeout, - Map metadata, PublicAccessType access, String requestId, - BlobContainerEncryptionScope blobContainerEncryptionScope, Context context) { + public Mono> getPropertiesWithResponseAsync(String containerName, + Integer timeout, String leaseId, String requestId) { final String restype = "container"; final String accept = "application/xml"; - String defaultEncryptionScopeInternal = null; - if (blobContainerEncryptionScope != null) { - defaultEncryptionScopeInternal = blobContainerEncryptionScope.getDefaultEncryptionScope(); - } - String defaultEncryptionScope = defaultEncryptionScopeInternal; - Boolean encryptionScopeOverridePreventedInternal = null; - if (blobContainerEncryptionScope != null) { - encryptionScopeOverridePreventedInternal - = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); - } - Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - try { - return service.createSync(this.client.getUrl(), containerName, restype, timeout, metadata, access, - this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.getProperties(this.client.getUrl(), containerName, restype, timeout, + leaseId, this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * creates a new container under the specified account. If the container with the same name already exists, the - * operation fails. + * returns all user-defined metadata and system properties for the specified container. The data returned does not + * include the container's list of blobs. * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobContainerEncryptionScope Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String containerName, Integer timeout, Map metadata, PublicAccessType access, - String requestId, BlobContainerEncryptionScope blobContainerEncryptionScope) { - createWithResponse(containerName, timeout, metadata, access, requestId, blobContainerEncryptionScope, - Context.NONE); + public Mono> getPropertiesWithResponseAsync(String containerName, + Integer timeout, String leaseId, String requestId, Context context) { + final String restype = "container"; + final String accept = "application/xml"; + return service + .getProperties(this.client.getUrl(), containerName, restype, timeout, leaseId, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * creates a new container under the specified account. If the container with the same name already exists, the - * operation fails. + * returns all user-defined metadata and system properties for the specified container. The data returned does not + * include the container's list of blobs. * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobContainerEncryptionScope Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String containerName, Integer timeout, - Map metadata, PublicAccessType access, String requestId, - BlobContainerEncryptionScope blobContainerEncryptionScope, Context context) { - final String restype = "container"; - final String accept = "application/xml"; - String defaultEncryptionScopeInternal = null; - if (blobContainerEncryptionScope != null) { - defaultEncryptionScopeInternal = blobContainerEncryptionScope.getDefaultEncryptionScope(); - } - String defaultEncryptionScope = defaultEncryptionScopeInternal; - Boolean encryptionScopeOverridePreventedInternal = null; - if (blobContainerEncryptionScope != null) { - encryptionScopeOverridePreventedInternal - = blobContainerEncryptionScope.isEncryptionScopeOverridePrevented(); - } - Boolean encryptionScopeOverridePrevented = encryptionScopeOverridePreventedInternal; - try { - return service.createNoCustomHeadersSync(this.client.getUrl(), containerName, restype, timeout, metadata, - access, this.client.getVersion(), requestId, defaultEncryptionScope, encryptionScopeOverridePrevented, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String containerName, - Integer timeout, String leaseId, String requestId) { - final String restype = "container"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getProperties(this.client.getUrl(), containerName, restype, timeout, - leaseId, this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String containerName, - Integer timeout, String leaseId, String requestId, Context context) { - final String restype = "container"; - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), containerName, restype, timeout, leaseId, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String containerName, Integer timeout, String leaseId, String requestId) { - return getPropertiesWithResponseAsync(containerName, timeout, leaseId, requestId) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono getPropertiesAsync(String containerName, Integer timeout, String leaseId, String requestId) { + return getPropertiesWithResponseAsync(containerName, timeout, leaseId, requestId) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -1474,86 +938,6 @@ public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String containerName, - Integer timeout, String leaseId, String requestId, Context context) { - final String restype = "container"; - final String accept = "application/xml"; - try { - return service.getPropertiesSync(this.client.getUrl(), containerName, restype, timeout, leaseId, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String containerName, Integer timeout, String leaseId, String requestId) { - getPropertiesWithResponse(containerName, timeout, leaseId, requestId, Context.NONE); - } - - /** - * returns all user-defined metadata and system properties for the specified container. The data returned does not - * include the container's list of blobs. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String containerName, Integer timeout, - String leaseId, String requestId, Context context) { - final String restype = "container"; - final String accept = "application/xml"; - try { - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), containerName, restype, timeout, - leaseId, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * operation marks the specified container for deletion. The container and any blobs contained within it are later * deleted during garbage collection. @@ -1755,111 +1139,6 @@ public Mono> deleteNoCustomHeadersWithResponseAsync(String contai .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * operation marks the specified container for deletion. The container and any blobs contained within it are later - * deleted during garbage collection. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String containerName, Integer timeout, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - Context context) { - final String restype = "container"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.deleteSync(this.client.getUrl(), containerName, restype, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * operation marks the specified container for deletion. The container and any blobs contained within it are later - * deleted during garbage collection. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String containerName, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId) { - deleteWithResponse(containerName, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, requestId, - Context.NONE); - } - - /** - * operation marks the specified container for deletion. The container and any blobs contained within it are later - * deleted during garbage collection. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String containerName, Integer timeout, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - final String restype = "container"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.deleteNoCustomHeadersSync(this.client.getUrl(), containerName, restype, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * operation sets one or more user-defined name-value pairs for the specified container. * @@ -2078,136 +1357,27 @@ public Mono> setMetadataNoCustomHeadersWithResponseAsync(String c } /** - * operation sets one or more user-defined name-value pairs for the specified container. + * gets the permissions for the specified container. The permissions indicate whether container data may be accessed + * publicly. * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the permissions for the specified container along with {@link ResponseBase} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String containerName, - Integer timeout, String leaseId, Map metadata, OffsetDateTime ifModifiedSince, String requestId, - Context context) { + public Mono> + getAccessPolicyWithResponseAsync(String containerName, Integer timeout, String leaseId, String requestId) { final String restype = "container"; - final String comp = "metadata"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - try { - return service.setMetadataSync(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, - metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * operation sets one or more user-defined name-value pairs for the specified container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String containerName, Integer timeout, String leaseId, Map metadata, - OffsetDateTime ifModifiedSince, String requestId) { - setMetadataWithResponse(containerName, timeout, leaseId, metadata, ifModifiedSince, requestId, Context.NONE); - } - - /** - * operation sets one or more user-defined name-value pairs for the specified container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String containerName, Integer timeout, String leaseId, - Map metadata, OffsetDateTime ifModifiedSince, String requestId, Context context) { - final String restype = "container"; - final String comp = "metadata"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - try { - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, timeout, - leaseId, metadata, ifModifiedSinceConverted, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * gets the permissions for the specified container. The permissions indicate whether container data may be accessed - * publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the permissions for the specified container along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyWithResponseAsync(String containerName, Integer timeout, String leaseId, String requestId) { - final String restype = "container"; - final String comp = "acl"; + final String comp = "acl"; final String accept = "application/xml"; return FluxUtil .withContext(context -> service.getAccessPolicy(this.client.getUrl(), containerName, restype, comp, timeout, @@ -2354,94 +1524,6 @@ public Mono> getAccessPolicyNoCustomHeader .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * gets the permissions for the specified container. The permissions indicate whether container data may be accessed - * publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the permissions for the specified container along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getAccessPolicyWithResponse( - String containerName, Integer timeout, String leaseId, String requestId, Context context) { - final String restype = "container"; - final String comp = "acl"; - final String accept = "application/xml"; - try { - return service.getAccessPolicySync(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * gets the permissions for the specified container. The permissions indicate whether container data may be accessed - * publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the permissions for the specified container. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobSignedIdentifierWrapper getAccessPolicy(String containerName, Integer timeout, String leaseId, - String requestId) { - try { - return getAccessPolicyWithResponse(containerName, timeout, leaseId, requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * gets the permissions for the specified container. The permissions indicate whether container data may be accessed - * publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the permissions for the specified container along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccessPolicyNoCustomHeadersWithResponse(String containerName, - Integer timeout, String leaseId, String requestId, Context context) { - final String restype = "container"; - final String comp = "acl"; - final String accept = "application/xml"; - try { - return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, - timeout, leaseId, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be * accessed publicly. @@ -2673,123 +1755,6 @@ public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(Stri .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be - * accessed publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param containerAcl the acls for the container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setAccessPolicyWithResponse(String containerName, - Integer timeout, String leaseId, PublicAccessType access, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId, List containerAcl, Context context) { - final String restype = "container"; - final String comp = "acl"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - try { - return service.setAccessPolicySync(this.client.getUrl(), containerName, restype, comp, timeout, leaseId, - access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - containerAclConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be - * accessed publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param containerAcl the acls for the container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setAccessPolicy(String containerName, Integer timeout, String leaseId, PublicAccessType access, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - List containerAcl) { - setAccessPolicyWithResponse(containerName, timeout, leaseId, access, ifModifiedSince, ifUnmodifiedSince, - requestId, containerAcl, Context.NONE); - } - - /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a container may be - * accessed publicly. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param access Specifies whether data in the container may be accessed publicly and the level of access. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param containerAcl the acls for the container. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setAccessPolicyNoCustomHeadersWithResponse(String containerName, Integer timeout, - String leaseId, PublicAccessType access, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, List containerAcl, Context context) { - final String restype = "container"; - final String comp = "acl"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - BlobSignedIdentifierWrapper containerAclConverted = new BlobSignedIdentifierWrapper(containerAcl); - try { - return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, - timeout, leaseId, access, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, containerAclConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * Restores a previously-deleted container. * @@ -2969,111 +1934,21 @@ public Mono> restoreNoCustomHeadersWithResponseAsync(String conta } /** - * Restores a previously-deleted container. + * Renames an existing container. * * @param containerName The container name. + * @param sourceContainerName Required. Specifies the name of the container to rename. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param deletedContainerName Optional. Version 2019-12-12 and later. Specifies the name of the deleted container - * to restore. - * @param deletedContainerVersion Optional. Version 2019-12-12 and later. Specifies the version of the deleted - * container to restore. - * @param context The context to associate with this operation. + * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and + * the lease ID must match. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase restoreWithResponse(String containerName, Integer timeout, - String requestId, String deletedContainerName, String deletedContainerVersion, Context context) { - final String restype = "container"; - final String comp = "undelete"; - final String accept = "application/xml"; - try { - return service.restoreSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Restores a previously-deleted container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedContainerName Optional. Version 2019-12-12 and later. Specifies the name of the deleted container - * to restore. - * @param deletedContainerVersion Optional. Version 2019-12-12 and later. Specifies the version of the deleted - * container to restore. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restore(String containerName, Integer timeout, String requestId, String deletedContainerName, - String deletedContainerVersion) { - restoreWithResponse(containerName, timeout, requestId, deletedContainerName, deletedContainerVersion, - Context.NONE); - } - - /** - * Restores a previously-deleted container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedContainerName Optional. Version 2019-12-12 and later. Specifies the name of the deleted container - * to restore. - * @param deletedContainerVersion Optional. Version 2019-12-12 and later. Specifies the version of the deleted - * container to restore. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response restoreNoCustomHeadersWithResponse(String containerName, Integer timeout, String requestId, - String deletedContainerName, String deletedContainerVersion, Context context) { - final String restype = "container"; - final String comp = "undelete"; - final String accept = "application/xml"; - try { - return service.restoreNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedContainerName, deletedContainerVersion, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Renames an existing container. - * - * @param containerName The container name. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and - * the lease ID must match. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renameWithResponseAsync(String containerName, @@ -3227,92 +2102,6 @@ public Mono> renameNoCustomHeadersWithResponseAsync(String contai .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Renames an existing container. - * - * @param containerName The container name. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and - * the lease ID must match. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renameWithResponse(String containerName, - String sourceContainerName, Integer timeout, String requestId, String sourceLeaseId, Context context) { - final String restype = "container"; - final String comp = "rename"; - final String accept = "application/xml"; - try { - return service.renameSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Renames an existing container. - * - * @param containerName The container name. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and - * the lease ID must match. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rename(String containerName, String sourceContainerName, Integer timeout, String requestId, - String sourceLeaseId) { - renameWithResponse(containerName, sourceContainerName, timeout, requestId, sourceLeaseId, Context.NONE); - } - - /** - * Renames an existing container. - * - * @param containerName The container name. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sourceLeaseId A lease ID for the source path. If specified, the source path must have an active lease and - * the lease ID must match. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renameNoCustomHeadersWithResponse(String containerName, String sourceContainerName, - Integer timeout, String requestId, String sourceLeaseId, Context context) { - final String restype = "container"; - final String comp = "rename"; - final String accept = "application/xml"; - try { - return service.renameNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, sourceContainerName, sourceLeaseId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Batch operation allows multiple API calls to be embedded into a single HTTP request. * @@ -3667,103 +2456,6 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(String c .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param containerName The container name. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase submitBatchWithResponse(String containerName, - long contentLength, String multipartContentType, BinaryData body, Integer timeout, String requestId, - Context context) { - final String restype = "container"; - final String comp = "batch"; - final String accept = "application/xml"; - try { - return service.submitBatchSync(this.client.getUrl(), containerName, restype, comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param containerName The container name. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream submitBatch(String containerName, long contentLength, String multipartContentType, - BinaryData body, Integer timeout, String requestId) { - try { - return submitBatchWithResponse(containerName, contentLength, multipartContentType, body, timeout, requestId, - Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param containerName The container name. - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response submitBatchNoCustomHeadersWithResponse(String containerName, long contentLength, - String multipartContentType, BinaryData body, Integer timeout, String requestId, Context context) { - final String restype = "container"; - final String comp = "batch"; - final String accept = "application/xml"; - try { - return service.submitBatchNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, - contentLength, multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search * expression. Filter blobs searches within the given container. @@ -4022,171 +2714,37 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA } /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search - * expression. Filter blobs searches within the given container. + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 + * seconds, or can be infinite. * * @param containerName The container name. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. + * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never + * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or + * change. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) + * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID + * string formats. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call along with {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase filterBlobsWithResponse(String containerName, - Integer timeout, String requestId, String where, String marker, Integer maxresults, - List include, Context context) { + public Mono> acquireLeaseWithResponseAsync(String containerName, + Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String requestId) { + final String comp = "lease"; final String restype = "container"; - final String comp = "blobs"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.filterBlobsSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search - * expression. Filter blobs searches within the given container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FilterBlobSegment filterBlobs(String containerName, Integer timeout, String requestId, String where, - String marker, Integer maxresults, List include) { - try { - return filterBlobsWithResponse(containerName, timeout, requestId, where, marker, maxresults, include, - Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search - * expression. Filter blobs searches within the given container. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response filterBlobsNoCustomHeadersWithResponse(String containerName, Integer timeout, - String requestId, String where, String marker, Integer maxresults, List include, - Context context) { - final String restype = "container"; - final String comp = "blobs"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.filterBlobsNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, timeout, - this.client.getVersion(), requestId, where, marker, maxresults, includeConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseWithResponseAsync(String containerName, - Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId) { - final String comp = "lease"; - final String restype = "container"; - final String action = "acquire"; + final String action = "acquire"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); @@ -4370,452 +2928,7 @@ public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String * change. * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, - Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, duration, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase acquireLeaseWithResponse(String containerName, - Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.acquireLeaseSync(this.client.getUrl(), containerName, comp, restype, action, timeout, - duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void acquireLease(String containerName, Integer timeout, Integer duration, String proposedLeaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - acquireLeaseWithResponse(containerName, timeout, duration, proposedLeaseId, ifModifiedSince, ifUnmodifiedSince, - requestId, Context.NONE); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response acquireLeaseNoCustomHeadersWithResponse(String containerName, Integer timeout, - Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "acquire"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, comp, restype, action, - timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String containerName, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId) { - final String comp = "lease"; - final String restype = "container"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String containerName, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - final String comp = "lease"; - final String restype = "container"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, - restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase releaseLeaseWithResponse(String containerName, - String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "release"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.releaseLeaseSync(this.client.getUrl(), containerName, comp, restype, action, timeout, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void releaseLease(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId) { - releaseLeaseWithResponse(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, requestId, - Context.NONE); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. + * string formats. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -4826,26 +2939,25 @@ public void releaseLease(String containerName, String leaseId, Integer timeout, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response releaseLeaseNoCustomHeadersWithResponse(String containerName, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { + public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, + Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String requestId, Context context) { final String comp = "lease"; final String restype = "container"; - final String action = "release"; + final String action = "acquire"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, comp, restype, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .acquireLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, duration, + proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4869,19 +2981,19 @@ public Response releaseLeaseNoCustomHeadersWithResponse(String containerNa * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseWithResponseAsync(String containerName, + public Mono> releaseLeaseWithResponseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { final String comp = "lease"; final String restype = "container"; - final String action = "renew"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.renewLease(this.client.getUrl(), containerName, comp, restype, action, + .withContext(context -> service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -4909,18 +3021,18 @@ public Mono> renewLeaseWithRespo * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseWithResponseAsync(String containerName, + public Mono> releaseLeaseWithResponseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { final String comp = "lease"; final String restype = "container"; - final String action = "renew"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.renewLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + return service.releaseLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4946,9 +3058,9 @@ public Mono> renewLeaseWithRespo * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, + public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -4975,9 +3087,9 @@ public Mono renewLeaseAsync(String containerName, String leaseId, Integer * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, + public Mono releaseLeaseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + return releaseLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) .flatMap(ignored -> Mono.empty()); } @@ -5003,18 +3115,18 @@ public Mono renewLeaseAsync(String containerName, String leaseId, Integer * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, + public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { final String comp = "lease"; final String restype = "container"; - final String action = "renew"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + .withContext(context -> service.releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -5042,19 +3154,19 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, + public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { final String comp = "lease"; final String restype = "container"; - final String action = "renew"; + final String action = "release"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + .releaseLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); @@ -5075,16 +3187,15 @@ public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String co * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renewLeaseWithResponse(String containerName, String leaseId, - Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - Context context) { + public Mono> renewLeaseWithResponseAsync(String containerName, + String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String requestId) { final String comp = "lease"; final String restype = "container"; final String action = "renew"; @@ -5093,13 +3204,11 @@ public ResponseBase renewLeaseWithResponse(St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.renewLeaseSync(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.renewLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5117,15 +3226,27 @@ public ResponseBase renewLeaseWithResponse(St * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void renewLease(String containerName, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId) { - renewLeaseWithResponse(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, requestId, - Context.NONE); + public Mono> renewLeaseWithResponseAsync(String containerName, + String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String requestId, Context context) { + final String comp = "lease"; + final String restype = "container"; + final String action = "renew"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service.renewLease(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5143,30 +3264,17 @@ public void renewLease(String containerName, String leaseId, Integer timeout, Of * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewLeaseNoCustomHeadersWithResponse(String containerName, String leaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "renew"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.renewLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, comp, restype, action, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5174,43 +3282,28 @@ public Response renewLeaseNoCustomHeadersWithResponse(String containerName * seconds, or can be infinite. * * @param containerName The container name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String containerName, - Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId) { - final String comp = "lease"; - final String restype = "container"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.breakLease(this.client.getUrl(), containerName, comp, restype, action, - timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono renewLeaseAsync(String containerName, String leaseId, Integer timeout, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { + return renewLeaseWithResponseAsync(containerName, leaseId, timeout, ifModifiedSince, ifUnmodifiedSince, + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5218,41 +3311,36 @@ public Mono> breakLeaseWithRespo * seconds, or can be infinite. * * @param containerName The container name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String containerName, - Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { + public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, + Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { final String comp = "lease"; final String restype = "container"; - final String action = "break"; + final String action = "renew"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.breakLease(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) + return FluxUtil + .withContext(context -> service.renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5261,32 +3349,39 @@ public Mono> breakLeaseWithRespo * seconds, or can be infinite. * * @param containerName The container name. + * @param leaseId Specifies the current lease ID on the resource. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, - requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String containerName, String leaseId, + Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, + Context context) { + final String comp = "lease"; + final String restype = "container"; + final String action = "renew"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .renewLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5309,18 +3404,28 @@ public Mono breakLeaseAsync(String containerName, Integer timeout, Integer * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, - requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(ignored -> Mono.empty()); + public Mono> breakLeaseWithResponseAsync(String containerName, + Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String requestId) { + final String comp = "lease"; + final String restype = "container"; + final String action = "break"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.breakLease(this.client.getUrl(), containerName, comp, restype, action, + timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5343,14 +3448,16 @@ public Mono breakLeaseAsync(String containerName, Integer timeout, Integer * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, - Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + public Mono> breakLeaseWithResponseAsync(String containerName, + Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, + String requestId, Context context) { final String comp = "lease"; final String restype = "container"; final String action = "break"; @@ -5359,10 +3466,8 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, - restype, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context)) + return service.breakLease(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5386,29 +3491,17 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co * the specified date/time. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, - Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5435,27 +3528,14 @@ public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase breakLeaseWithResponse(String containerName, Integer timeout, - Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, - Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "break"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.breakLeaseSync(this.client.getUrl(), containerName, comp, restype, action, timeout, - breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, - accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono breakLeaseAsync(String containerName, Integer timeout, Integer breakPeriod, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { + return breakLeaseWithResponseAsync(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(ignored -> Mono.empty()); } /** @@ -5481,12 +3561,24 @@ public ResponseBase breakLeaseWithResponse(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void breakLease(String containerName, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId) { - breakLeaseWithResponse(containerName, timeout, breakPeriod, ifModifiedSince, ifUnmodifiedSince, requestId, - Context.NONE); + public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, + Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { + final String comp = "lease"; + final String restype = "container"; + final String action = "break"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, + restype, action, timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5513,10 +3605,10 @@ public void breakLease(String containerName, Integer timeout, Integer breakPerio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response breakLeaseNoCustomHeadersWithResponse(String containerName, Integer timeout, + public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String containerName, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { final String comp = "lease"; @@ -5527,13 +3619,11 @@ public Response breakLeaseNoCustomHeadersWithResponse(String containerName = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, comp, restype, action, - timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .breakLeaseNoCustomHeaders(this.client.getUrl(), containerName, comp, restype, action, timeout, breakPeriod, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5771,125 +3861,6 @@ public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String c .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase changeLeaseWithResponse(String containerName, - String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "change"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.changeLeaseSync(this.client.getUrl(), containerName, comp, restype, action, timeout, leaseId, - proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void changeLease(String containerName, String leaseId, String proposedLeaseId, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String requestId) { - changeLeaseWithResponse(containerName, leaseId, proposedLeaseId, timeout, ifModifiedSince, ifUnmodifiedSince, - requestId, Context.NONE); - } - - /** - * [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 - * seconds, or can be infinite. - * - * @param containerName The container name. - * @param leaseId Specifies the current lease ID on the resource. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response changeLeaseNoCustomHeadersWithResponse(String containerName, String leaseId, - String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String requestId, Context context) { - final String comp = "lease"; - final String restype = "container"; - final String action = "change"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), containerName, comp, restype, action, - timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * [Update] The List Blobs operation returns a list of the blobs under the specified container. * @@ -5928,126 +3899,11 @@ public Response changeLeaseNoCustomHeadersWithResponse(String containerNam : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, - prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, - context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listBlobFlatSegmentWithResponseAsync(String containerName, String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - final String restype = "container"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listBlobFlatSegmentAsync(String containerName, String prefix, - String marker, Integer maxresults, List include, Integer timeout, String requestId) { - return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, - requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listBlobFlatSegmentAsync(String containerName, String prefix, - String marker, Integer maxresults, List include, Integer timeout, String requestId, - Context context) { - return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, - requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return FluxUtil + .withContext(context -> service.listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, + prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, + context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6071,15 +3927,16 @@ public Mono listBlobFlatSegmentAsync(String contai * Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link Response} on successful completion of {@link Mono}. + * @return an enumeration of blobs along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobFlatSegmentNoCustomHeadersWithResponseAsync( - String containerName, String prefix, String marker, Integer maxresults, List include, - Integer timeout, String requestId) { + public Mono> + listBlobFlatSegmentWithResponseAsync(String containerName, String prefix, String marker, Integer maxresults, + List include, Integer timeout, String requestId, Context context) { final String restype = "container"; final String comp = "list"; final String accept = "application/xml"; @@ -6088,10 +3945,9 @@ public Mono> listBlobFlatSegmentNoCustomH : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, - restype, comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), - requestId, accept, context)) + return service + .listBlobFlatSegment(this.client.getUrl(), containerName, restype, comp, prefix, marker, maxresults, + includeConverted, timeout, this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -6116,28 +3972,17 @@ public Mono> listBlobFlatSegmentNoCustomH * Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link Response} on successful completion of {@link Mono}. + * @return an enumeration of blobs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobFlatSegmentNoCustomHeadersWithResponseAsync( - String containerName, String prefix, String marker, Integer maxresults, List include, - Integer timeout, String requestId, Context context) { - final String restype = "container"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono listBlobFlatSegmentAsync(String containerName, String prefix, + String marker, Integer maxresults, List include, Integer timeout, String requestId) { + return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, + requestId).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -6165,26 +4010,15 @@ public Mono> listBlobFlatSegmentNoCustomH * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link ResponseBase}. + * @return an enumeration of blobs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - listBlobFlatSegmentWithResponse(String containerName, String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - final String restype = "container"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.listBlobFlatSegmentSync(this.client.getUrl(), containerName, restype, comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono listBlobFlatSegmentAsync(String containerName, String prefix, + String marker, Integer maxresults, List include, Integer timeout, String requestId, + Context context) { + return listBlobFlatSegmentWithResponseAsync(containerName, prefix, marker, maxresults, include, timeout, + requestId, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -6211,17 +4045,25 @@ public Mono> listBlobFlatSegmentNoCustomH * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs. + * @return an enumeration of blobs along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ListBlobsFlatSegmentResponse listBlobFlatSegment(String containerName, String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId) { - try { - return listBlobFlatSegmentWithResponse(containerName, prefix, marker, maxresults, include, timeout, - requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono> listBlobFlatSegmentNoCustomHeadersWithResponseAsync( + String containerName, String prefix, String marker, Integer maxresults, List include, + Integer timeout, String requestId) { + final String restype = "container"; + final String comp = "list"; + final String accept = "application/xml"; + String includeConverted = (include == null) + ? null + : include.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")); + return FluxUtil + .withContext(context -> service.listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, + restype, comp, prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6249,12 +4091,12 @@ public ListBlobsFlatSegmentResponse listBlobFlatSegment(String containerName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link Response}. + * @return an enumeration of blobs along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBlobFlatSegmentNoCustomHeadersWithResponse(String containerName, - String prefix, String marker, Integer maxresults, List include, Integer timeout, - String requestId, Context context) { + public Mono> listBlobFlatSegmentNoCustomHeadersWithResponseAsync( + String containerName, String prefix, String marker, Integer maxresults, List include, + Integer timeout, String requestId, Context context) { final String restype = "container"; final String comp = "list"; final String accept = "application/xml"; @@ -6263,13 +4105,10 @@ public Response listBlobFlatSegmentNoCustomHeaders : include.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - try { - return service.listBlobFlatSegmentNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, - prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .listBlobFlatSegmentNoCustomHeaders(this.client.getUrl(), containerName, restype, comp, prefix, marker, + maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6544,150 +4383,6 @@ public Mono> listBlobHierarchySegmen .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the - * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the - * appearance of the delimiter character. The delimiter may be a single character or a string. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - listBlobHierarchySegmentWithResponse(String containerName, String delimiter, String prefix, String marker, - Integer maxresults, List include, Integer timeout, String requestId, - Context context) { - final String restype = "container"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.listBlobHierarchySegmentSync(this.client.getUrl(), containerName, restype, comp, prefix, - delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), requestId, accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the - * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the - * appearance of the delimiter character. The delimiter may be a single character or a string. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListBlobsHierarchySegmentResponse listBlobHierarchySegment(String containerName, String delimiter, - String prefix, String marker, Integer maxresults, List include, Integer timeout, - String requestId) { - try { - return listBlobHierarchySegmentWithResponse(containerName, delimiter, prefix, marker, maxresults, include, - timeout, requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container. - * - * @param containerName The container name. - * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix element in the - * response body that acts as a placeholder for all blobs whose names begin with the same substring up to the - * appearance of the delimiter character. The delimiter may be a single character or a string. - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listBlobHierarchySegmentNoCustomHeadersWithResponse( - String containerName, String delimiter, String prefix, String marker, Integer maxresults, - List include, Integer timeout, String requestId, Context context) { - final String restype = "container"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.listBlobHierarchySegmentNoCustomHeadersSync(this.client.getUrl(), containerName, restype, - comp, prefix, delimiter, marker, maxresults, includeConverted, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * Returns the sku name and account kind. * @@ -6804,64 +4499,4 @@ public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Strin accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getAccountInfoWithResponse(String containerName, - Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.getAccountInfoSync(this.client.getUrl(), containerName, restype, comp, - this.client.getVersion(), accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getAccountInfo(String containerName) { - getAccountInfoWithResponse(containerName, Context.NONE); - } - - /** - * Returns the sku name and account kind. - * - * @param containerName The container name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccountInfoNoCustomHeadersWithResponse(String containerName, Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.getAccountInfoNoCustomHeadersSync(this.client.getUrl(), containerName, restype, comp, - this.client.getVersion(), accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 24a25a6b8a70e..f68cf7adea5ae 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -143,66 +143,6 @@ Mono> createNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-access-tier") PremiumPageBlobAccessTier tier, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, - @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-access-tier") PremiumPageBlobAccessTier tier, - @HeaderParam("x-ms-blob-content-type") String contentType, - @HeaderParam("x-ms-blob-content-encoding") String contentEncoding, - @HeaderParam("x-ms-blob-content-language") String contentLanguage, - @HeaderParam("x-ms-blob-content-md5") String contentMd5, - @HeaderParam("x-ms-blob-cache-control") String cacheControl, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-blob-content-disposition") String contentDisposition, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, - @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-tags") String blobTagsString, - @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, - @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, - @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -303,56 +243,6 @@ Mono> uploadPagesNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase uploadPagesSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response uploadPagesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-MD5") String transactionalContentMD5, - @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -397,50 +287,6 @@ Mono> clearPagesNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase clearPagesSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response clearPagesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -499,64 +345,6 @@ Mono> uploadPagesFromURLNoCustomHeaders(@HostParam("url") String @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase uploadPagesFromURLSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("x-ms-copy-source") String sourceUrl, @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, - @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response uploadPagesFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, - @HeaderParam("x-ms-copy-source") String sourceUrl, @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-source-content-md5") String sourceContentMD5, - @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, - @HeaderParam("Content-Length") long contentLength, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-if-sequence-number-le") Long ifSequenceNumberLessThanOrEqualTo, - @HeaderParam("x-ms-if-sequence-number-lt") Long ifSequenceNumberLessThan, - @HeaderParam("x-ms-if-sequence-number-eq") Long ifSequenceNumberEqualTo, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, - @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, - @HeaderParam("x-ms-source-if-match") String sourceIfMatch, - @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -587,36 +375,6 @@ Mono> getPageRangesNoCustomHeaders(@HostParam("url") String u @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getPageRangesSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - - @Get("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getPageRangesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -649,93 +407,27 @@ Mono> getPageRangesDiffNoCustomHeaders(@HostParam("url") Stri @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") + @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getPageRangesDiffSync(@HostParam("url") String url, + Mono> resize(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, - @HeaderParam("x-ms-previous-snapshot-url") String prevSnapshotUrl, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, + @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, + @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, + @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, + @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("Accept") String accept, Context context); - @Get("/{containerName}/{blob}") + @Put("/{containerName}/{blob}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getPageRangesDiffNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot, - @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, - @HeaderParam("x-ms-previous-snapshot-url") String prevSnapshotUrl, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> resize(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Mono> resizeNoCustomHeaders(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase resizeSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, - @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, - @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, - @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-blob-content-length") long blobContentLength, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response resizeNoCustomHeadersSync(@HostParam("url") String url, + Mono> resizeNoCustomHeaders(@HostParam("url") String url, @PathParam("containerName") String containerName, @PathParam("blob") String blob, @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-encryption-key") String encryptionKey, @@ -781,38 +473,6 @@ Mono> updateSequenceNumberNoCustomHeaders(@HostParam("url") Strin @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase updateSequenceNumberSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-sequence-number-action") SequenceNumberActionType sequenceNumberAction, - @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response updateSequenceNumberNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-sequence-number-action") SequenceNumberActionType sequenceNumberAction, - @HeaderParam("x-ms-blob-sequence-number") Long blobSequenceNumber, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - @Put("/{containerName}/{blob}") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -838,32 +498,6 @@ Mono> copyIncrementalNoCustomHeaders(@HostParam("url") String url @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase copyIncrementalSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{containerName}/{blob}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response copyIncrementalNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("containerName") String containerName, @PathParam("blob") String blob, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); } /** @@ -1459,24 +1093,25 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai } /** - * The Create operation creates a new page blob. + * The Upload Pages operation writes a range of pages to a page blob. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param tier Optional. Indicates the tier to be set on the page blob. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. + * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence + * number less than or equal to the specified. + * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number + * less than the specified. + * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified + * sequence number. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -1484,63 +1119,25 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String containerName, String blob, - long contentLength, long blobContentLength, Integer timeout, PremiumPageBlobAccessTier tier, - Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, Long blobSequenceNumber, String requestId, - String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "PageBlob"; + public Mono> uploadPagesWithResponseAsync(String containerName, + String blob, long contentLength, Flux body, byte[] transactionalContentMD5, + byte[] transactionalContentCrc64, Integer timeout, String range, String leaseId, + Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { + final String comp = "page"; + final String pageWrite = "update"; final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; String encryptionKeyInternal = null; if (cpkInfo != null) { encryptionKeyInternal = cpkInfo.getEncryptionKey(); @@ -1561,44 +1158,42 @@ public ResponseBase createWithResponse(String cont encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); + String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); + String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.createSync(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength, tier, - contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId, - contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, - blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, pageWrite, + contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, + leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, body, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Create operation creates a new page blob. + * The Upload Pages operation writes a range of pages to a page blob. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. + * @param body Initial data. + * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. + * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param tier Optional. Indicates the tier to be set on the page blob. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. + * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence + * number less than or equal to the specified. + * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number + * less than the specified. + * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified + * sequence number. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the * specified date/time. * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since @@ -1606,273 +1201,15 @@ public ResponseBase createWithResponse(String cont * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String containerName, String blob, long contentLength, long blobContentLength, Integer timeout, - PremiumPageBlobAccessTier tier, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, Long blobSequenceNumber, - String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry, - BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - createWithResponse(containerName, blob, contentLength, blobContentLength, timeout, tier, metadata, leaseId, - ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId, - blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, - encryptionScopeParam, Context.NONE); - } - - /** - * The Create operation creates a new page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param tier Optional. Indicates the tier to be set on the page blob. - * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value - * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. - * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and - * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names - * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata - * for more information. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param blobTagsString Optional. Used to set blob tags in various blob operations. - * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. - * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. - * @param legalHold Specified if a legal hold should be set on the blob. - * @param blobHttpHeaders Parameter group. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - long blobContentLength, Integer timeout, PremiumPageBlobAccessTier tier, Map metadata, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, Long blobSequenceNumber, String requestId, String blobTagsString, - OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, - BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String blobType = "PageBlob"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (blobHttpHeaders != null) { - contentTypeInternal = blobHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (blobHttpHeaders != null) { - contentEncodingInternal = blobHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (blobHttpHeaders != null) { - contentLanguageInternal = blobHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - byte[] contentMd5Internal = null; - if (blobHttpHeaders != null) { - contentMd5Internal = blobHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String cacheControlInternal = null; - if (blobHttpHeaders != null) { - cacheControlInternal = blobHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - String contentDispositionInternal = null; - if (blobHttpHeaders != null) { - contentDispositionInternal = blobHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 immutabilityPolicyExpiryConverted - = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry); - try { - return service.createNoCustomHeadersSync(this.client.getUrl(), containerName, blob, blobType, timeout, - contentLength, tier, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, - metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, - immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Upload Pages operation writes a range of pages to a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadPagesWithResponseAsync(String containerName, - String blob, long contentLength, Flux body, byte[] transactionalContentMD5, - byte[] transactionalContentCrc64, Integer timeout, String range, String leaseId, - Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "page"; - final String pageWrite = "update"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.uploadPages(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Upload Pages operation writes a range of pages to a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> uploadPagesWithResponseAsync(String containerName, @@ -2614,14 +1951,11 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c } /** - * The Upload Pages operation writes a range of pages to a page blob. + * The Clear Pages operation clears a set of pages from a page blob. * * @param containerName The container name. * @param blob The blob name. * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -2644,21 +1978,19 @@ public Mono> uploadPagesNoCustomHeadersWithResponseAsync(String c * analytics logs when storage analytics logging is enabled. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase uploadPagesWithResponse(String containerName, String blob, - long contentLength, BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, - Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, - Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + public Mono> clearPagesWithResponseAsync(String containerName, + String blob, long contentLength, Integer timeout, String range, String leaseId, + Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "page"; - final String pageWrite = "update"; + final String pageWrite = "clear"; final String accept = "application/xml"; String encryptionKeyInternal = null; if (cpkInfo != null) { @@ -2680,233 +2012,21 @@ public ResponseBase uploadPagesWithResponse(S encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.uploadPagesSync(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, - transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + return FluxUtil + .withContext(context -> service.clearPages(this.client.getUrl(), containerName, blob, comp, pageWrite, + contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Upload Pages operation writes a range of pages to a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadPages(String containerName, String blob, long contentLength, BinaryData body, - byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, String range, String leaseId, - Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - uploadPagesWithResponse(containerName, blob, contentLength, body, transactionalContentMD5, - transactionalContentCrc64, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Upload Pages operation writes a range of pages to a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param body Initial data. - * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service. - * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadPagesNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - BinaryData body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, Integer timeout, - String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, - Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, - Context context) { - final String comp = "page"; - final String pageWrite = "update"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); - String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.uploadPagesNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, - leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Clear Pages operation clears a set of pages from a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> clearPagesWithResponseAsync(String containerName, - String blob, long contentLength, Integer timeout, String range, String leaseId, - Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "page"; - final String pageWrite = "clear"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.clearPages(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Clear Pages operation clears a set of pages from a page blob. + * The Clear Pages operation clears a set of pages from a page blob. * * @param containerName The container name. * @param blob The blob name. @@ -3225,15 +2345,22 @@ public Mono> clearPagesNoCustomHeadersWithResponseAsync(String co } /** - * The Clear Pages operation clears a set of pages from a page blob. + * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. * * @param containerName The container name. * @param blob The blob name. + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. The length of this range should match the + * ContentLength header and x-ms-range/Range destination range header. * @param contentLength The length of the request. + * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and + * range-end is required. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy + * source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence * number less than or equal to the specified. @@ -3248,24 +2375,34 @@ public Mono> clearPagesNoCustomHeadersWithResponseAsync(String co * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since + * the specified date/time. + * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified + * since the specified date/time. + * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. + * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase clearPagesWithResponse(String containerName, String blob, - long contentLength, Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, - Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { + public Mono> uploadPagesFromURLWithResponseAsync( + String containerName, String blob, String sourceUrl, String sourceRange, long contentLength, String range, + byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, + Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, + String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { final String comp = "page"; - final String pageWrite = "clear"; + final String pageWrite = "update"; final String accept = "application/xml"; String encryptionKeyInternal = null; if (cpkInfo != null) { @@ -3287,256 +2424,41 @@ public ResponseBase clearPagesWithResponse(Str encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); } String encryptionScope = encryptionScopeInternal; + String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); + String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.clearPagesSync(this.client.getUrl(), containerName, blob, comp, pageWrite, contentLength, - timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + DateTimeRfc1123 sourceIfModifiedSinceConverted + = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); + DateTimeRfc1123 sourceIfUnmodifiedSinceConverted + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + return FluxUtil + .withContext(context -> service.uploadPagesFromURL(this.client.getUrl(), containerName, blob, comp, + pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, + contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The Clear Pages operation clears a set of pages from a page blob. + * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. * * @param containerName The container name. * @param blob The blob name. + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. The length of this range should match the + * ContentLength header and x-ms-range/Range destination range header. * @param contentLength The length of the request. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void clearPages(String containerName, String blob, long contentLength, Integer timeout, String range, - String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, - Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - clearPagesWithResponse(containerName, blob, contentLength, timeout, range, leaseId, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Clear Pages operation clears a set of pages from a page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param contentLength The length of the request. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response clearPagesNoCustomHeadersWithResponse(String containerName, String blob, long contentLength, - Integer timeout, String range, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, - Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "page"; - final String pageWrite = "clear"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.clearPagesNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, pageWrite, - contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should match the - * ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and - * range-end is required. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadPagesFromURLWithResponseAsync( - String containerName, String blob, String sourceUrl, String sourceRange, long contentLength, String range, - byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, String leaseId, - Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - final String comp = "page"; - final String pageWrite = "update"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return FluxUtil - .withContext(context -> service.uploadPagesFromURL(this.client.getUrl(), containerName, blob, comp, - pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, - contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should match the - * ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and - * range-end is required. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. + * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and + * range-end is required. + * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. + * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy + * source. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -3947,500 +2869,16 @@ public Mono> uploadPagesFromURLNoCustomHeadersWithResponseAsync(S DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - return service - .uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, - sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should match the - * ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and - * range-end is required. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase uploadPagesFromURLWithResponse(String containerName, - String blob, String sourceUrl, String sourceRange, long contentLength, String range, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, - Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "page"; - final String pageWrite = "update"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.uploadPagesFromURLSync(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, - sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, - ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should match the - * ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and - * range-end is required. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadPagesFromURL(String containerName, String blob, String sourceUrl, String sourceRange, - long contentLength, String range, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout, - String leaseId, Long ifSequenceNumberLessThanOrEqualTo, Long ifSequenceNumberLessThan, - Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, - String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - uploadPagesFromURLWithResponse(containerName, blob, sourceUrl, sourceRange, contentLength, range, - sourceContentMD5, sourceContentcrc64, timeout, leaseId, ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, - copySourceAuthorization, cpkInfo, encryptionScopeParam, Context.NONE); - } - - /** - * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sourceUrl Specify a URL to the copy source. - * @param sourceRange Bytes of source data in the specified range. The length of this range should match the - * ContentLength header and x-ms-range/Range destination range header. - * @param contentLength The length of the request. - * @param range The range of bytes to which the source range would be written. The range should be 512 aligned and - * range-end is required. - * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source. - * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifSequenceNumberLessThanOrEqualTo Specify this header value to operate only on a blob if it has a sequence - * number less than or equal to the specified. - * @param ifSequenceNumberLessThan Specify this header value to operate only on a blob if it has a sequence number - * less than the specified. - * @param ifSequenceNumberEqualTo Specify this header value to operate only on a blob if it has the specified - * sequence number. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since - * the specified date/time. - * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified - * since the specified date/time. - * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value. - * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadPagesFromURLNoCustomHeadersWithResponse(String containerName, String blob, - String sourceUrl, String sourceRange, long contentLength, String range, byte[] sourceContentMD5, - byte[] sourceContentcrc64, Integer timeout, String leaseId, Long ifSequenceNumberLessThanOrEqualTo, - Long ifSequenceNumberLessThan, Long ifSequenceNumberEqualTo, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, - OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, - String sourceIfNoneMatch, String requestId, String copySourceAuthorization, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { - final String comp = "page"; - final String pageWrite = "update"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); - String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - DateTimeRfc1123 sourceIfModifiedSinceConverted - = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince); - DateTimeRfc1123 sourceIfUnmodifiedSinceConverted - = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); - try { - return service.uploadPagesFromURLNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - pageWrite, sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, - contentLength, timeout, range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, - this.client.getVersion(), requestId, copySourceAuthorization, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a - * page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesWithResponseAsync( - String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String marker, Integer maxresults) { - final String comp = "pagelist"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, - timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a - * page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesWithResponseAsync( - String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String marker, Integer maxresults, Context context) { - final String comp = "pagelist"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, marker, maxresults, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a - * page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesAsync(String containerName, String blob, String snapshot, Integer timeout, - String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults) { - return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a - * page blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesAsync(String containerName, String blob, String snapshot, Integer timeout, - String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { - return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince); + return service + .uploadPagesFromURLNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, pageWrite, sourceUrl, + sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, + encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, + ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, + this.client.getVersion(), requestId, copySourceAuthorization, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -4480,13 +2918,13 @@ public Mono getPageRangesAsync(String containerName, String blob, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. + * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults) { + public Mono> getPageRangesWithResponseAsync( + String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, String marker, Integer maxresults) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted @@ -4494,9 +2932,9 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return FluxUtil - .withContext(context -> service.getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) + .withContext(context -> service.getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, + timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, + ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4538,13 +2976,13 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. + * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults, Context context) { + public Mono> getPageRangesWithResponseAsync( + String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, String marker, Integer maxresults, Context context) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted @@ -4552,8 +2990,8 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service - .getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + .getPageRanges(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, leaseId, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4592,30 +3030,19 @@ public Mono> getPageRangesNoCustomHeadersWithResponseAsync(St * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link ResponseBase}. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPageRangesWithResponse(String containerName, - String blob, String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults, Context context) { - final String comp = "pagelist"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPageRangesSync(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, - leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - this.client.getVersion(), requestId, marker, maxresults, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono getPageRangesAsync(String containerName, String blob, String snapshot, Integer timeout, + String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults) { + return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4652,22 +3079,20 @@ public ResponseBase getPageRangesWithRe * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PageList getPageRanges(String containerName, String blob, String snapshot, Integer timeout, String range, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults) { - try { - return getPageRangesWithResponse(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults, Context.NONE) - .getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono getPageRangesAsync(String containerName, String blob, String snapshot, Integer timeout, + String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, + String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { + return getPageRangesWithResponseAsync(containerName, blob, snapshot, timeout, range, leaseId, ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, maxresults, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -4704,35 +3129,32 @@ public PageList getPageRanges(String containerName, String blob, String snapshot * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response}. + * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPageRangesNoCustomHeadersWithResponse(String containerName, String blob, + public Mono> getPageRangesNoCustomHeadersWithResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults, Context context) { + String marker, Integer maxresults) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPageRangesNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, snapshot, - timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, - ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot or version. + * The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a + * page blob. * * @param containerName The container name. * @param blob The blob name. @@ -4743,14 +3165,6 @@ public Response getPageRangesNoCustomHeadersWithResponse(String contai * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. - * @param prevsnapshot Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that - * specifies that the response will contain only pages that were changed between target blob and previous snapshot. - * Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot - * specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only - * for blobs created on or after January 1, 2016. - * @param prevSnapshotUrl Optional. This header is only supported in service versions 2019-04-19 and after and - * specifies the URL of a previous snapshot of the target blob. The response will only contain pages that were - * changed between the target blob and its previous snapshot. * @param range Return only the bytes of the blob in the specified range. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the @@ -4772,28 +3186,27 @@ public Response getPageRangesNoCustomHeadersWithResponse(String contai * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffWithResponseAsync( - String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, - String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, + public Mono> getPageRangesNoCustomHeadersWithResponseAsync(String containerName, String blob, + String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults) { + String marker, Integer maxresults, Context context) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, - timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, - maxresults, accept, context)) + return service + .getPageRangesNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, range, + leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, + this.client.getVersion(), requestId, marker, maxresults, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -4839,7 +3252,6 @@ public Mono> getPageRa * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4850,78 +3262,21 @@ public Mono> getPageRa String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults, Context context) { + String marker, Integer maxresults) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, prevsnapshot, - prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, - ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) + return FluxUtil + .withContext(context -> service.getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, + timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, + maxresults, accept, context)) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot or version. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param prevsnapshot Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that - * specifies that the response will contain only pages that were changed between target blob and previous snapshot. - * Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot - * specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only - * for blobs created on or after January 1, 2016. - * @param prevSnapshotUrl Optional. This header is only supported in service versions 2019-04-19 and after and - * specifies the URL of a previous snapshot of the target blob. The response will only contain pages that were - * changed between the target blob and its previous snapshot. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesDiffAsync(String containerName, String blob, String snapshot, Integer timeout, - String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults) { - return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, - range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, - maxresults).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - /** * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were * changed between target blob and previous snapshot or version. @@ -4968,82 +3323,24 @@ public Mono getPageRangesDiffAsync(String containerName, String blob, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages on successful completion of {@link Mono}. + * @return the list of pages along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesDiffAsync(String containerName, String blob, String snapshot, Integer timeout, - String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, + public Mono> getPageRangesDiffWithResponseAsync( + String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, + String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { - return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, - range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, - maxresults, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * [Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were - * changed between target blob and previous snapshot or version. - * - * @param containerName The container name. - * @param blob The blob name. - * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob - * snapshot to retrieve. For more information on working with blob snapshots, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating - * a Snapshot of a Blob.</a>. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param prevsnapshot Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that - * specifies that the response will contain only pages that were changed between target blob and previous snapshot. - * Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot - * specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only - * for blobs created on or after January 1, 2016. - * @param prevSnapshotUrl Optional. This header is only supported in service versions 2019-04-19 and after and - * specifies the URL of a previous snapshot of the target blob. The response will only contain pages that were - * changed between the target blob and its previous snapshot. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String marker, Integer maxresults) { final String comp = "pagelist"; final String accept = "application/xml"; DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, - comp, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, - maxresults, accept, context)) + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service + .getPageRangesDiff(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, prevsnapshot, + prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, + ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } @@ -5089,28 +3386,20 @@ public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsyn * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving * the remainder of the results. For this reason, it is possible that the service will return fewer results than * specified by maxresults, or than the default of 5000. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsync(String containerName, String blob, - String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, String marker, Integer maxresults, Context context) { - final String comp = "pagelist"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, - prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); + public Mono getPageRangesDiffAsync(String containerName, String blob, String snapshot, Integer timeout, + String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + String marker, Integer maxresults) { + return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, + range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, + maxresults).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -5159,26 +3448,17 @@ public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link ResponseBase}. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPageRangesDiffWithResponse(String containerName, - String blob, String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { - final String comp = "pagelist"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPageRangesDiffSync(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, - prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, - ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono getPageRangesDiffAsync(String containerName, String blob, String snapshot, Integer timeout, + String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + String marker, Integer maxresults, Context context) { + return getPageRangesDiffWithResponseAsync(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, + range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, + maxresults, context).onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -5226,20 +3506,25 @@ public ResponseBase getPageRangesDi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages. + * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PageList getPageRangesDiff(String containerName, String blob, String snapshot, Integer timeout, - String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - String marker, Integer maxresults) { - try { - return getPageRangesDiffWithResponse(containerName, blob, snapshot, timeout, prevsnapshot, prevSnapshotUrl, - range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, marker, - maxresults, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsync(String containerName, String blob, + String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, + OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, + String ifTags, String requestId, String marker, Integer maxresults) { + final String comp = "pagelist"; + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, + comp, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, + maxresults, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5288,10 +3573,10 @@ public PageList getPageRangesDiff(String containerName, String blob, String snap * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages along with {@link Response}. + * @return the list of pages along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPageRangesDiffNoCustomHeadersWithResponse(String containerName, String blob, + public Mono> getPageRangesDiffNoCustomHeadersWithResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, String prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, String marker, Integer maxresults, Context context) { @@ -5301,14 +3586,11 @@ public Response getPageRangesDiffNoCustomHeadersWithResponse(String co = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.getPageRangesDiffNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, - maxresults, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .getPageRangesDiffNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, snapshot, timeout, + prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, + ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, marker, maxresults, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5569,191 +3851,21 @@ public Mono> resizeNoCustomHeadersWithResponseAsync(String contai encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); } EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return FluxUtil - .withContext(context -> service.resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, - timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Resize the Blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> resizeNoCustomHeadersWithResponseAsync(String containerName, String blob, - long blobContentLength, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service - .resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Resize the Blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase resizeWithResponse(String containerName, String blob, - long blobContentLength, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String encryptionKeyInternal = null; - if (cpkInfo != null) { - encryptionKeyInternal = cpkInfo.getEncryptionKey(); - } - String encryptionKey = encryptionKeyInternal; - String encryptionKeySha256Internal = null; - if (cpkInfo != null) { - encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256(); - } - String encryptionKeySha256 = encryptionKeySha256Internal; - EncryptionAlgorithmType encryptionAlgorithmInternal = null; - if (cpkInfo != null) { - encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm(); - } - EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal; - String encryptionScopeInternal = null; - if (encryptionScopeParam != null) { - encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); - } - String encryptionScope = encryptionScopeInternal; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.resizeSync(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, - encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Resize the Blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The page blob size - * must be aligned to a 512-byte boundary. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param cpkInfo Parameter group. - * @param encryptionScopeParam Parameter group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void resize(String containerName, String blob, long blobContentLength, Integer timeout, String leaseId, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) { - resizeWithResponse(containerName, blob, blobContentLength, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE); + String encryptionScopeInternal = null; + if (encryptionScopeParam != null) { + encryptionScopeInternal = encryptionScopeParam.getEncryptionScope(); + } + String encryptionScope = encryptionScopeInternal; + DateTimeRfc1123 ifModifiedSinceConverted + = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted + = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return FluxUtil + .withContext(context -> service.resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, + timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, + ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -5782,13 +3894,13 @@ public void resize(String containerName, String blob, long blobContentLength, In * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response resizeNoCustomHeadersWithResponse(String containerName, String blob, long blobContentLength, - Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, - EncryptionScope encryptionScopeParam, Context context) { + public Mono> resizeNoCustomHeadersWithResponseAsync(String containerName, String blob, + long blobContentLength, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, + CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) { final String comp = "properties"; final String accept = "application/xml"; String encryptionKeyInternal = null; @@ -5815,14 +3927,12 @@ public Response resizeNoCustomHeadersWithResponse(String containerName, St = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.resizeNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, - encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, + return service + .resizeNoCustomHeaders(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, encryptionKey, + encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, blobContentLength, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -6091,139 +4201,6 @@ public Mono> updateSequenceNumberNoCustomHeadersWithResponseAsync .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Update the sequence number of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This - * property applies to page blobs only. This property indicates how the service should modify the blob's sequence - * number. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase updateSequenceNumberWithResponse( - String containerName, String blob, SequenceNumberActionType sequenceNumberAction, Integer timeout, - String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, - String ifNoneMatch, String ifTags, Long blobSequenceNumber, String requestId, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.updateSequenceNumberSync(this.client.getUrl(), containerName, blob, comp, timeout, leaseId, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Update the sequence number of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This - * property applies to page blobs only. This property indicates how the service should modify the blob's sequence - * number. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSequenceNumber(String containerName, String blob, SequenceNumberActionType sequenceNumberAction, - Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, Long blobSequenceNumber, String requestId) { - updateSequenceNumberWithResponse(containerName, blob, sequenceNumberAction, timeout, leaseId, ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, requestId, Context.NONE); - } - - /** - * Update the sequence number of the blob. - * - * @param containerName The container name. - * @param blob The blob name. - * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. This - * property applies to page blobs only. This property indicates how the service should modify the blob's sequence - * number. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param blobSequenceNumber Set for page blobs only. The sequence number is a user-controlled value that you can - * use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSequenceNumberNoCustomHeadersWithResponse(String containerName, String blob, - SequenceNumberActionType sequenceNumberAction, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, Long blobSequenceNumber, - String requestId, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.updateSequenceNumberNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, - timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, - sequenceNumberAction, blobSequenceNumber, this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot * is copied such that only the differential changes between the previously copied snapshot are transferred to the @@ -6483,136 +4460,4 @@ public Mono> copyIncrementalNoCustomHeadersWithResponseAsync(Stri this.client.getVersion(), requestId, accept, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - - /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot - * is copied such that only the differential changes between the previously copied snapshot are transferred to the - * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as - * usual. This API is supported since REST version 2016-05-31. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase copyIncrementalWithResponse(String containerName, - String blob, String copySource, Integer timeout, OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId, - Context context) { - final String comp = "incrementalcopy"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.copyIncrementalSync(this.client.getUrl(), containerName, blob, comp, timeout, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot - * is copied such that only the differential changes between the previously copied snapshot are transferred to the - * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as - * usual. This API is supported since REST version 2016-05-31. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void copyIncremental(String containerName, String blob, String copySource, Integer timeout, - OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, - String ifTags, String requestId) { - copyIncrementalWithResponse(containerName, blob, copySource, timeout, ifModifiedSince, ifUnmodifiedSince, - ifMatch, ifNoneMatch, ifTags, requestId, Context.NONE); - } - - /** - * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot - * is copied such that only the differential changes between the previously copied snapshot are transferred to the - * destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as - * usual. This API is supported since REST version 2016-05-31. - * - * @param containerName The container name. - * @param blob The blob name. - * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in - * length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. - * The source blob must either be public or must be authenticated via a shared access signature. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response copyIncrementalNoCustomHeadersWithResponse(String containerName, String blob, - String copySource, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, - String ifMatch, String ifNoneMatch, String ifTags, String requestId, Context context) { - final String comp = "incrementalcopy"; - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted - = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted - = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - try { - return service.copyIncrementalNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout, - ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java index f8e2a34907182..c249cabb2bff2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java @@ -18,7 +18,6 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; @@ -47,7 +46,6 @@ import com.azure.storage.blob.models.KeyInfo; import com.azure.storage.blob.models.ListBlobContainersIncludeType; import com.azure.storage.blob.models.UserDelegationKey; -import java.io.InputStream; import java.nio.ByteBuffer; import java.util.List; import java.util.Objects; @@ -109,26 +107,6 @@ Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, @BodyParam("application/xml") BlobServiceProperties blobServiceProperties, @HeaderParam("Accept") String accept, Context context); - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase setPropertiesSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BlobServiceProperties blobServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BlobServiceProperties blobServiceProperties, - @HeaderParam("Accept") String accept, Context context); - @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -147,24 +125,6 @@ Mono> getPropertiesNoCustomHeaders(@HostParam("u @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getPropertiesSync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -183,24 +143,6 @@ Mono> getStatisticsNoCustomHeaders(@HostParam("u @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getStatisticsSync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getStatisticsNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -221,26 +163,6 @@ Mono> listBlobContainersSegmentNoCustomHeaders(@ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase listBlobContainersSegmentSync( - @HostParam("url") String url, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String listBlobContainersIncludeType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response listBlobContainersSegmentNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String listBlobContainersIncludeType, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - @Post("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -259,24 +181,6 @@ Mono> getUserDelegationKeyNoCustomHeaders(@HostParam @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, @HeaderParam("Accept") String accept, Context context); - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getUserDelegationKeySync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getUserDelegationKeyNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -291,20 +195,6 @@ Mono> getAccountInfoNoCustomHeaders(@HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase getAccountInfoSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response getAccountInfoNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context); - @Post("/") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -341,24 +231,6 @@ Mono submitBatchNoCustomHeaders(@HostParam("url") String url, @Q @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Post("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase submitBatchSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-Type") String multipartContentType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response submitBatchNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("Content-Type") String multipartContentType, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @BodyParam("application/xml") BinaryData body, @HeaderParam("Accept") String accept, Context context); - @Get("/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -379,26 +251,6 @@ Mono> filterBlobsNoCustomHeaders(@HostParam("url") S @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, @HeaderParam("Accept") String accept, Context context); - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase filterBlobsSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("where") String where, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response filterBlobsNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @QueryParam("where") String where, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @HeaderParam("Accept") String accept, Context context); - @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) @@ -415,23 +267,6 @@ Mono> listBlobContainersSegmentNextNoCustomHeade @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - ResponseBase - listBlobContainersSegmentNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("url") String url, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class) - Response listBlobContainersSegmentNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, Context context); } /** @@ -591,85 +426,6 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync( .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param blobServiceProperties The StorageService properties. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setPropertiesWithResponse( - BlobServiceProperties blobServiceProperties, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, blobServiceProperties, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param blobServiceProperties The StorageService properties. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setProperties(BlobServiceProperties blobServiceProperties, Integer timeout, String requestId) { - setPropertiesWithResponse(blobServiceProperties, timeout, requestId, Context.NONE); - } - - /** - * Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @param blobServiceProperties The StorageService properties. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setPropertiesNoCustomHeadersWithResponse(BlobServiceProperties blobServiceProperties, - Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, blobServiceProperties, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS * (Cross-Origin Resource Sharing) rules. @@ -826,62 +582,34 @@ public Mono> getPropertiesNoCustomHeadersWithRes } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. + * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location + * endpoint when read-access geo-redundant replication is enabled for the storage account. * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link ResponseBase}. + * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(Integer timeout, - String requestId, Context context) { + public Mono> + getStatisticsWithResponseAsync(Integer timeout, String requestId) { final String restype = "service"; - final String comp = "properties"; + final String comp = "stats"; final String accept = "application/xml"; - try { - return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobServiceProperties getProperties(Integer timeout, String requestId) { - try { - return getPropertiesWithResponse(timeout, requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. + * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location + * endpoint when read-access geo-redundant replication is enabled for the storage account. * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting @@ -892,21 +620,18 @@ public BlobServiceProperties getProperties(Integer timeout, String requestId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules along with {@link Response}. + * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(Integer timeout, String requestId, - Context context) { + public Mono> + getStatisticsWithResponseAsync(Integer timeout, String requestId, Context context) { final String restype = "service"; - final String comp = "properties"; + final String comp = "stats"; final String accept = "application/xml"; - try { - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -921,60 +646,7 @@ public Response getPropertiesNoCustomHeadersWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getStatisticsWithResponseAsync(Integer timeout, String requestId) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getStatistics(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getStatisticsWithResponseAsync(Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return service - .getStatistics(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service on successful completion of {@link Mono}. + * @return stats for the storage service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsAsync(Integer timeout, String requestId) { @@ -986,384 +658,7 @@ public Mono getStatisticsAsync(Integer timeout, String re /** * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatisticsAsync(Integer timeout, String requestId, Context context) { - return getStatisticsWithResponseAsync(timeout, requestId, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, - String requestId, Context context) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - return service - .getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getStatisticsWithResponse(Integer timeout, - String requestId, Context context) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - try { - return service.getStatisticsSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BlobServiceStatistics getStatistics(Integer timeout, String requestId) { - try { - return getStatisticsWithResponse(timeout, requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location - * endpoint when read-access geo-redundant replication is enabled for the storage account. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatisticsNoCustomHeadersWithResponse(Integer timeout, String requestId, - Context context) { - final String restype = "service"; - final String comp = "stats"; - final String accept = "application/xml"; - try { - return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobContainersSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List listBlobContainersIncludeType, Integer timeout, - String requestId) { - final String comp = "list"; - final String accept = "application/xml"; - String listBlobContainersIncludeTypeConverted = (listBlobContainersIncludeType == null) - ? null - : listBlobContainersIncludeType.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, - maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, - accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobContainersSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List listBlobContainersIncludeType, Integer timeout, - String requestId, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String listBlobContainersIncludeTypeConverted = (listBlobContainersIncludeType == null) - ? null - : listBlobContainersIncludeType.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, maxresults, - listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBlobContainersSegmentAsync(String prefix, String marker, Integer maxresults, - List listBlobContainersIncludeType, Integer timeout, String requestId) { - return new PagedFlux<>(() -> listBlobContainersSegmentSinglePageAsync(prefix, marker, maxresults, - listBlobContainersIncludeType, timeout, requestId), - nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId)); - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBlobContainersSegmentAsync(String prefix, String marker, Integer maxresults, - List listBlobContainersIncludeType, Integer timeout, String requestId, - Context context) { - return new PagedFlux<>( - () -> listBlobContainersSegmentSinglePageAsync(prefix, marker, maxresults, listBlobContainersIncludeType, - timeout, requestId, context), - nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId, context)); - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(String prefix, - String marker, Integer maxresults, List listBlobContainersIncludeType, - Integer timeout, String requestId) { - final String comp = "list"; - final String accept = "application/xml"; - String listBlobContainersIncludeTypeConverted = (listBlobContainersIncludeType == null) - ? null - : listBlobContainersIncludeType.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, - marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), - requestId, accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); - } - - /** - * The List Containers Segment operation returns a list of the containers under the specified account. - * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. + * * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1373,43 +668,19 @@ public Mono> listBlobContainersSegmentNoCustomH * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return stats for the storage service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(String prefix, - String marker, Integer maxresults, List listBlobContainersIncludeType, - Integer timeout, String requestId, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String listBlobContainersIncludeTypeConverted = (listBlobContainersIncludeType == null) - ? null - : listBlobContainersIncludeType.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, - listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) + public Mono getStatisticsAsync(Integer timeout, String requestId, Context context) { + return getStatisticsWithResponseAsync(timeout, requestId, context) .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The List Containers Segment operation returns a list of the containers under the specified account. + * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location + * endpoint when read-access geo-redundant replication is enabled for the storage account. * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1418,34 +689,24 @@ public Mono> listBlobContainersSegmentNoCustomH * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedFlux}. + * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBlobContainersSegmentNoCustomHeadersAsync(String prefix, String marker, - Integer maxresults, List listBlobContainersIncludeType, Integer timeout, + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, String requestId) { - return new PagedFlux<>( - () -> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, - listBlobContainersIncludeType, timeout, requestId), - nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId)); + final String restype = "service"; + final String comp = "stats"; + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, + this.client.getVersion(), requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** - * The List Containers Segment operation returns a list of the containers under the specified account. + * Retrieves statistics related to replication for the Blob service. It is only available on the secondary location + * endpoint when read-access geo-redundant replication is enabled for the storage account. * - * @param prefix Filters the results to return only containers whose name begins with the specified prefix. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param listBlobContainersIncludeType Include this parameter to specify that the container's metadata be returned - * as part of the response body. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting * Timeouts for Blob Service Operations.</a>. @@ -1455,16 +716,18 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedFlux}. + * @return stats for the storage service along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBlobContainersSegmentNoCustomHeadersAsync(String prefix, String marker, - Integer maxresults, List listBlobContainersIncludeType, Integer timeout, + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getStatisticsNoCustomHeadersWithResponseAsync(Integer timeout, String requestId, Context context) { - return new PagedFlux<>( - () -> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, - listBlobContainersIncludeType, timeout, requestId, context), - nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId, context)); + final String restype = "service"; + final String comp = "stats"; + final String accept = "application/xml"; + return service + .getStatisticsNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), + requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -1491,10 +754,10 @@ public PagedFlux listBlobContainersSegmentNoCustomHeadersAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentSinglePage(String prefix, String marker, + public Mono> listBlobContainersSegmentSinglePageAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId) { final String comp = "list"; @@ -1504,16 +767,13 @@ public PagedResponse listBlobContainersSegmentSinglePage(Stri : listBlobContainersIncludeType.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - ResponseBase res - = service.listBlobContainersSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, - listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, - Context.NONE); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, + maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, + accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** @@ -1541,10 +801,10 @@ public PagedResponse listBlobContainersSegmentSinglePage(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentSinglePage(String prefix, String marker, + public Mono> listBlobContainersSegmentSinglePageAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId, Context context) { final String comp = "list"; @@ -1554,15 +814,12 @@ public PagedResponse listBlobContainersSegmentSinglePage(Stri : listBlobContainersIncludeType.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - ResponseBase res - = service.listBlobContainersSegmentSync(this.client.getUrl(), comp, prefix, marker, maxresults, - listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .listBlobContainersSegment(this.client.getUrl(), comp, prefix, marker, maxresults, + listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** @@ -1589,15 +846,14 @@ public PagedResponse listBlobContainersSegmentSinglePage(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedIterable}. + * @return an enumeration of containers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBlobContainersSegment(String prefix, String marker, Integer maxresults, + public PagedFlux listBlobContainersSegmentAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId) { - return new PagedIterable<>( - () -> listBlobContainersSegmentSinglePage(prefix, marker, maxresults, listBlobContainersIncludeType, - timeout, requestId, Context.NONE), - nextLink -> listBlobContainersSegmentNextSinglePage(nextLink, requestId)); + return new PagedFlux<>(() -> listBlobContainersSegmentSinglePageAsync(prefix, marker, maxresults, + listBlobContainersIncludeType, timeout, requestId), + nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId)); } /** @@ -1625,16 +881,16 @@ public PagedIterable listBlobContainersSegment(String prefix, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedIterable}. + * @return an enumeration of containers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBlobContainersSegment(String prefix, String marker, Integer maxresults, + public PagedFlux listBlobContainersSegmentAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId, Context context) { - return new PagedIterable<>( - () -> listBlobContainersSegmentSinglePage(prefix, marker, maxresults, listBlobContainersIncludeType, + return new PagedFlux<>( + () -> listBlobContainersSegmentSinglePageAsync(prefix, marker, maxresults, listBlobContainersIncludeType, timeout, requestId, context), - nextLink -> listBlobContainersSegmentNextSinglePage(nextLink, requestId, context)); + nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId, context)); } /** @@ -1661,10 +917,10 @@ public PagedIterable listBlobContainersSegment(String prefix, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNoCustomHeadersSinglePage(String prefix, + public Mono> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId) { final String comp = "list"; @@ -1674,15 +930,13 @@ public PagedResponse listBlobContainersSegmentNoCustomHeaders : listBlobContainersIncludeType.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - Response res = service.listBlobContainersSegmentNoCustomHeadersSync(this.client.getUrl(), - comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), - requestId, accept, Context.NONE); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return FluxUtil + .withContext(context -> service.listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, + marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), + requestId, accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } /** @@ -1710,10 +964,10 @@ public PagedResponse listBlobContainersSegmentNoCustomHeaders * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNoCustomHeadersSinglePage(String prefix, + public Mono> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId, Context context) { final String comp = "list"; @@ -1723,15 +977,12 @@ public PagedResponse listBlobContainersSegmentNoCustomHeaders : listBlobContainersIncludeType.stream() .map(paramItemValue -> Objects.toString(paramItemValue, "")) .collect(Collectors.joining(",")); - Response res = service.listBlobContainersSegmentNoCustomHeadersSync(this.client.getUrl(), - comp, prefix, marker, maxresults, listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), - requestId, accept, context); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .listBlobContainersSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, + listBlobContainersIncludeTypeConverted, timeout, this.client.getVersion(), requestId, accept, context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } /** @@ -1758,16 +1009,16 @@ public PagedResponse listBlobContainersSegmentNoCustomHeaders * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedIterable}. + * @return an enumeration of containers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBlobContainersSegmentNoCustomHeaders(String prefix, String marker, + public PagedFlux listBlobContainersSegmentNoCustomHeadersAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId) { - return new PagedIterable<>( - () -> listBlobContainersSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, - listBlobContainersIncludeType, timeout, requestId, Context.NONE), - nextLink -> listBlobContainersSegmentNextSinglePage(nextLink, requestId)); + return new PagedFlux<>( + () -> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, + listBlobContainersIncludeType, timeout, requestId), + nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId)); } /** @@ -1795,16 +1046,16 @@ public PagedIterable listBlobContainersSegmentNoCustomHeaders * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers as paginated response with {@link PagedIterable}. + * @return an enumeration of containers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBlobContainersSegmentNoCustomHeaders(String prefix, String marker, + public PagedFlux listBlobContainersSegmentNoCustomHeadersAsync(String prefix, String marker, Integer maxresults, List listBlobContainersIncludeType, Integer timeout, String requestId, Context context) { - return new PagedIterable<>( - () -> listBlobContainersSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, + return new PagedFlux<>( + () -> listBlobContainersSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, listBlobContainersIncludeType, timeout, requestId, context), - nextLink -> listBlobContainersSegmentNextSinglePage(nextLink, requestId, context)); + nextLink -> listBlobContainersSegmentNextSinglePageAsync(nextLink, requestId, context)); } /** @@ -1963,90 +1214,6 @@ public Mono> getUserDelegationKeyNoCustomHeadersWith .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - getUserDelegationKeyWithResponse(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - try { - return service.getUserDelegationKeySync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserDelegationKey getUserDelegationKey(KeyInfo keyInfo, Integer timeout, String requestId) { - try { - return getUserDelegationKeyWithResponse(keyInfo, timeout, requestId, Context.NONE).getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUserDelegationKeyNoCustomHeadersWithResponse(KeyInfo keyInfo, Integer timeout, - String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - try { - return service.getUserDelegationKeyNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * Returns the sku name and account kind. * @@ -2118,70 +1285,17 @@ public Mono getAccountInfoAsync(Context context) { * * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAccountInfoNoCustomHeadersWithResponseAsync() { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, - this.client.getVersion(), accept, context)) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Returns the sku name and account kind. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, - context) - .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); - } - - /** - * Returns the sku name and account kind. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getAccountInfoWithResponse(Context context) { - final String restype = "account"; - final String comp = "properties"; - final String accept = "application/xml"; - try { - return service.getAccountInfoSync(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, - context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Returns the sku name and account kind. - * - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void getAccountInfo() { - getAccountInfoWithResponse(Context.NONE); + public Mono> getAccountInfoNoCustomHeadersWithResponseAsync() { + final String restype = "account"; + final String comp = "properties"; + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, + this.client.getVersion(), accept, context)) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -2191,19 +1305,17 @@ public void getAccountInfo() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccountInfoNoCustomHeadersWithResponse(Context context) { + public Mono> getAccountInfoNoCustomHeadersWithResponseAsync(Context context) { final String restype = "account"; final String comp = "properties"; final String accept = "application/xml"; - try { - return service.getAccountInfoNoCustomHeadersSync(this.client.getUrl(), restype, comp, - this.client.getVersion(), accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } + return service + .getAccountInfoNoCustomHeaders(this.client.getUrl(), restype, comp, this.client.getVersion(), accept, + context) + .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } /** @@ -2538,96 +1650,6 @@ public Mono submitBatchNoCustomHeadersWithResponseAsync(long con .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase submitBatchWithResponse(long contentLength, - String multipartContentType, BinaryData body, Integer timeout, String requestId, Context context) { - final String comp = "batch"; - final String accept = "application/xml"; - try { - return service.submitBatchSync(this.client.getUrl(), comp, contentLength, multipartContentType, timeout, - this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream submitBatch(long contentLength, String multipartContentType, BinaryData body, Integer timeout, - String requestId) { - try { - return submitBatchWithResponse(contentLength, multipartContentType, body, timeout, requestId, Context.NONE) - .getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. - * - * @param contentLength The length of the request. - * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch boundary. - * Example header value: multipart/mixed; boundary=batch_<GUID>. - * @param body Initial data. - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response submitBatchNoCustomHeadersWithResponse(long contentLength, String multipartContentType, - BinaryData body, Integer timeout, String requestId, Context context) { - final String comp = "batch"; - final String accept = "application/xml"; - try { - return service.submitBatchNoCustomHeadersSync(this.client.getUrl(), comp, contentLength, - multipartContentType, timeout, this.client.getVersion(), requestId, body, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search * expression. Filter blobs searches across all containers within a storage account but can be scoped within the @@ -2880,137 +1902,6 @@ public Mono> filterBlobsNoCustomHeadersWithResponseA .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException); } - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search - * expression. Filter blobs searches across all containers within a storage account but can be scoped within the - * expression to a single container. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase filterBlobsWithResponse(Integer timeout, - String requestId, String where, String marker, Integer maxresults, List include, - Context context) { - final String comp = "blobs"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.filterBlobsSync(this.client.getUrl(), comp, timeout, this.client.getVersion(), requestId, - where, marker, maxresults, includeConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search - * expression. Filter blobs searches across all containers within a storage account but can be scoped within the - * expression to a single container. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FilterBlobSegment filterBlobs(Integer timeout, String requestId, String where, String marker, - Integer maxresults, List include) { - try { - return filterBlobsWithResponse(timeout, requestId, where, marker, maxresults, include, Context.NONE) - .getValue(); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search - * expression. Filter blobs searches across all containers within a storage account but can be scoped within the - * expression to a single container. - * - * @param timeout The timeout parameter is expressed in seconds. For more information, see <a - * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting - * Timeouts for Blob Service Operations.</a>. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param where Filters the results to return only to return only blobs whose tags match the specified expression. - * @param marker A string value that identifies the portion of the list of containers to be returned with the next - * listing operation. The operation returns the NextMarker value within the response body if the listing operation - * did not return all containers remaining to be listed with the current page. The NextMarker value can be used as - * the value for the marker parameter in a subsequent call to request the next page of list items. The marker value - * is opaque to the client. - * @param maxresults Specifies the maximum number of containers to return. If the request does not specify - * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the - * listing operation crosses a partition boundary, then the service will return a continuation token for retrieving - * the remainder of the results. For this reason, it is possible that the service will return fewer results than - * specified by maxresults, or than the default of 5000. - * @param include Include this parameter to specify one or more datasets to include in the response. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response filterBlobsNoCustomHeadersWithResponse(Integer timeout, String requestId, - String where, String marker, Integer maxresults, List include, Context context) { - final String comp = "blobs"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - try { - return service.filterBlobsNoCustomHeadersSync(this.client.getUrl(), comp, timeout, this.client.getVersion(), - requestId, where, marker, maxresults, includeConverted, accept, context); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - /** * Get the next page of items. * @@ -3112,115 +2003,4 @@ public Mono> listBlobContainersSegmentNextNoCus .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null)); } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNextSinglePage(String nextLink, String requestId) { - final String accept = "application/xml"; - ResponseBase res - = service.listBlobContainersSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), - requestId, accept, Context.NONE); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNextSinglePage(String nextLink, String requestId, - Context context) { - final String accept = "application/xml"; - ResponseBase res - = service.listBlobContainersSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), - requestId, accept, context); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNextNoCustomHeadersSinglePage(String nextLink, - String requestId) { - final String accept = "application/xml"; - Response res = service.listBlobContainersSegmentNextNoCustomHeadersSync(nextLink, - this.client.getUrl(), this.client.getVersion(), requestId, accept, Context.NONE); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageExceptionInternal thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listBlobContainersSegmentNextNoCustomHeadersSinglePage(String nextLink, - String requestId, Context context) { - final String accept = "application/xml"; - Response res = service.listBlobContainersSegmentNextNoCustomHeadersSync(nextLink, - this.client.getUrl(), this.client.getVersion(), requestId, accept, context); - try { - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getBlobContainerItems(), res.getValue().getNextMarker(), null); - } catch (BlobStorageExceptionInternal internalException) { - throw ModelHelper.mapToBlobStorageException(internalException); - } - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobQueryReader.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobQueryReader.java index 9259961b06f12..d2dd45333eb37 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobQueryReader.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobQueryReader.java @@ -22,17 +22,12 @@ import com.azure.storage.internal.avro.implementation.AvroConstants; import com.azure.storage.internal.avro.implementation.AvroObject; import com.azure.storage.internal.avro.implementation.AvroReaderFactory; -import com.azure.storage.internal.avro.implementation.AvroReaderSyncFactory; import com.azure.storage.internal.avro.implementation.schema.AvroSchema; import com.azure.storage.internal.avro.implementation.schema.primitive.AvroNullSchema; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.UncheckedIOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -46,7 +41,6 @@ */ public class BlobQueryReader { - private static final ClientLogger LOGGER = new ClientLogger(BlobQueryReader.class); private final Flux avro; private final Consumer progressConsumer; private final Consumer errorConsumer; @@ -80,73 +74,6 @@ public Flux read() { .concatMap(this::parseRecord); } - /** - * Avro parses a query reactive stream. - * - * The Avro stream is formatted as the Avro Header (that specifies the schema) and the Avro Body (that contains - * a series of blocks of data). The Query Avro schema indicates that the objects being emitted from the parser can - * either be a result data record, an end record, a progress record or an error record. - * - * @param inputStream The input stream to read from. - * @return The parsed query reactive stream. - * @throws IOException If an I/O error occurs. - */ - public InputStream readInputStream(InputStream inputStream) throws IOException { - AvroReaderSyncFactory avroReaderSyncFactory = new AvroReaderSyncFactory(); - ByteBuffer fullBuffer = convertInputStreamToByteBuffer(inputStream); - - Iterable avroObjects = avroReaderSyncFactory.getAvroReader(fullBuffer).read(); - - // serialize AvroObject back to bytes - byte[] processedData = serializeAvroObjectsToBytes(avroObjects); - return new ByteArrayInputStream(processedData); - } - - private ByteBuffer convertInputStreamToByteBuffer(InputStream inputStream) throws IOException { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - byte[] buffer = new byte[1024]; // Temporary buffer size - int bytesRead; - while ((bytesRead = inputStream.read(buffer)) != -1) { - outputStream.write(buffer, 0, bytesRead); - } - byte[] data = outputStream.toByteArray(); // Get all data read from the stream - - // Convert the byte array to ByteBuffer - ByteBuffer byteBuffer = ByteBuffer.allocateDirect(data.length); - byteBuffer.put(data); - byteBuffer.flip(); // Prepare the buffer for reading - return byteBuffer; - } - - private byte[] serializeAvroObjectsToBytes(Iterable avroObjects) { - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - for (AvroObject avroObject : avroObjects) { - try { - Object potentialMap = avroObject.getObject(); - if (!(potentialMap instanceof Map)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Expected object to be of type Map")); - } - Map recordMap = (Map) potentialMap; // Safely cast it to a Map - ByteBuffer buffer = parseSyncRecord(recordMap); // Use the Map directly - - if (buffer != null) { - if (buffer.hasArray()) { - outputStream.write(buffer.array(), buffer.position(), buffer.remaining()); - } else { - // If the buffer does not have an accessible array, manually copy - byte[] data = new byte[buffer.remaining()]; - buffer.get(data); - outputStream.write(data); - } - buffer.clear(); // Prepare buffer for next iteration if reusing - } - } catch (IOException e) { - throw LOGGER.logExceptionAsError(new UncheckedIOException(e)); - } - } - return outputStream.toByteArray(); - } - /** * Parses a query record. * @@ -175,34 +102,6 @@ private Mono parseRecord(Object quickQueryRecord) { } } - /** - * Parses a query record. - * - * @param quickQueryRecord The query record. - * @return The optional data in the record. - */ - private ByteBuffer parseSyncRecord(Object quickQueryRecord) { - if (!(quickQueryRecord instanceof Map)) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Expected object to be of type Map")); - } - Map record = (Map) quickQueryRecord; - Object recordSchema = record.get(AvroConstants.RECORD); - - switch (recordSchema.toString()) { - case "resultData": - return parseSyncResultData(record); - case "end": - return parseSyncEnd(record); - case "progress": - return parseSyncProgress(record); - case "error": - return parseSyncError(record); - default: - throw LOGGER.logExceptionAsError(new IllegalStateException(String.format("Unknown record type %s " - + "while parsing query response. ", recordSchema.toString()))); - } - } - /** * Parses a query result data record. * @param dataRecord The query result data record. @@ -220,23 +119,6 @@ private Mono parseResultData(Map dataRecord) { } } - /** - * Parses a query result data record. - * @param dataRecord The query result data record. - * @return The data in the record. - */ - private ByteBuffer parseSyncResultData(Map dataRecord) { - Object data = dataRecord.get("data"); - - if (checkParametersNotNull(data)) { - AvroSchema.checkType("data", data, List.class); - return ByteBuffer.wrap(AvroSchema.getBytes((List) data)); - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Failed to parse result data record from " - + "query response stream.")); - } - } - /** * Parses a query end record. * @param endRecord The query end record. @@ -257,26 +139,6 @@ private Mono parseEnd(Map endRecord) { return Mono.empty(); } - /** - * Parses a query end record. - * @param endRecord The query end record. - * @return Mono.empty or Mono.error - */ - private ByteBuffer parseSyncEnd(Map endRecord) { - if (progressConsumer != null) { - Object totalBytes = endRecord.get("totalBytes"); - - if (checkParametersNotNull(totalBytes)) { - AvroSchema.checkType("totalBytes", totalBytes, Long.class); - progressConsumer.accept(new BlobQueryProgress((long) totalBytes, (long) totalBytes)); - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Failed to parse end record from query " - + "response stream.")); - } - } - return null; - } - /** * Parses a query progress record. * @param progressRecord The query progress record. @@ -299,28 +161,6 @@ private Mono parseProgress(Map progressRecord) { return Mono.empty(); } - /** - * Parses a query progress record. - * @param progressRecord The query progress record. - * @return Mono.empty or Mono.error - */ - private ByteBuffer parseSyncProgress(Map progressRecord) { - if (progressConsumer != null) { - Object bytesScanned = progressRecord.get("bytesScanned"); - Object totalBytes = progressRecord.get("totalBytes"); - - if (checkParametersNotNull(bytesScanned, totalBytes)) { - AvroSchema.checkType("bytesScanned", bytesScanned, Long.class); - AvroSchema.checkType("totalBytes", totalBytes, Long.class); - progressConsumer.accept(new BlobQueryProgress((long) bytesScanned, (long) totalBytes)); - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Failed to parse progress record from " - + "query response stream.")); - } - } - return null; - } - /** * Parses a query error record. * @param errorRecord The query error record. @@ -354,39 +194,6 @@ private Mono parseError(Map errorRecord) { return Mono.empty(); } - /** - * Parses a query error record. - * @param errorRecord The query error record. - * @return Mono.empty or Mono.error - */ - private ByteBuffer parseSyncError(Map errorRecord) { - Object fatal = errorRecord.get("fatal"); - Object name = errorRecord.get("name"); - Object description = errorRecord.get("description"); - Object position = errorRecord.get("position"); - - if (checkParametersNotNull(fatal, name, description, position)) { - AvroSchema.checkType("fatal", fatal, Boolean.class); - AvroSchema.checkType("name", name, String.class); - AvroSchema.checkType("description", description, String.class); - AvroSchema.checkType("position", position, Long.class); - - BlobQueryError error = new BlobQueryError((Boolean) fatal, (String) name, - (String) description, (Long) position); - - if (errorConsumer != null) { - errorConsumer.accept(error); - } else { - throw LOGGER.logExceptionAsError(new UncheckedIOException(new IOException("An error was reported during query response processing, " - + System.lineSeparator() + error.toString()))); - } - } else { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("Failed to parse error record from " - + "query response stream.")); - } - return null; - } - /** * Checks whether or not all parameters are non-null. */ diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java index 622bc90bc7ba1..1e6d4e9508409 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/ModelHelper.java @@ -3,7 +3,6 @@ package com.azure.storage.blob.implementation.util; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.RequestConditions; @@ -11,7 +10,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.storage.blob.BlobAsyncClient; import com.azure.storage.blob.implementation.accesshelpers.BlobDownloadHeadersConstructorProxy; import com.azure.storage.blob.implementation.accesshelpers.BlobItemConstructorProxy; @@ -27,47 +25,32 @@ import com.azure.storage.blob.implementation.models.BlobsQueryHeaders; import com.azure.storage.blob.implementation.models.FilterBlobItem; import com.azure.storage.blob.models.BlobBeginCopySourceRequestConditions; -import com.azure.storage.blob.models.BlobContainerListDetails; -import com.azure.storage.blob.models.BlobCorsRule; import com.azure.storage.blob.models.BlobDownloadAsyncResponse; import com.azure.storage.blob.models.BlobDownloadHeaders; import com.azure.storage.blob.models.BlobDownloadResponse; -import com.azure.storage.blob.models.BlobErrorCode; import com.azure.storage.blob.models.BlobItem; import com.azure.storage.blob.models.BlobLeaseRequestConditions; import com.azure.storage.blob.models.BlobProperties; import com.azure.storage.blob.models.BlobQueryHeaders; import com.azure.storage.blob.models.BlobRequestConditions; -import com.azure.storage.blob.models.BlobRetentionPolicy; -import com.azure.storage.blob.models.BlobSignedIdentifier; import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.blob.models.CopyStatusType; -import com.azure.storage.blob.models.ListBlobContainersIncludeType; import com.azure.storage.blob.models.ObjectReplicationPolicy; import com.azure.storage.blob.models.ObjectReplicationRule; import com.azure.storage.blob.models.ObjectReplicationStatus; import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; -import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.ParallelTransferOptions; import com.azure.storage.blob.models.TaggedBlobItem; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; -import com.azure.storage.common.implementation.StorageImplUtils; -import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.Callable; -import java.util.function.Supplier; /** * This class provides helper methods for common model patterns. @@ -84,11 +67,6 @@ public final class ModelHelper { private static final HttpHeaderName X_MS_ERROR_CODE = HttpHeaderName.fromString("x-ms-error-code"); - /** - * Indicates the number of bytes in a page. - */ - public static final int PAGE_BYTES = 512; - /** * Determines whether the passed authority is IP style, that is, it is of the format {@code :}. * @@ -490,197 +468,6 @@ public static long getBlobLength(BlobDownloadHeaders headers) { : ChunkedDownloadUtils.extractTotalBlobLength(headers.getContentRange()); } - public static boolean checkBlobDoesNotExistStatusCode(Throwable t) { - if (t instanceof BlobStorageException) { - BlobStorageException s = (BlobStorageException) t; - return s.getStatusCode() == 404 - && (s.getErrorCode() == BlobErrorCode.RESOURCE_NOT_FOUND - || s.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND); - /* HttpResponseException - file get properties is a head request so a body is not returned. Error - conversion logic does not properly handle errors that don't return XML. */ - } else if (t instanceof HttpResponseException) { - HttpResponseException h = (HttpResponseException) t; - String errorCode = h.getResponse().getHeaderValue(X_MS_ERROR_CODE); - return h.getResponse().getStatusCode() == 404 - && (BlobErrorCode.RESOURCE_NOT_FOUND.toString().equals(errorCode) - || BlobErrorCode.BLOB_NOT_FOUND.toString().equals(errorCode)); - } else { - return false; - } - } - - public static boolean checkContainerDoesNotExistStatusCode(Throwable t) { - if (t instanceof BlobStorageException) { - BlobStorageException s = (BlobStorageException) t; - return s.getStatusCode() == 404 - && (s.getErrorCode() == BlobErrorCode.RESOURCE_NOT_FOUND - || s.getErrorCode() == BlobErrorCode.CONTAINER_NOT_FOUND); - /* HttpResponseException - file get properties is a head request so a body is not returned. Error - conversion logic does not properly handle errors that don't return XML. */ - } else if (t instanceof HttpResponseException) { - HttpResponseException h = (HttpResponseException) t; - String errorCode = h.getResponse().getHeaderValue(X_MS_ERROR_CODE); - return h.getResponse().getStatusCode() == 404 - && (BlobErrorCode.RESOURCE_NOT_FOUND.toString().equals(errorCode) - || BlobErrorCode.CONTAINER_NOT_FOUND.toString().equals(errorCode)); - } else { - return false; - } - } - - public static String tagsToString(Map tags) { - if (tags == null || tags.isEmpty()) { - return null; - } - StringBuilder sb = new StringBuilder(); - boolean first = true; // Flag to track if it's the first element in the loop - for (Map.Entry entry : tags.entrySet()) { - try { - if (!first) { - sb.append("&"); // Append the delimiter before the key-value pair, except for the first - } else { - first = false; // Update flag after processing the first entry - } - sb.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8.toString())); - sb.append("="); - sb.append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString())); - } catch (UnsupportedEncodingException e) { - throw LOGGER.logExceptionAsError(new IllegalStateException(e)); - } - } - return sb.toString(); - } - - public static LongRunningOperationStatus mapStatusToLongRunningOperationStatus(CopyStatusType status) { - LongRunningOperationStatus operationStatus; - switch (status) { - case SUCCESS: - operationStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - break; - case FAILED: - operationStatus = LongRunningOperationStatus.FAILED; - break; - case ABORTED: - operationStatus = LongRunningOperationStatus.USER_CANCELLED; - break; - case PENDING: - operationStatus = LongRunningOperationStatus.IN_PROGRESS; - break; - default: - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "CopyStatusType is not supported. Status: " + status)); - } - return operationStatus; - } - - public static boolean validateNoETag(BlobRequestConditions modifiedRequestConditions) { - if (modifiedRequestConditions == null) { - return true; - } - return modifiedRequestConditions.getIfMatch() == null && modifiedRequestConditions.getIfNoneMatch() == null; - } - - /** - * Converts {@link BlobContainerListDetails} into list of {@link ListBlobContainersIncludeType} - * that contains only options selected. If no option is selected then null is returned. - * - * @return a list of selected options converted into {@link ListBlobContainersIncludeType}, null if none - * of options has been selected. - */ - public static List toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { - boolean hasDetails = blobContainerListDetails != null - && (blobContainerListDetails.getRetrieveMetadata() - || blobContainerListDetails.getRetrieveDeleted() - || blobContainerListDetails.getRetrieveSystemContainers()); - if (hasDetails) { - List flags = new ArrayList<>(3); - if (blobContainerListDetails.getRetrieveDeleted()) { - flags.add(ListBlobContainersIncludeType.DELETED); - } - if (blobContainerListDetails.getRetrieveMetadata()) { - flags.add(ListBlobContainersIncludeType.METADATA); - } - if (blobContainerListDetails.getRetrieveSystemContainers()) { - flags.add(ListBlobContainersIncludeType.SYSTEM); - } - return flags; - } else { - return null; - } - } - - /** - * Validates a {@link BlobRetentionPolicy} according to service specs for set properties. - * @param retentionPolicy {@link BlobRetentionPolicy} - * @param policyName The name of the variable for errors. - */ - public static void validateRetentionPolicy(BlobRetentionPolicy retentionPolicy, String policyName) { - if (retentionPolicy == null) { - return; - } - if (retentionPolicy.isEnabled()) { - StorageImplUtils.assertInBounds(policyName, retentionPolicy.getDays(), 1, 365); - } - } - - /** - * Sets any null fields to "" since the service requires all Cors rules to be set if some are set. - * @param originalRule {@link BlobCorsRule} - * @return The validated {@link BlobCorsRule} - */ - public static BlobCorsRule validatedCorsRule(BlobCorsRule originalRule) { - if (originalRule == null) { - return null; - } - BlobCorsRule validRule = new BlobCorsRule(); - validRule.setAllowedHeaders(StorageImplUtils.emptyIfNull(originalRule.getAllowedHeaders())); - validRule.setAllowedMethods(StorageImplUtils.emptyIfNull(originalRule.getAllowedMethods())); - validRule.setAllowedOrigins(StorageImplUtils.emptyIfNull(originalRule.getAllowedOrigins())); - validRule.setExposedHeaders(StorageImplUtils.emptyIfNull(originalRule.getExposedHeaders())); - validRule.setMaxAgeInSeconds(originalRule.getMaxAgeInSeconds()); - return validRule; - } - - public static String pageRangeToString(PageRange pageRange) { - if (pageRange.getStart() < 0 || pageRange.getEnd() <= 0) { - throw new IllegalArgumentException("PageRange's start and end values must be greater than or equal to " - + "0 if specified."); - } - if (pageRange.getStart() % PAGE_BYTES != 0) { - throw new IllegalArgumentException("PageRange's start value must be a multiple of 512."); - } - if (pageRange.getEnd() % PAGE_BYTES != PAGE_BYTES - 1) { - throw new IllegalArgumentException("PageRange's end value must be 1 less than a multiple of 512."); - } - if (pageRange.getEnd() <= pageRange.getStart()) { - throw new IllegalArgumentException("PageRange's End value must be after the start."); - } - return "bytes=" + pageRange.getStart() + '-' + pageRange.getEnd(); - } - - public static List truncateTimeForBlobSignedIdentifier(List identifiers) { - if (identifiers == null) { - return null; - } - /* - We truncate to seconds because the service only supports nanoseconds or seconds, but doing an - OffsetDateTime.now will only give back milliseconds (more precise fields are zeroed and not serialized). This - allows for proper serialization with no real detriment to users as sub-second precision on active time for - signed identifiers is not really necessary. - */ - for (BlobSignedIdentifier identifier : identifiers) { - if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getStartsOn() != null) { - identifier.getAccessPolicy().setStartsOn( - identifier.getAccessPolicy().getStartsOn().truncatedTo(ChronoUnit.SECONDS)); - } - if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getExpiresOn() != null) { - identifier.getAccessPolicy().setExpiresOn( - identifier.getAccessPolicy().getExpiresOn().truncatedTo(ChronoUnit.SECONDS)); - } - } - return identifiers; - } - /** * Maps the internal exception to a public exception, if and only if {@code internal} is an instance of * {@link BlobStorageExceptionInternal} and it will be mapped to {@link BlobStorageException}. @@ -696,24 +483,6 @@ public static BlobStorageException mapToBlobStorageException(BlobStorageExceptio return new BlobStorageException(internal.getMessage(), internal.getResponse(), internal.getValue()); } - public static Callable wrapTimeoutServiceCallWithExceptionMapping(Supplier serviceCall) { - return () -> { - try { - return serviceCall.get(); - } catch (BlobStorageExceptionInternal internal) { - throw mapToBlobStorageException(internal); - } - }; - } - - public static T wrapServiceCallWithExceptionMapping(Supplier serviceCall) { - try { - return serviceCall.get(); - } catch (BlobStorageExceptionInternal internal) { - throw mapToBlobStorageException(internal); - } - } - private ModelHelper() { } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java index c9a955866bb65..c448b13923a4d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobAsyncClient.java @@ -22,7 +22,6 @@ import com.azure.storage.blob.implementation.models.AppendBlobsAppendBlockHeaders; import com.azure.storage.blob.implementation.models.AppendBlobsCreateHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AppendBlobItem; import com.azure.storage.blob.models.AppendBlobRequestConditions; import com.azure.storage.blob.models.BlobHttpHeaders; @@ -292,7 +291,7 @@ Mono> createWithResponse(AppendBlobCreateOptions option options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - ModelHelper.tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), + tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.hasLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java index f32655608e183..b7d2e0256fa8e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/AppendBlobClient.java @@ -7,30 +7,19 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.UnexpectedLengthException; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.BlobClient; import com.azure.storage.blob.BlobClientBuilder; import com.azure.storage.blob.BlobContainerClient; import com.azure.storage.blob.BlobServiceClient; import com.azure.storage.blob.BlobServiceVersion; -import com.azure.storage.blob.implementation.models.AppendBlobsCreateHeaders; -import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AppendBlobItem; import com.azure.storage.blob.models.AppendBlobRequestConditions; -import com.azure.storage.blob.models.BlobErrorCode; import com.azure.storage.blob.models.BlobHttpHeaders; -import com.azure.storage.blob.models.BlobImmutabilityPolicy; import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.options.AppendBlobAppendBlockFromUrlOptions; import com.azure.storage.blob.options.AppendBlobCreateOptions; @@ -46,10 +35,8 @@ import java.time.Duration; import java.util.Map; import java.util.Objects; -import java.util.concurrent.Callable; -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; +import static com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout; /** * Client to an append blob. It may only be instantiated through a {@link SpecializedBlobClientBuilder} or via the @@ -66,7 +53,7 @@ */ @ServiceClient(builder = SpecializedBlobClientBuilder.class) public final class AppendBlobClient extends BlobClientBase { - private static final ClientLogger LOGGER = new ClientLogger(AppendBlobClient.class); + private final AppendBlobAsyncClient appendBlobAsyncClient; /** @@ -74,29 +61,30 @@ public final class AppendBlobClient extends BlobClientBase { * @deprecated use {@link AppendBlobClient#getMaxAppendBlockBytes()}. */ @Deprecated - public static final int MAX_APPEND_BLOCK_BYTES = 4 * Constants.MB; + public static final int MAX_APPEND_BLOCK_BYTES = AppendBlobAsyncClient.MAX_APPEND_BLOCK_BYTES; /** * Indicates the maximum number of blocks allowed in an append blob. * @deprecated use {@link AppendBlobClient#getMaxBlocks()}. */ @Deprecated - public static final int MAX_BLOCKS = 50000; + public static final int MAX_BLOCKS = AppendBlobAsyncClient.MAX_BLOCKS; /** * Indicates the maximum number of bytes that can be sent in a call to appendBlock. */ - static final int MAX_APPEND_BLOCK_BYTES_VERSIONS_2021_12_02_AND_BELOW = 4 * Constants.MB; + static final int MAX_APPEND_BLOCK_BYTES_VERSIONS_2021_12_02_AND_BELOW = AppendBlobAsyncClient.MAX_APPEND_BLOCK_BYTES_VERSIONS_2021_12_02_AND_BELOW; /** * Indicates the maximum number of bytes that can be sent in a call to appendBlock. * For versions 2022-11-02 and above. */ - static final int MAX_APPEND_BLOCK_BYTES_VERSIONS_2022_11_02_AND_ABOVE = 100 * Constants.MB; + static final int MAX_APPEND_BLOCK_BYTES_VERSIONS_2022_11_02_AND_ABOVE = AppendBlobAsyncClient.MAX_APPEND_BLOCK_BYTES_VERSIONS_2022_11_02_AND_ABOVE; + /** * Indicates the maximum number of blocks allowed in an append blob. */ - static final int MAX_APPEND_BLOCKS = 50000; + static final int MAX_APPEND_BLOCKS = AppendBlobAsyncClient.MAX_APPEND_BLOCKS; /** * Package-private constructor for use by {@link BlobClientBuilder}. @@ -104,36 +92,8 @@ public final class AppendBlobClient extends BlobClientBase { * @param appendBlobAsyncClient the async append blob client */ AppendBlobClient(AppendBlobAsyncClient appendBlobAsyncClient) { - this(appendBlobAsyncClient, appendBlobAsyncClient.getHttpPipeline(), appendBlobAsyncClient.getAccountUrl(), - appendBlobAsyncClient.getServiceVersion(), appendBlobAsyncClient.getAccountName(), - appendBlobAsyncClient.getContainerName(), appendBlobAsyncClient.getBlobName(), - appendBlobAsyncClient.getSnapshotId(), appendBlobAsyncClient.getCustomerProvidedKey(), - new EncryptionScope().setEncryptionScope(appendBlobAsyncClient.getEncryptionScope()), - appendBlobAsyncClient.getVersionId()); - } - - /** - * Package-private constructor for use by {@link SpecializedBlobClientBuilder}. - * - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param blobName The blob name. - * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version. - */ - AppendBlobClient(AppendBlobAsyncClient asyncClient, HttpPipeline pipeline, String url, - BlobServiceVersion serviceVersion, String accountName, String containerName, String blobName, String snapshot, - CpkInfo customerProvidedKey, EncryptionScope encryptionScope, String versionId) { - super(asyncClient, pipeline, url, serviceVersion, accountName, containerName, blobName, snapshot, customerProvidedKey, - encryptionScope, versionId); - this.appendBlobAsyncClient = asyncClient; + super(appendBlobAsyncClient); + this.appendBlobAsyncClient = appendBlobAsyncClient; } /** @@ -144,13 +104,7 @@ public final class AppendBlobClient extends BlobClientBase { */ @Override public AppendBlobClient getEncryptionScopeClient(String encryptionScope) { - EncryptionScope finalEncryptionScope = null; - if (encryptionScope != null) { - finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope); - } - return new AppendBlobClient(this.appendBlobAsyncClient.getEncryptionScopeAsyncClient(encryptionScope), - getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), - getBlobName(), getSnapshotId(), getCustomerProvidedKey(), finalEncryptionScope, getVersionId()); + return new AppendBlobClient(appendBlobAsyncClient.getEncryptionScopeAsyncClient(encryptionScope)); } /** @@ -162,16 +116,7 @@ public AppendBlobClient getEncryptionScopeClient(String encryptionScope) { */ @Override public AppendBlobClient getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) { - CpkInfo finalCustomerProvidedKey = null; - if (customerProvidedKey != null) { - finalCustomerProvidedKey = new CpkInfo() - .setEncryptionKey(customerProvidedKey.getKey()) - .setEncryptionKeySha256(customerProvidedKey.getKeySha256()) - .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm()); - } - return new AppendBlobClient(this.appendBlobAsyncClient.getCustomerProvidedKeyAsyncClient(customerProvidedKey), - getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), - getBlobName(), getSnapshotId(), finalCustomerProvidedKey, encryptionScope, getVersionId()); + return new AppendBlobClient(appendBlobAsyncClient.getCustomerProvidedKeyAsyncClient(customerProvidedKey)); } /** @@ -333,28 +278,8 @@ public Response createWithResponse(BlobHttpHeaders headers, Map< @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(AppendBlobCreateOptions options, Duration timeout, Context context) { - AppendBlobCreateOptions finalOptions = (options == null) ? new AppendBlobCreateOptions() : options; - BlobRequestConditions requestConditions = finalOptions.getRequestConditions() == null - ? new BlobRequestConditions() : finalOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - BlobImmutabilityPolicy immutabilityPolicy = finalOptions.getImmutabilityPolicy() == null - ? new BlobImmutabilityPolicy() : finalOptions.getImmutabilityPolicy(); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getAppendBlobs().createWithResponse(containerName, blobName, 0, null, - finalOptions.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - ModelHelper.tagsToString(finalOptions.getTags()), immutabilityPolicy.getExpiryTime(), - immutabilityPolicy.getPolicyMode(), finalOptions.hasLegalHold(), finalOptions.getHeaders(), - getCustomerProvidedKey(), encryptionScope, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - AppendBlobsCreateHeaders hd = response.getDeserializedHeaders(); - AppendBlobItem item = new AppendBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), - hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), hd.getXMsEncryptionScope(), null, null, - hd.getXMsVersionId()); - return new SimpleResponse<>(response, item); + return StorageImplUtils.blockWithOptionalTimeout(appendBlobAsyncClient. + createWithResponse(options, context), timeout); } /** @@ -411,22 +336,8 @@ public AppendBlobItem createIfNotExists() { @ServiceMethod(returns = ReturnType.SINGLE) public Response createIfNotExistsWithResponse(AppendBlobCreateOptions options, Duration timeout, Context context) { - AppendBlobCreateOptions finalOptions = options == null ? new AppendBlobCreateOptions() : options; - finalOptions.setRequestConditions(new AppendBlobRequestConditions() - .setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD)); - try { - return createWithResponse(finalOptions, timeout, context); - } catch (BlobStorageException e) { - if (e.getStatusCode() == 409 && (e.getErrorCode().equals(BlobErrorCode.BLOB_ALREADY_EXISTS) - || e.getErrorCode().equals(BlobErrorCode.RESOURCE_ALREADY_EXISTS))) { - HttpResponse res = e.getResponse(); - return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), null); - } else { - throw LOGGER.logExceptionAsError(e); - } - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } + return StorageImplUtils.blockWithOptionalTimeout(appendBlobAsyncClient. + createIfNotExistsWithResponse(options, context), timeout); } /** @@ -666,18 +577,9 @@ public void seal() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response sealWithResponse(AppendBlobSealOptions options, Duration timeout, Context context) { - AppendBlobSealOptions finalOptions = (options == null) ? new AppendBlobSealOptions() : options; - - AppendBlobRequestConditions requestConditions = (finalOptions.getRequestConditions() == null) - ? new AppendBlobRequestConditions() : finalOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getAppendBlobs().sealNoCustomHeadersWithResponse(containerName, blobName, null, null, - requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getAppendPosition(), finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = appendBlobAsyncClient.sealWithResponse(options, context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -687,7 +589,7 @@ public Response sealWithResponse(AppendBlobSealOptions options, Duration t * @return the max number of block bytes that can be uploaded based on service version. */ public int getMaxAppendBlockBytes() { - if (getServiceVersion().ordinal() < BlobServiceVersion.V2022_11_02.ordinal()) { + if (appendBlobAsyncClient.getServiceVersion().ordinal() < BlobServiceVersion.V2022_11_02.ordinal()) { return MAX_APPEND_BLOCK_BYTES_VERSIONS_2021_12_02_AND_BELOW; } else { return MAX_APPEND_BLOCK_BYTES_VERSIONS_2022_11_02_AND_ABOVE; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index eb824cf564f94..a9d489c13feb0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -89,11 +89,14 @@ import java.io.IOException; import java.io.UncheckedIOException; +import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; +import java.net.URLEncoder; import java.nio.ByteBuffer; import java.nio.channels.AsynchronousFileChannel; +import java.nio.charset.Charset; import java.nio.file.FileAlreadyExistsException; import java.nio.file.Files; import java.nio.file.OpenOption; @@ -761,7 +764,7 @@ private Mono onStart(String sourceUrl, Map metadat destinationRequestConditions.getIfModifiedSince(), destinationRequestConditions.getIfUnmodifiedSince(), destinationRequestConditions.getIfMatch(), destinationRequestConditions.getIfNoneMatch(), destinationRequestConditions.getTagsConditions(), destinationRequestConditions.getLeaseId(), null, - ModelHelper.tagsToString(tags), sealBlob, immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), + tagsToString(tags), sealBlob, immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), legalHold, context)) .map(response -> { final BlobsStartCopyFromURLHeaders headers = response.getDeserializedHeaders(); @@ -772,6 +775,26 @@ private Mono onStart(String sourceUrl, Map metadat }); } + String tagsToString(Map tags) { + if (tags == null || tags.isEmpty()) { + return null; + } + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry : tags.entrySet()) { + try { + sb.append(URLEncoder.encode(entry.getKey(), Charset.defaultCharset().toString())); + sb.append("="); + sb.append(URLEncoder.encode(entry.getValue(), Charset.defaultCharset().toString())); + sb.append("&"); + } catch (UnsupportedEncodingException e) { + throw LOGGER.logExceptionAsError(new IllegalStateException(e)); + } + } + + sb.deleteCharAt(sb.length() - 1); // Remove the last '&' + return sb.toString(); + } + private Mono> onPoll(PollResponse pollResponse) { if (pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED || pollResponse.getStatus() == LongRunningOperationStatus.FAILED) { @@ -791,7 +814,25 @@ private Mono> onPoll(PollResponse pollR response.getETag(), response.getCopyCompletionTime(), response.getCopyStatusDescription(), response.getVersionId()); - LongRunningOperationStatus operationStatus = ModelHelper.mapStatusToLongRunningOperationStatus(status); + LongRunningOperationStatus operationStatus; + switch (status) { + case SUCCESS: + operationStatus = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; + break; + case FAILED: + operationStatus = LongRunningOperationStatus.FAILED; + break; + case ABORTED: + operationStatus = LongRunningOperationStatus.USER_CANCELLED; + break; + case PENDING: + operationStatus = LongRunningOperationStatus.IN_PROGRESS; + break; + default: + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "CopyStatusType is not supported. Status: " + status)); + } + return new PollResponse<>(operationStatus, result); }).onErrorReturn( new PollResponse<>(LongRunningOperationStatus.fromString("POLLING_FAILED", true), lastInfo)); @@ -993,7 +1034,7 @@ Mono> copyFromUrlWithResponse(BlobCopyFromUrlOptions options, C destRequestConditions.getIfUnmodifiedSince(), destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), destRequestConditions.getLeaseId(), null, null, - ModelHelper.tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), + tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.hasLegalHold(), sourceAuth, options.getCopySourceTagsMode(), this.encryptionScope, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyId())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java index 4462a5c9b745d..5e5bce8daed90 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobClientBase.java @@ -5,62 +5,30 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; import com.azure.core.http.RequestConditions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.PollingContext; import com.azure.core.util.polling.SyncPoller; import com.azure.storage.blob.BlobContainerClient; -import com.azure.storage.blob.BlobContainerClientBuilder; import com.azure.storage.blob.BlobServiceClient; import com.azure.storage.blob.BlobServiceVersion; -import com.azure.storage.blob.implementation.AzureBlobStorageImpl; -import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder; -import com.azure.storage.blob.implementation.accesshelpers.BlobPropertiesConstructorProxy; -import com.azure.storage.blob.implementation.models.BlobPropertiesInternalGetProperties; -import com.azure.storage.blob.implementation.models.BlobTag; -import com.azure.storage.blob.implementation.models.BlobTags; -import com.azure.storage.blob.implementation.models.BlobsCopyFromURLHeaders; -import com.azure.storage.blob.implementation.models.BlobsCreateSnapshotHeaders; -import com.azure.storage.blob.implementation.models.BlobsGetAccountInfoHeaders; -import com.azure.storage.blob.implementation.models.BlobsGetPropertiesHeaders; -import com.azure.storage.blob.implementation.models.BlobsGetTagsHeaders; -import com.azure.storage.blob.implementation.models.BlobsQueryHeaders; -import com.azure.storage.blob.implementation.models.BlobsSetImmutabilityPolicyHeaders; -import com.azure.storage.blob.implementation.models.BlobsSetLegalHoldHeaders; -import com.azure.storage.blob.implementation.models.BlobsStartCopyFromURLHeaders; -import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.models.InternalBlobLegalHoldResult; -import com.azure.storage.blob.implementation.models.QueryRequest; -import com.azure.storage.blob.implementation.models.QuerySerialization; -import com.azure.storage.blob.implementation.util.BlobQueryReader; -import com.azure.storage.blob.implementation.util.BlobRequestConditionProperty; -import com.azure.storage.blob.implementation.util.BlobSasImplUtil; import com.azure.storage.blob.implementation.util.ByteBufferBackedOutputStreamUtil; import com.azure.storage.blob.implementation.util.ChunkedDownloadUtils; import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AccessTier; -import com.azure.storage.blob.models.BlobBeginCopySourceRequestConditions; import com.azure.storage.blob.models.BlobCopyInfo; import com.azure.storage.blob.models.BlobDownloadAsyncResponse; import com.azure.storage.blob.models.BlobDownloadContentAsyncResponse; import com.azure.storage.blob.models.BlobDownloadContentResponse; import com.azure.storage.blob.models.BlobDownloadResponse; -import com.azure.storage.blob.models.BlobErrorCode; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobImmutabilityPolicy; -import com.azure.storage.blob.models.BlobImmutabilityPolicyMode; import com.azure.storage.blob.models.BlobLegalHoldResult; import com.azure.storage.blob.models.BlobProperties; import com.azure.storage.blob.models.BlobQueryAsyncResponse; @@ -70,7 +38,6 @@ import com.azure.storage.blob.models.BlobSeekableByteChannelReadResult; import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.ConsistentReadControl; -import com.azure.storage.blob.models.CopyStatusType; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.models.DeleteSnapshotsOptionType; @@ -90,9 +57,8 @@ import com.azure.storage.blob.options.BlobSetTagsOptions; import com.azure.storage.blob.sas.BlobServiceSasSignatureValues; import com.azure.storage.common.StorageSharedKeyCredential; -import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; -import com.azure.storage.common.implementation.SasImplUtils; +import com.azure.storage.common.implementation.FluxInputStream; import com.azure.storage.common.implementation.StorageImplUtils; import com.azure.storage.common.implementation.StorageSeekableByteChannel; import reactor.core.publisher.Mono; @@ -101,8 +67,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.UncheckedIOException; -import java.net.MalformedURLException; -import java.net.URI; import java.net.URL; import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; @@ -111,25 +75,13 @@ import java.nio.file.StandardOpenOption; import java.time.Duration; import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashMap; import java.util.HashSet; -import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.Callable; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiFunction; -import java.util.function.Function; import java.util.function.Consumer; -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapServiceCallWithExceptionMapping; -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; import static com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; /** * This class provides a client that contains all operations that apply to any blob type. @@ -140,42 +92,6 @@ */ public class BlobClientBase { private static final ClientLogger LOGGER = new ClientLogger(BlobClientBase.class); - private static final Set DEFAULT_OPEN_OPTIONS_SET = Collections.unmodifiableSet(new HashSet<>( - Arrays.asList(StandardOpenOption.CREATE_NEW, StandardOpenOption.READ, StandardOpenOption.WRITE))); - - /** - * Backing REST client for the blob client. - */ - protected final AzureBlobStorageImpl azureBlobStorage; - - private final String snapshot; - private final String versionId; - private final CpkInfo customerProvidedKey; - - /** - * Encryption scope of the blob. - */ - protected final EncryptionScope encryptionScope; - - /** - * Storage account name that contains the blob. - */ - protected final String accountName; - - /** - * Container name that contains the blob. - */ - protected final String containerName; - - /** - * Name of the blob. - */ - protected final String blobName; - - /** - * Storage REST API version used in requests to the Storage service. - */ - protected final BlobServiceVersion serviceVersion; private final BlobAsyncClientBase client; @@ -185,80 +101,7 @@ public class BlobClientBase { * @param client the async blob client */ protected BlobClientBase(BlobAsyncClientBase client) { - if (client.getSnapshotId() != null && client.getVersionId() != null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("'snapshot' and 'versionId' cannot be used at the same time.")); - } this.client = client; - this.azureBlobStorage = new AzureBlobStorageImplBuilder() - .pipeline(client.getHttpPipeline()) - .url(client.getAccountUrl()) - .version(client.getServiceVersion().getVersion()) - .buildClient(); - this.serviceVersion = client.getServiceVersion(); - - this.accountName = client.getAccountName(); - this.containerName = client.getContainerName(); - this.blobName = client.getBlobName(); - this.snapshot = client.getSnapshotId(); - this.customerProvidedKey = client.getCustomerProvidedKey(); - this.encryptionScope = new EncryptionScope().setEncryptionScope(client.getEncryptionScope()); - this.versionId = client.getVersionId(); - /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer - when the sas token has already been applied. */ - try { - URI.create(getBlobUrl()); - } catch (IllegalArgumentException ex) { - throw LOGGER.logExceptionAsError(ex); - } - } - - /** - * Protected constructor for use by {@link SpecializedBlobClientBuilder}. - * - * @param client the async blob client - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param blobName The blob name. - * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version. - */ - protected BlobClientBase(BlobAsyncClientBase client, HttpPipeline pipeline, String url, - BlobServiceVersion serviceVersion, String accountName, String containerName, String blobName, String snapshot, - CpkInfo customerProvidedKey, EncryptionScope encryptionScope, String versionId) { - if (snapshot != null && versionId != null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("'snapshot' and 'versionId' cannot be used at the same time.")); - } - this.client = client; - this.azureBlobStorage = new AzureBlobStorageImplBuilder() - .pipeline(pipeline) - .url(url) - .version(serviceVersion.getVersion()) - .buildClient(); - this.serviceVersion = serviceVersion; - - this.accountName = accountName; - this.containerName = containerName; - this.blobName = blobName; - this.snapshot = snapshot; - this.customerProvidedKey = customerProvidedKey; - this.encryptionScope = encryptionScope; - this.versionId = versionId; - /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer - when the sas token has already been applied. */ - try { - URI.create(getBlobUrl()); - } catch (IllegalArgumentException ex) { - throw LOGGER.logExceptionAsError(ex); - } } /** @@ -268,9 +111,7 @@ protected BlobClientBase(BlobAsyncClientBase client, HttpPipeline pipeline, Stri * @return a {@link BlobClientBase} used to interact with the specific snapshot. */ public BlobClientBase getSnapshotClient(String snapshot) { - return new BlobClientBase(this.client.getSnapshotClient(snapshot), getHttpPipeline(), getAccountUrl(), - getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), snapshot, - getCustomerProvidedKey(), encryptionScope, getVersionId()); + return new BlobClientBase(client.getSnapshotClient(snapshot)); } /** @@ -281,9 +122,7 @@ public BlobClientBase getSnapshotClient(String snapshot) { * @return a {@link BlobClientBase} used to interact with the specific version. */ public BlobClientBase getVersionClient(String versionId) { - return new BlobClientBase(this.client.getVersionClient(versionId), getHttpPipeline(), getAccountUrl(), - getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), - getCustomerProvidedKey(), encryptionScope, versionId); + return new BlobClientBase(client.getVersionClient(versionId)); } /** @@ -293,13 +132,7 @@ public BlobClientBase getVersionClient(String versionId) { * @return a {@link BlobClientBase} with the specified {@code encryptionScope}. */ public BlobClientBase getEncryptionScopeClient(String encryptionScope) { - EncryptionScope finalEncryptionScope = null; - if (encryptionScope != null) { - finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope); - } - return new BlobClientBase(this.client.getEncryptionScopeAsyncClient(encryptionScope), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), snapshot, - getCustomerProvidedKey(), finalEncryptionScope, getVersionId()); + return new BlobClientBase(client.getEncryptionScopeAsyncClient(encryptionScope)); } /** @@ -310,16 +143,7 @@ public BlobClientBase getEncryptionScopeClient(String encryptionScope) { * @return a {@link BlobClientBase} with the specified {@code customerProvidedKey}. */ public BlobClientBase getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) { - CpkInfo finalCustomerProvidedKey = null; - if (customerProvidedKey != null) { - finalCustomerProvidedKey = new CpkInfo() - .setEncryptionKey(customerProvidedKey.getKey()) - .setEncryptionKeySha256(customerProvidedKey.getKeySha256()) - .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm()); - } - return new BlobClientBase(this.client.getCustomerProvidedKeyAsyncClient(customerProvidedKey), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), snapshot, - finalCustomerProvidedKey, encryptionScope, getVersionId()); + return new BlobClientBase(client.getCustomerProvidedKeyAsyncClient(customerProvidedKey)); } /** @@ -328,7 +152,7 @@ public BlobClientBase getCustomerProvidedKeyClient(CustomerProvidedKey customerP * @return the URL of the storage account */ public String getAccountUrl() { - return azureBlobStorage.getUrl(); + return client.getAccountUrl(); } /** @@ -337,14 +161,7 @@ public String getAccountUrl() { * @return the URL. */ public String getBlobUrl() { - String blobUrl = azureBlobStorage.getUrl() + "/" + containerName + "/" + Utility.urlEncode(blobName); - if (this.isSnapshot()) { - blobUrl = Utility.appendQueryParameter(blobUrl, "snapshot", getSnapshotId()); - } - if (this.getVersionId() != null) { - blobUrl = Utility.appendQueryParameter(blobUrl, "versionid", getVersionId()); - } - return blobUrl; + return client.getBlobUrl(); } /** @@ -353,7 +170,7 @@ public String getBlobUrl() { * @return account name associated with this storage resource. */ public String getAccountName() { - return this.accountName; + return client.getAccountName(); } /** @@ -371,7 +188,7 @@ public String getAccountName() { * @return The name of the container. */ public final String getContainerName() { - return this.containerName; + return client.getContainerName(); } /** @@ -389,15 +206,7 @@ public final String getContainerName() { * @return {@link BlobContainerClient} */ public BlobContainerClient getContainerClient() { - CustomerProvidedKey encryptionKey = this.customerProvidedKey == null ? null - : new CustomerProvidedKey(this.customerProvidedKey.getEncryptionKey()); - return new BlobContainerClientBuilder() - .endpoint(this.getBlobUrl()) - .pipeline(this.getHttpPipeline()) - .serviceVersion(this.serviceVersion) - .customerProvidedKey(encryptionKey) - .encryptionScope(this.getEncryptionScope()).buildClient(); - //return client.getContainerClientBuilder().buildClient(); + return client.getContainerClientBuilder().buildClient(); } /** @@ -415,7 +224,7 @@ public BlobContainerClient getContainerClient() { * @return The decoded name of the blob. */ public final String getBlobName() { - return this.blobName; + return client.getBlobName(); } /** @@ -424,7 +233,7 @@ public final String getBlobName() { * @return The pipeline. */ public HttpPipeline getHttpPipeline() { - return azureBlobStorage.getHttpPipeline(); + return client.getHttpPipeline(); } /** @@ -433,7 +242,7 @@ public HttpPipeline getHttpPipeline() { * @return the customer provided key used for encryption. */ public CpkInfo getCustomerProvidedKey() { - return this.customerProvidedKey; + return client.getCustomerProvidedKey(); } /** @@ -442,11 +251,7 @@ public CpkInfo getCustomerProvidedKey() { * @return the encryption scope used for encryption. */ public String getEncryptionScope() { - if (encryptionScope == null) { - return null; - } - return encryptionScope.getEncryptionScope(); - //return client.getEncryptionScope(); + return client.getEncryptionScope(); } /** @@ -455,7 +260,7 @@ public String getEncryptionScope() { * @return the service version the client is using. */ public BlobServiceVersion getServiceVersion() { - return this.serviceVersion; + return client.getServiceVersion(); } /** @@ -464,7 +269,7 @@ public BlobServiceVersion getServiceVersion() { * @return A string that represents the snapshotId of the snapshot blob */ public String getSnapshotId() { - return this.snapshot; + return client.getSnapshotId(); } /** @@ -473,7 +278,7 @@ public String getSnapshotId() { * @return A string that represents the versionId of the snapshot blob */ public String getVersionId() { - return this.versionId; + return client.getVersionId(); } /** @@ -482,7 +287,7 @@ public String getVersionId() { * @return A boolean that indicates if a blob is a snapshot */ public boolean isSnapshot() { - return this.snapshot != null; + return client.isSnapshot(); } /** @@ -692,26 +497,9 @@ public Boolean exists() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response existsWithResponse(Duration timeout, Context context) { - try { - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getBlobs().getPropertiesNoCustomHeadersWithResponse(containerName, blobName, - snapshot, versionId, null, null, null, null, null, null, null, null, customerProvidedKey, context)); - return new SimpleResponse<>(sendRequest(operation, timeout, BlobStorageException.class), true); - } catch (RuntimeException e) { - if (e instanceof HttpResponseException) { - HttpResponse response = ((HttpResponseException) e).getResponse(); - if (e instanceof BlobStorageException - && BlobErrorCode.BLOB_USES_CUSTOMER_SPECIFIED_ENCRYPTION.equals(((BlobStorageException) e).getErrorCode())) { - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), true); - } else if (ModelHelper.checkBlobDoesNotExistStatusCode(e)) { - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), false); - } else { - throw LOGGER.logExceptionAsError(e); - } - } else { - throw LOGGER.logExceptionAsError(e); - } - } + Mono> response = client.existsWithResponse(context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -836,99 +624,7 @@ public SyncPoller beginCopy(String sourceUrl, Map beginCopy(BlobBeginCopyOptions options) { - StorageImplUtils.assertNotNull("options", options); - final AtomicReference copyId = new AtomicReference<>(); - final Duration interval = options.getPollInterval() != null ? options.getPollInterval() : Duration.ofSeconds(1); - final BlobBeginCopySourceRequestConditions sourceModifiedConditions = - options.getSourceRequestConditions() == null - ? new BlobBeginCopySourceRequestConditions() - : options.getSourceRequestConditions(); - final BlobRequestConditions destinationRequestConditions = - options.getDestinationRequestConditions() == null - ? new BlobRequestConditions() - : options.getDestinationRequestConditions(); - final BlobImmutabilityPolicy immutabilityPolicy = options.getImmutabilityPolicy() == null - ? new BlobImmutabilityPolicy() : options.getImmutabilityPolicy(); - - Function, PollResponse> syncActivationOperation = (pollingContext) -> { - try { - new URL(options.getSourceUrl()); - } catch (MalformedURLException ex) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'sourceUrl' is not a valid url.", ex)); - } - ResponseBase response = - wrapServiceCallWithExceptionMapping(() -> azureBlobStorage.getBlobs().startCopyFromURLWithResponse( - containerName, blobName, options.getSourceUrl(), null, options.getMetadata(), options.getTier(), - options.getRehydratePriority(), sourceModifiedConditions.getIfModifiedSince(), - sourceModifiedConditions.getIfUnmodifiedSince(), sourceModifiedConditions.getIfMatch(), - sourceModifiedConditions.getIfNoneMatch(), sourceModifiedConditions.getTagsConditions(), - destinationRequestConditions.getIfModifiedSince(), - destinationRequestConditions.getIfUnmodifiedSince(), destinationRequestConditions.getIfMatch(), - destinationRequestConditions.getIfNoneMatch(), destinationRequestConditions.getTagsConditions(), - destinationRequestConditions.getLeaseId(), null, ModelHelper.tagsToString(options.getTags()), - options.isSealDestination(), immutabilityPolicy.getExpiryTime(), - immutabilityPolicy.getPolicyMode(), options.isLegalHold(), Context.NONE)); - - BlobsStartCopyFromURLHeaders headers = response.getDeserializedHeaders(); - copyId.set(headers.getXMsCopyId()); - - return new PollResponse<>( - LongRunningOperationStatus.IN_PROGRESS, - new BlobCopyInfo(options.getSourceUrl(), headers.getXMsCopyId(), headers.getXMsCopyStatus(), - headers.getETag(), headers.getLastModified(), ModelHelper.getErrorCode(response.getHeaders()), - headers.getXMsVersionId()) - ); - }; - - Function, PollResponse> pollOperation = (pollingContext) -> - onPoll(pollingContext.getLatestResponse(), destinationRequestConditions); - - BiFunction, PollResponse, BlobCopyInfo> cancelOperation = - (pollingContext, firstResponse) -> { - if (firstResponse == null || firstResponse.getValue() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Cannot cancel a poll response that never started.")); - } - final String copyIdentifier = firstResponse.getValue().getCopyId(); - if (!CoreUtils.isNullOrEmpty(copyIdentifier)) { - LOGGER.info("Cancelling copy operation for copy id: {}", copyIdentifier); - abortCopyFromUrl(copyIdentifier); - return firstResponse.getValue(); - } - return null; - }; - - Function, Void> fetchResultOperation = (pollingContext) -> null; - return SyncPoller.createPoller(interval, syncActivationOperation, pollOperation, cancelOperation, - fetchResultOperation); - } - - - private PollResponse onPoll(PollResponse pollResponse, - BlobRequestConditions requestConditions) { - if (pollResponse.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED - || pollResponse.getStatus() == LongRunningOperationStatus.FAILED) { - return pollResponse; - } - - final BlobCopyInfo lastInfo = pollResponse.getValue(); - if (lastInfo == null) { - LOGGER.warning("BlobCopyInfo does not exist. Activation operation failed."); - return new PollResponse<>(LongRunningOperationStatus.fromString("COPY_START_FAILED", true), null); - } - - try { - Response response = getPropertiesWithResponse(requestConditions, null, null); - BlobProperties value = response.getValue(); - final CopyStatusType status = value.getCopyStatus(); - final BlobCopyInfo result = new BlobCopyInfo(value.getCopySource(), value.getCopyId(), status, - value.getETag(), value.getCopyCompletionTime(), value.getCopyStatusDescription(), value.getVersionId()); - - LongRunningOperationStatus operationStatus = ModelHelper.mapStatusToLongRunningOperationStatus(status); - return new PollResponse<>(operationStatus, result); - } catch (RuntimeException e) { - return new PollResponse<>(LongRunningOperationStatus.fromString("POLLING_FAILED", true), lastInfo); - } + return client.beginCopy(options).getSyncPoller(); } @@ -979,13 +675,8 @@ public void abortCopyFromUrl(String copyId) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response abortCopyFromUrlWithResponse(String copyId, String leaseId, Duration timeout, - Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().abortCopyFromURLNoCustomHeadersWithResponse(containerName, blobName, - copyId, null, leaseId, null, finalContext)); - - return sendRequest(operation, timeout, BlobStorageException.class); + Context context) { + return blockWithOptionalTimeout(client.abortCopyFromUrlWithResponse(copyId, leaseId, context), timeout); } /** @@ -1098,36 +789,10 @@ public Response copyFromUrlWithResponse(String copySource, Map copyFromUrlWithResponse(BlobCopyFromUrlOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - RequestConditions sourceModifiedRequestConditions = options.getSourceRequestConditions() == null - ? new RequestConditions() : options.getSourceRequestConditions(); - BlobRequestConditions destRequestConditions = options.getDestinationRequestConditions() == null - ? new BlobRequestConditions() : options.getDestinationRequestConditions(); - BlobImmutabilityPolicy immutabilityPolicy = options.getImmutabilityPolicy() == null - ? new BlobImmutabilityPolicy() : options.getImmutabilityPolicy(); - - try { - new URL(options.getCopySource()); - } catch (MalformedURLException ex) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'copySource' is not a valid url.", ex)); - } - String sourceAuth = options.getSourceAuthorization() == null - ? null : options.getSourceAuthorization().toString(); - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getBlobs().copyFromURLWithResponse(containerName, blobName, - options.getCopySource(), null, options.getMetadata(), options.getTier(), - sourceModifiedRequestConditions.getIfModifiedSince(), - sourceModifiedRequestConditions.getIfUnmodifiedSince(), sourceModifiedRequestConditions.getIfMatch(), - sourceModifiedRequestConditions.getIfNoneMatch(), destRequestConditions.getIfModifiedSince(), - destRequestConditions.getIfUnmodifiedSince(), destRequestConditions.getIfMatch(), - destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), - destRequestConditions.getLeaseId(), null, null, ModelHelper.tagsToString(options.getTags()), - immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.hasLegalHold(), - sourceAuth, options.getCopySourceTagsMode(), this.encryptionScope, context)); + Mono> response = client + .copyFromUrlWithResponse(options, context); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsCopyId()); + return blockWithOptionalTimeout(response, timeout); } /** @@ -1648,16 +1313,10 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(DeleteSnapshotsOptionType deleteBlobSnapshotOptions, BlobRequestConditions requestConditions, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - azureBlobStorage.getBlobs().deleteNoCustomHeadersWithResponse(containerName, blobName, snapshot, versionId, - null, finalRequestConditions.getLeaseId(), deleteBlobSnapshotOptions, - finalRequestConditions.getIfModifiedSince(), finalRequestConditions.getIfUnmodifiedSince(), - finalRequestConditions.getIfMatch(), finalRequestConditions.getIfNoneMatch(), - finalRequestConditions.getTagsConditions(), null, null, finalContext)); + Mono> response = client + .deleteWithResponse(deleteBlobSnapshotOptions, requestConditions, context); - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(response, timeout); } /** @@ -1717,19 +1376,8 @@ public boolean deleteIfExists() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteIfExistsWithResponse(DeleteSnapshotsOptionType deleteBlobSnapshotOptions, BlobRequestConditions requestConditions, Duration timeout, Context context) { - try { - Response response = this.deleteWithResponse(deleteBlobSnapshotOptions, requestConditions, timeout, - context); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), true); - } catch (RuntimeException e) { - if (ModelHelper.checkBlobDoesNotExistStatusCode(e) && e instanceof HttpResponseException) { - HttpResponse response = ((HttpResponseException) e).getResponse(); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - false); - } else { - throw LOGGER.logExceptionAsError(e); - } - } + return blockWithOptionalTimeout(client.deleteIfExistsWithResponse(deleteBlobSnapshotOptions, + requestConditions, context), timeout); } /** @@ -1780,19 +1428,9 @@ public BlobProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getBlobs().getPropertiesWithResponse(containerName, blobName, snapshot, versionId, - null, finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, - customerProvidedKey, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response, BlobPropertiesConstructorProxy - .create(new BlobPropertiesInternalGetProperties(response.getDeserializedHeaders()))); + Mono> response = client.getPropertiesWithResponse(requestConditions, context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -1850,18 +1488,10 @@ public void setHttpHeaders(BlobHttpHeaders headers) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setHttpHeadersWithResponse(BlobHttpHeaders headers, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() - : requestConditions; - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().setHttpHeadersNoCustomHeadersWithResponse(containerName, blobName, null, - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, headers, - finalContext)); + Mono> response = client + .setHttpHeadersWithResponse(headers, requestConditions, context); - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(response, timeout); } /** @@ -1917,18 +1547,9 @@ public void setMetadata(Map metadata) { @ServiceMethod(returns = ReturnType.SINGLE) public Response setMetadataWithResponse(Map metadata, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() - : requestConditions; - Context finalContext = context == null ? Context.NONE : context; + Mono> response = client.setMetadataWithResponse(metadata, requestConditions, context); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().setMetadataNoCustomHeadersWithResponse(containerName, blobName, null, - metadata, finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, - customerProvidedKey, encryptionScope, finalContext)); - - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(response, timeout); } /** @@ -1977,22 +1598,9 @@ public Map getTags() { @ServiceMethod(returns = ReturnType.SINGLE) public Response> getTagsWithResponse(BlobGetTagsOptions options, Duration timeout, Context context) { - BlobGetTagsOptions finalTagOptions = (options == null) ? new BlobGetTagsOptions() : options; - BlobRequestConditions requestConditions = (finalTagOptions.getRequestConditions() == null) - ? new BlobRequestConditions() : finalTagOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getBlobs().getTagsWithResponse(containerName, blobName, null, null, snapshot, - versionId, requestConditions.getTagsConditions(), requestConditions.getLeaseId(), finalContext)); - - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - Map tags = new HashMap<>(); - for (BlobTag tag : response.getValue().getBlobTagSet()) { - tags.put(tag.getKey(), tag.getValue()); - } - return new SimpleResponse<>(response, tags); + Mono>> response = client.getTagsWithResponse(options, context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -2043,23 +1651,9 @@ public void setTags(Map tags) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response setTagsWithResponse(BlobSetTagsOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions requestConditions = (options.getRequestConditions() == null) - ? new BlobRequestConditions() : options.getRequestConditions(); - List tagList = null; - if (options.getTags() != null) { - tagList = new ArrayList<>(); - for (Map.Entry entry : options.getTags().entrySet()) { - tagList.add(new BlobTag().setKey(entry.getKey()).setValue(entry.getValue())); - } - } - BlobTags t = new BlobTags().setBlobTagSet(tagList); - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().setTagsNoCustomHeadersWithResponse(containerName, blobName, null, - versionId, null, null, null, requestConditions.getTagsConditions(), requestConditions.getLeaseId(), t, - finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = client.setTagsWithResponse(options, context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -2115,18 +1709,11 @@ public BlobClientBase createSnapshot() { @ServiceMethod(returns = ReturnType.SINGLE) public Response createSnapshotWithResponse(Map metadata, BlobRequestConditions requestConditions, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getBlobs().createSnapshotWithResponse(containerName, blobName, null, metadata, - finalRequestConditions.getIfModifiedSince(), finalRequestConditions.getIfUnmodifiedSince(), - finalRequestConditions.getIfMatch(), finalRequestConditions.getIfNoneMatch(), - finalRequestConditions.getTagsConditions(), finalRequestConditions.getLeaseId(), null, - customerProvidedKey, encryptionScope, finalContext)); + Mono> response = client + .createSnapshotWithResponse(metadata, requestConditions, context) + .map(rb -> new SimpleResponse<>(rb, new BlobClientBase(rb.getValue()))); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, this.getSnapshotClient(response.getDeserializedHeaders().getXMsSnapshot())); + return blockWithOptionalTimeout(response, timeout); } /** @@ -2217,14 +1804,7 @@ public Response setAccessTierWithResponse(AccessTier tier, RehydratePriori @ServiceMethod(returns = ReturnType.SINGLE) public Response setAccessTierWithResponse(BlobSetAccessTierOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().setTierNoCustomHeadersWithResponse(containerName, blobName, - options.getTier(), snapshot, versionId, null, options.getPriority(), null, options.getLeaseId(), - options.getTagsConditions(), finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + return blockWithOptionalTimeout(client.setTierWithResponse(options, context), timeout); } /** @@ -2268,11 +1848,9 @@ public void undelete() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response undeleteWithResponse(Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().undeleteNoCustomHeadersWithResponse(containerName, blobName, null, null, - finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = client.undeleteWithResponse(context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -2318,14 +1896,9 @@ public StorageAccountInfo getAccountInfo() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAccountInfoWithResponse(Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getBlobs().getAccountInfoWithResponse(containerName, blobName, finalContext)); + Mono> response = client.getAccountInfoWithResponse(context); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - BlobsGetAccountInfoHeaders hd = response.getDeserializedHeaders(); - return new SimpleResponse<>(response, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind())); + return blockWithOptionalTimeout(response, timeout); } /** @@ -2354,8 +1927,7 @@ public Response getAccountInfoWithResponse(Duration timeout, */ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey) { - return generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, getAccountName(), - Context.NONE); + return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey); } /** @@ -2406,9 +1978,8 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic */ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, Consumer stringToSignHandler, Context context) { - return new BlobSasImplUtil(blobServiceSasSignatureValues, getContainerName(), getBlobName(), - getSnapshotId(), getVersionId(), getEncryptionScope()) - .generateUserDelegationSas(userDelegationKey, accountName, stringToSignHandler, context); + return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, accountName, + stringToSignHandler, context); } /** @@ -2435,7 +2006,7 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic * @return A {@code String} representing the SAS query parameters. */ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues) { - return generateSas(blobServiceSasSignatureValues, Context.NONE); + return this.client.generateSas(blobServiceSasSignatureValues); } /** @@ -2481,9 +2052,7 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV */ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues, Consumer stringToSignHandler, Context context) { - return new BlobSasImplUtil(blobServiceSasSignatureValues, getContainerName(), getBlobName(), - getSnapshotId(), getVersionId(), getEncryptionScope()) - .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context); + return this.client.generateSas(blobServiceSasSignatureValues, stringToSignHandler, context); } /** @@ -2552,34 +2121,16 @@ public InputStream openQueryInputStream(String expression) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response openQueryInputStreamWithResponse(BlobQueryOptions queryOptions) { - StorageImplUtils.assertNotNull("options", queryOptions); - BlobRequestConditions requestConditions = queryOptions.getRequestConditions() == null - ? new BlobRequestConditions() : queryOptions.getRequestConditions(); - QuerySerialization in = BlobQueryReader.transformInputSerialization(queryOptions.getInputSerialization(), - LOGGER); - QuerySerialization out = BlobQueryReader.transformOutputSerialization(queryOptions.getOutputSerialization(), - LOGGER); - - QueryRequest qr = new QueryRequest() - .setExpression(queryOptions.getExpression()) - .setInputSerialization(in) - .setOutputSerialization(out); - - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().queryWithResponse(containerName, blobName, getSnapshotId(), null, - requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, qr, - getCustomerProvidedKey(), Context.NONE)); - InputStream avroInputStream = response.getValue(); - BlobQueryReader reader = new BlobQueryReader(null, queryOptions.getProgressConsumer(), - queryOptions.getErrorConsumer()); - try { - InputStream resultStream = reader.readInputStream(avroInputStream); - return new SimpleResponse<>(response, resultStream); - } catch (IOException e) { - throw LOGGER.logExceptionAsError(new UncheckedIOException(e)); + + // Data to subscribe to and read from. + BlobQueryAsyncResponse response = client.queryWithResponse(queryOptions).block(); + + // Create input stream from the data. + if (response == null) { + throw LOGGER.logExceptionAsError(new IllegalStateException("Query response cannot be null")); } + return new ResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + new FluxInputStream(response.getValue()), response.getDeserializedHeaders()); } /** @@ -2656,49 +2207,12 @@ public void query(OutputStream stream, String expression) { public BlobQueryResponse queryWithResponse(BlobQueryOptions queryOptions, Duration timeout, Context context) { StorageImplUtils.assertNotNull("options", queryOptions); StorageImplUtils.assertNotNull("outputStream", queryOptions.getOutputStream()); - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions requestConditions = queryOptions.getRequestConditions() == null - ? new BlobRequestConditions() : queryOptions.getRequestConditions(); - QuerySerialization in = BlobQueryReader.transformInputSerialization(queryOptions.getInputSerialization(), - LOGGER); - QuerySerialization out = BlobQueryReader.transformOutputSerialization(queryOptions.getOutputSerialization(), - LOGGER); - - QueryRequest qr = new QueryRequest() - .setExpression(queryOptions.getExpression()) - .setInputSerialization(in) - .setOutputSerialization(out); - - Callable> operation = () -> { - ResponseBase response = wrapServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().queryWithResponse(containerName, blobName, getSnapshotId(), null, - requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, qr, - getCustomerProvidedKey(), finalContext)); - - InputStream avroInputStream = response.getValue(); - BlobQueryReader reader = new BlobQueryReader(null, queryOptions.getProgressConsumer(), - queryOptions.getErrorConsumer()); - InputStream resultStream = reader.readInputStream(avroInputStream); - OutputStream outputStream = queryOptions.getOutputStream(); - byte[] buffer = new byte[4096]; - int bytesRead; - while ((bytesRead = resultStream.read(buffer)) != -1) { - outputStream.write(buffer, 0, bytesRead); - } - - return response; - }; - - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - - BlobQueryAsyncResponse asyncResponse = new BlobQueryAsyncResponse(response.getRequest(), - response.getStatusCode(), response.getHeaders(), null, - ModelHelper.transformQueryHeaders(response.getDeserializedHeaders(), response.getHeaders())); - - return new BlobQueryResponse(asyncResponse); + Mono download = client + .queryWithResponse(queryOptions, context) + .flatMap(response -> FluxUtil.writeToOutputStream(response.getValue(), queryOptions.getOutputStream()) + .thenReturn(new BlobQueryResponse(response))); + + return blockWithOptionalTimeout(download, timeout); } /** @@ -2755,37 +2269,10 @@ public BlobImmutabilityPolicy setImmutabilityPolicy(BlobImmutabilityPolicy immut @ServiceMethod(returns = ReturnType.SINGLE) public Response setImmutabilityPolicyWithResponse(BlobImmutabilityPolicy immutabilityPolicy, BlobRequestConditions requestConditions, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - BlobImmutabilityPolicy finalImmutabilityPolicy = immutabilityPolicy == null ? new BlobImmutabilityPolicy() - : immutabilityPolicy; - if (BlobImmutabilityPolicyMode.MUTABLE.equals(finalImmutabilityPolicy.getPolicyMode())) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("immutabilityPolicy.policyMode must be %s or %s", - BlobImmutabilityPolicyMode.LOCKED.toString(), BlobImmutabilityPolicyMode.UNLOCKED.toString()))); - } + Mono> response = client.setImmutabilityPolicyWithResponse(immutabilityPolicy, + requestConditions, context); - BlobRequestConditions finalRequestConditions = requestConditions == null - ? new BlobRequestConditions() : requestConditions; - - ModelHelper.validateConditionsNotPresent(finalRequestConditions, - EnumSet.of(BlobRequestConditionProperty.LEASE_ID, BlobRequestConditionProperty.TAGS_CONDITIONS, - BlobRequestConditionProperty.IF_MATCH, BlobRequestConditionProperty.IF_NONE_MATCH, - BlobRequestConditionProperty.IF_MODIFIED_SINCE), "setImmutabilityPolicy(WithResponse)", - "requestConditions"); - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().setImmutabilityPolicyWithResponse(containerName, blobName, null, null, - finalRequestConditions.getIfUnmodifiedSince(), finalImmutabilityPolicy.getExpiryTime(), - finalImmutabilityPolicy.getPolicyMode(), finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - - BlobsSetImmutabilityPolicyHeaders headers = response.getDeserializedHeaders(); - BlobImmutabilityPolicy responsePolicy = new BlobImmutabilityPolicy() - .setPolicyMode(headers.getXMsImmutabilityPolicyMode()) - .setExpiryTime(headers.getXMsImmutabilityPolicyUntilDate()); - return new SimpleResponse<>(response, responsePolicy); + return blockWithOptionalTimeout(response, timeout); } /** @@ -2828,11 +2315,9 @@ public void deleteImmutabilityPolicy() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteImmutabilityPolicyWithResponse(Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getBlobs().deleteImmutabilityPolicyNoCustomHeadersWithResponse(containerName, - blobName, null, null, finalContext)); - return sendRequest(operation, timeout, BlobStorageException.class); + Mono> response = client.deleteImmutabilityPolicyWithResponse(context); + + return blockWithOptionalTimeout(response, timeout); } /** @@ -2877,14 +2362,8 @@ public BlobLegalHoldResult setLegalHold(boolean legalHold) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response setLegalHoldWithResponse(boolean legalHold, Duration timeout, Context context) { - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getBlobs().setLegalHoldWithResponse(containerName, blobName, legalHold, null, - null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response, - new InternalBlobLegalHoldResult(response.getDeserializedHeaders().isXMsLegalHold())); + Mono> response = client.setLegalHoldWithResponse(legalHold, context); + return blockWithOptionalTimeout(response, timeout); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClient.java index a623a848018a6..855fc1e82e021 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClient.java @@ -6,27 +6,12 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.HttpPipeline; import com.azure.core.http.RequestConditions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.storage.blob.BlobClient; import com.azure.storage.blob.BlobContainerClient; -import com.azure.storage.blob.implementation.AzureBlobStorageImpl; -import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder; -import com.azure.storage.blob.implementation.models.BlobsAcquireLeaseHeaders; -import com.azure.storage.blob.implementation.models.BlobsBreakLeaseHeaders; -import com.azure.storage.blob.implementation.models.BlobsChangeLeaseHeaders; -import com.azure.storage.blob.implementation.models.BlobsRenewLeaseHeaders; -import com.azure.storage.blob.implementation.models.ContainersAcquireLeaseHeaders; -import com.azure.storage.blob.implementation.models.ContainersBreakLeaseHeaders; -import com.azure.storage.blob.implementation.models.ContainersChangeLeaseHeaders; -import com.azure.storage.blob.implementation.models.ContainersRenewLeaseHeaders; import com.azure.storage.blob.implementation.util.ModelHelper; -import com.azure.storage.blob.models.BlobLeaseRequestConditions; -import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.options.BlobAcquireLeaseOptions; import com.azure.storage.blob.options.BlobBreakLeaseOptions; import com.azure.storage.blob.options.BlobChangeLeaseOptions; @@ -36,10 +21,6 @@ import java.net.URL; import java.time.Duration; -import java.util.concurrent.Callable; - -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; /** * This class provides a client that contains all the leasing operations for {@link BlobContainerClient containers} and @@ -73,26 +54,10 @@ */ @ServiceClient(builder = BlobLeaseClientBuilder.class) public final class BlobLeaseClient { - private final String containerName; - private final String blobName; - private final boolean isBlob; - private final AzureBlobStorageImpl client; - private final String accountName; - - private volatile String leaseId; + private final BlobLeaseAsyncClient client; - BlobLeaseClient(HttpPipeline pipeline, String url, String containerName, String blobName, String leaseId, - boolean isBlob, String accountName, String serviceVersion) { - this.isBlob = isBlob; - this.leaseId = leaseId; - this.client = new AzureBlobStorageImplBuilder() - .pipeline(pipeline) - .url(url) - .version(serviceVersion) - .buildClient(); - this.accountName = accountName; - this.containerName = containerName; - this.blobName = blobName; + BlobLeaseClient(BlobLeaseAsyncClient client) { + this.client = client; } /** @@ -103,11 +68,7 @@ public final class BlobLeaseClient { * @return URL of the lease client. */ public String getResourceUrl() { - if (this.isBlob) { - return this.client.getUrl() + "/" + containerName + "/" + blobName; - } else { - return this.client.getUrl() + "/" + containerName; - } + return client.getResourceUrl(); } /** @@ -116,7 +77,7 @@ public String getResourceUrl() { * @return the lease ID. */ public String getLeaseId() { - return leaseId; + return client.getLeaseId(); } /** @@ -200,33 +161,8 @@ public Response acquireLeaseWithResponse(int durationInSeconds, RequestC @ServiceMethod(returns = ReturnType.SINGLE) public Response acquireLeaseWithResponse(BlobAcquireLeaseOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - BlobLeaseRequestConditions requestConditions = (options.getRequestConditions() == null) - ? new BlobLeaseRequestConditions() : options.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - - if (this.isBlob) { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getBlobs().acquireLeaseWithResponse(containerName, blobName, null, - options.getDuration(), this.leaseId, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - this.leaseId = response.getDeserializedHeaders().getXMsLeaseId(); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } else { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getContainers().acquireLeaseWithResponse(containerName, null, options.getDuration(), - this.leaseId, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - this.leaseId = response.getDeserializedHeaders().getXMsLeaseId(); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } + return StorageImplUtils.blockWithOptionalTimeout(this.client.acquireLeaseWithResponse(options, context), + timeout); } /** @@ -305,27 +241,7 @@ public Response renewLeaseWithResponse(RequestConditions modifiedRequest @ServiceMethod(returns = ReturnType.SINGLE) public Response renewLeaseWithResponse(BlobRenewLeaseOptions options, Duration timeout, Context context) { - BlobRenewLeaseOptions finalOptions = (options == null) ? new BlobRenewLeaseOptions() : options; - BlobLeaseRequestConditions requestConditions = (finalOptions.getRequestConditions() == null) - ? new BlobLeaseRequestConditions() : finalOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - if (this.isBlob) { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getBlobs().renewLeaseWithResponse(containerName, blobName, this.leaseId, null, - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } else { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getContainers().renewLeaseWithResponse(containerName, this.leaseId, null, - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } + return StorageImplUtils.blockWithOptionalTimeout(this.client.renewLeaseWithResponse(options, context), timeout); } /** @@ -403,23 +319,8 @@ public Response releaseLeaseWithResponse(RequestConditions modifiedRequest @ServiceMethod(returns = ReturnType.SINGLE) public Response releaseLeaseWithResponse(BlobReleaseLeaseOptions options, Duration timeout, Context context) { - BlobReleaseLeaseOptions finalOptions = (options == null) ? new BlobReleaseLeaseOptions() : options; - BlobLeaseRequestConditions requestConditions = (finalOptions.getRequestConditions() == null) - ? new BlobLeaseRequestConditions() : finalOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation; - if (this.isBlob) { - operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getBlobs().releaseLeaseNoCustomHeadersWithResponse(containerName, blobName, this.leaseId, - null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, finalContext)); - } else { - operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getContainers().releaseLeaseNoCustomHeadersWithResponse(containerName, this.leaseId, null, - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), null, finalContext)); - } - return sendRequest(operation, timeout, BlobStorageException.class); + return StorageImplUtils.blockWithOptionalTimeout(this.client.releaseLeaseWithResponse(options, context), + timeout); } /** @@ -511,30 +412,7 @@ public Response breakLeaseWithResponse(Integer breakPeriodInSeconds, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response breakLeaseWithResponse(BlobBreakLeaseOptions options, Duration timeout, Context context) { - BlobBreakLeaseOptions finalOptions = (options == null) ? new BlobBreakLeaseOptions() : options; - BlobLeaseRequestConditions requestConditions = (finalOptions.getRequestConditions() == null) - ? new BlobLeaseRequestConditions() : finalOptions.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - Integer breakPeriod = finalOptions.getBreakPeriod() == null ? null - : Math.toIntExact(finalOptions.getBreakPeriod().getSeconds()); - - if (this.isBlob) { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getBlobs().breakLeaseWithResponse(containerName, blobName, null, breakPeriod, - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseTime()); - } else { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> this.client.getContainers().breakLeaseWithResponse( - containerName, null, breakPeriod, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseTime()); - } + return StorageImplUtils.blockWithOptionalTimeout(this.client.breakLeaseWithResponse(options, context), timeout); } /** @@ -614,32 +492,8 @@ public Response changeLeaseWithResponse(String proposedId, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response changeLeaseWithResponse(BlobChangeLeaseOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - BlobLeaseRequestConditions requestConditions = (options.getRequestConditions() == null) - ? new BlobLeaseRequestConditions() : options.getRequestConditions(); - Context finalContext = context == null ? Context.NONE : context; - - if (this.isBlob) { - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getBlobs().changeLeaseWithResponse(containerName, blobName, this.leaseId, - options.getProposedId(), null, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - this.leaseId = response.getDeserializedHeaders().getXMsLeaseId(); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } else { - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.client.getContainers().changeLeaseWithResponse(containerName, this.leaseId, - options.getProposedId(), null, requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - this.leaseId = response.getDeserializedHeaders().getXMsLeaseId(); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsLeaseId()); - } + return StorageImplUtils.blockWithOptionalTimeout(this.client.changeLeaseWithResponse(options, context), + timeout); } /** @@ -648,7 +502,7 @@ public Response changeLeaseWithResponse(BlobChangeLeaseOptions options, * @return account name associated with this storage resource. */ public String getAccountName() { - return this.accountName; + return client.getAccountName(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java index 4a2c112a543ff..8d232a3d0d6ee 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java @@ -86,9 +86,7 @@ public final class BlobLeaseClientBuilder { * @return a {@link BlobLeaseClient} based on the configurations in this builder. */ public BlobLeaseClient buildClient() { - BlobServiceVersion version = (serviceVersion == null) ? BlobServiceVersion.getLatest() : serviceVersion; - return new BlobLeaseClient(pipeline, url, containerName, blobName, getLeaseId(), isBlob, accountName, - version.getVersion()); + return new BlobLeaseClient(buildAsyncClient()); } /** @@ -98,8 +96,7 @@ public BlobLeaseClient buildClient() { */ public BlobLeaseAsyncClient buildAsyncClient() { BlobServiceVersion version = (serviceVersion == null) ? BlobServiceVersion.getLatest() : serviceVersion; - return new BlobLeaseAsyncClient(pipeline, url, containerName, blobName, getLeaseId(), isBlob, accountName, - version.getVersion()); + return new BlobLeaseAsyncClient(pipeline, url, containerName, blobName, getLeaseId(), isBlob, accountName, version.getVersion()); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java index 83ff58ec3055e..25e5a953c6670 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java @@ -19,7 +19,6 @@ import com.azure.storage.blob.implementation.models.BlockBlobsPutBlobFromUrlHeaders; import com.azure.storage.blob.implementation.models.BlockBlobsUploadHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobImmutabilityPolicy; @@ -435,7 +434,7 @@ Mono> uploadWithResponse(BlockBlobSimpleUploadOptions op requestConditions.getLeaseId(), options.getTier(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - ModelHelper.tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), + tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), null, options.getHeaders(), getCustomerProvidedKey(), encryptionScope, finalContext) .map(rb -> { @@ -587,7 +586,7 @@ Mono> uploadFromUrlWithResponse(BlobUploadFromUrlOptions sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), - null, options.getContentMd5(), ModelHelper.tagsToString(options.getTags()), + null, options.getContentMd5(), tagsToString(options.getTags()), options.isCopySourceBlobProperties(), sourceAuth, options.getCopySourceTagsMode(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { @@ -1151,7 +1150,7 @@ Mono> commitBlockListWithResponse(BlockBlobCommitBlockLi requestConditions.getLeaseId(), options.getTier(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, - ModelHelper.tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), + tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { BlockBlobsCommitBlockListHeaders hd = rb.getDeserializedHeaders(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobClient.java index 2bc2c3e51aaaa..7b3bfbadcccb0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobClient.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.UnexpectedLengthException; -import com.azure.core.http.HttpPipeline; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; @@ -15,8 +14,6 @@ import com.azure.storage.blob.BlobAsyncClient; import com.azure.storage.blob.BlobClient; import com.azure.storage.blob.BlobClientBuilder; -import com.azure.storage.blob.BlobServiceVersion; -import com.azure.storage.blob.implementation.models.EncryptionScope; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobRange; @@ -75,25 +72,25 @@ public final class BlockBlobClient extends BlobClientBase { * @deprecated Use {@link #MAX_STAGE_BLOCK_BYTES_LONG}. */ @Deprecated - public static final int MAX_UPLOAD_BLOB_BYTES = 256 * Constants.MB; + public static final int MAX_UPLOAD_BLOB_BYTES = BlockBlobAsyncClient.MAX_UPLOAD_BLOB_BYTES; /** * Indicates the maximum number of bytes that can be sent in a call to upload. */ - public static final long MAX_UPLOAD_BLOB_BYTES_LONG = 5000L * Constants.MB; + public static final long MAX_UPLOAD_BLOB_BYTES_LONG = BlockBlobAsyncClient.MAX_UPLOAD_BLOB_BYTES_LONG; /** * Indicates the maximum number of bytes that can be sent in a call to stageBlock. * @deprecated Use {@link #MAX_STAGE_BLOCK_BYTES_LONG} */ @Deprecated - public static final int MAX_STAGE_BLOCK_BYTES = 100 * Constants.MB; + public static final int MAX_STAGE_BLOCK_BYTES = BlockBlobAsyncClient.MAX_STAGE_BLOCK_BYTES; /** * Indicates the maximum number of bytes that can be sent in a call to stageBlock. */ - public static final long MAX_STAGE_BLOCK_BYTES_LONG = 4000L * Constants.MB; + public static final long MAX_STAGE_BLOCK_BYTES_LONG = BlockBlobAsyncClient.MAX_STAGE_BLOCK_BYTES_LONG; /** * Indicates the maximum number of blocks allowed in a block blob. */ - public static final int MAX_BLOCKS = 50000; + public static final int MAX_BLOCKS = BlockBlobAsyncClient.MAX_BLOCKS; /** * Package-private constructor for use by {@link SpecializedBlobClientBuilder}. @@ -101,32 +98,7 @@ public final class BlockBlobClient extends BlobClientBase { * @param client the async block blob client */ BlockBlobClient(BlockBlobAsyncClient client) { - this(client, client.getHttpPipeline(), client.getAccountUrl(), client.getServiceVersion(), client.getAccountName(), - client.getContainerName(), client.getBlobName(), client.getSnapshotId(), client.getCustomerProvidedKey(), - new EncryptionScope().setEncryptionScope(client.getEncryptionScope()), client.getVersionId()); - } - - /** - * Package-private constructor for use by {@link SpecializedBlobClientBuilder}. - * - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param blobName The blob name. - * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version. - */ - BlockBlobClient(BlockBlobAsyncClient client, HttpPipeline pipeline, String url, BlobServiceVersion serviceVersion, - String accountName, String containerName, String blobName, String snapshot, CpkInfo customerProvidedKey, - EncryptionScope encryptionScope, String versionId) { - super(client, pipeline, url, serviceVersion, accountName, containerName, blobName, snapshot, - customerProvidedKey, encryptionScope, versionId); + super(client); this.client = client; } @@ -138,13 +110,7 @@ public final class BlockBlobClient extends BlobClientBase { */ @Override public BlockBlobClient getEncryptionScopeClient(String encryptionScope) { - EncryptionScope finalEncryptionScope = null; - if (encryptionScope != null) { - finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope); - } - return new BlockBlobClient(client.getEncryptionScopeAsyncClient(encryptionScope), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), - getCustomerProvidedKey(), finalEncryptionScope, getVersionId()); + return new BlockBlobClient(client.getEncryptionScopeAsyncClient(encryptionScope)); } /** @@ -156,16 +122,7 @@ public BlockBlobClient getEncryptionScopeClient(String encryptionScope) { */ @Override public BlockBlobClient getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) { - CpkInfo finalCustomerProvidedKey = null; - if (customerProvidedKey != null) { - finalCustomerProvidedKey = new CpkInfo() - .setEncryptionKey(customerProvidedKey.getKey()) - .setEncryptionKeySha256(customerProvidedKey.getKeySha256()) - .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm()); - } - return new BlockBlobClient(client.getCustomerProvidedKeyAsyncClient(customerProvidedKey), getHttpPipeline(), - getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), - finalCustomerProvidedKey, encryptionScope, getVersionId()); + return new BlockBlobClient(client.getCustomerProvidedKeyAsyncClient(customerProvidedKey)); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 4212a3311de6a..dd92e87a943f4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -162,6 +162,23 @@ public PageBlobAsyncClient getCustomerProvidedKeyAsyncClient(CustomerProvidedKey getVersionId()); } + private static String pageRangeToString(PageRange pageRange) { + if (pageRange.getStart() < 0 || pageRange.getEnd() <= 0) { + throw new IllegalArgumentException("PageRange's start and end values must be greater than or equal to " + + "0 if specified."); + } + if (pageRange.getStart() % PAGE_BYTES != 0) { + throw new IllegalArgumentException("PageRange's start value must be a multiple of 512."); + } + if (pageRange.getEnd() % PAGE_BYTES != PAGE_BYTES - 1) { + throw new IllegalArgumentException("PageRange's end value must be 1 less than a multiple of 512."); + } + if (pageRange.getEnd() <= pageRange.getStart()) { + throw new IllegalArgumentException("PageRange's End value must be after the start."); + } + return "bytes=" + pageRange.getStart() + '-' + pageRange.getEnd(); + } + /** * Creates a page blob of the specified length. By default, this method will not overwrite an existing blob. * Call PutPage to upload data to a page blob. For more information, see the @@ -322,7 +339,7 @@ Mono> createWithResponse(PageBlobCreateOptions options, C options.getSize(), null, null, options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), - options.getSequenceNumber(), null, ModelHelper.tagsToString(options.getTags()), + options.getSequenceNumber(), null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), options.isLegalHold(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context) .map(rb -> { @@ -512,7 +529,7 @@ Mono> uploadPagesWithResponse(PageRange pageRange, Flux> uploadPagesFromUrlWithResponse(PageBlobUploadPagesF throw LOGGER.logExceptionAsError(new IllegalArgumentException("range cannot be null.")); } - String rangeString = ModelHelper.pageRangeToString(options.getRange()); + String rangeString = pageRangeToString(options.getRange()); long sourceOffset = options.getSourceOffset() == null ? 0L : options.getSourceOffset(); - String sourceRangeString = ModelHelper.pageRangeToString(new PageRange() + String sourceRangeString = pageRangeToString(new PageRange() .setStart(sourceOffset) .setEnd(sourceOffset + (options.getRange().getEnd() - options.getRange().getStart()))); @@ -786,7 +803,7 @@ Mono> clearPagesWithResponse(PageRange pageRange, // subscription. throw LOGGER.logExceptionAsError(new IllegalArgumentException("pageRange cannot be null.")); } - String pageRangeStr = ModelHelper.pageRangeToString(pageRange); + String pageRangeStr = pageRangeToString(pageRange); context = context == null ? Context.NONE : context; return this.azureBlobStorage.getPageBlobs().clearPagesWithResponseAsync(containerName, blobName, 0, diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index 9b34468cfdc82..f9b041e44ecba 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -7,42 +7,19 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.UnexpectedLengthException; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpRange; -import com.azure.core.http.HttpResponse; import com.azure.core.http.RequestConditions; +import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; -import com.azure.core.util.UrlBuilder; -import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.BlobClient; -import com.azure.storage.blob.BlobServiceVersion; -import com.azure.storage.blob.implementation.models.EncryptionScope; -import com.azure.storage.blob.implementation.models.PageBlobsClearPagesHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsCopyIncrementalHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsCreateHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsResizeHeaders; -import com.azure.storage.blob.implementation.models.PageBlobsUpdateSequenceNumberHeaders; -import com.azure.storage.blob.implementation.models.PageListHelper; import com.azure.storage.blob.implementation.util.ModelHelper; -import com.azure.storage.blob.models.BlobErrorCode; import com.azure.storage.blob.models.BlobHttpHeaders; -import com.azure.storage.blob.models.BlobImmutabilityPolicy; import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.CopyStatusType; -import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; -import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; import com.azure.storage.blob.models.PageBlobItem; import com.azure.storage.blob.models.PageBlobRequestConditions; import com.azure.storage.blob.models.PageList; @@ -61,21 +38,11 @@ import reactor.core.publisher.Mono; import java.io.InputStream; -import java.net.MalformedURLException; import java.net.URL; import java.nio.ByteBuffer; import java.time.Duration; -import java.util.Collections; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.concurrent.Callable; -import java.util.function.BiFunction; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping; -import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest; /** * Client to a page blob. It may only be instantiated through a {@link SpecializedBlobClientBuilder} or via the method @@ -88,18 +55,17 @@ */ @ServiceClient(builder = SpecializedBlobClientBuilder.class) public final class PageBlobClient extends BlobClientBase { - private static final ClientLogger LOGGER = new ClientLogger(PageBlobClient.class); private final PageBlobAsyncClient pageBlobAsyncClient; /** * Indicates the number of bytes in a page. */ - public static final int PAGE_BYTES = 512; + public static final int PAGE_BYTES = PageBlobAsyncClient.PAGE_BYTES; /** * Indicates the maximum number of bytes that may be sent in a call to putPage. */ - public static final int MAX_PUT_PAGES_BYTES = 4 * Constants.MB; + public static final int MAX_PUT_PAGES_BYTES = PageBlobAsyncClient.MAX_PUT_PAGES_BYTES; /** * Package-private constructor for use by {@link SpecializedBlobClientBuilder}. @@ -107,35 +73,7 @@ public final class PageBlobClient extends BlobClientBase { * @param pageBlobAsyncClient the async page blob client */ PageBlobClient(PageBlobAsyncClient pageBlobAsyncClient) { - this(pageBlobAsyncClient, pageBlobAsyncClient.getHttpPipeline(), pageBlobAsyncClient.getAccountUrl(), - pageBlobAsyncClient.getServiceVersion(), pageBlobAsyncClient.getAccountName(), - pageBlobAsyncClient.getContainerName(), pageBlobAsyncClient.getBlobName(), - pageBlobAsyncClient.getSnapshotId(), pageBlobAsyncClient.getCustomerProvidedKey(), - new EncryptionScope().setEncryptionScope(pageBlobAsyncClient.getEncryptionScope()), - pageBlobAsyncClient.getVersionId()); - } - - /** - * Package-private constructor for use by {@link SpecializedBlobClientBuilder}. - * - * @param pipeline The pipeline used to send and receive service requests. - * @param url The endpoint where to send service requests. - * @param serviceVersion The version of the service to receive requests. - * @param accountName The storage account name. - * @param containerName The container name. - * @param blobName The blob name. - * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly. - * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass - * {@code null} to allow the service to use its own encryption. - * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version. - */ - PageBlobClient(PageBlobAsyncClient pageBlobAsyncClient, HttpPipeline pipeline, String url, - BlobServiceVersion serviceVersion, String accountName, String containerName, String blobName, String snapshot, CpkInfo customerProvidedKey, - EncryptionScope encryptionScope, String versionId) { - super(pageBlobAsyncClient, pipeline, url, serviceVersion, accountName, containerName, blobName, snapshot, customerProvidedKey, - encryptionScope, versionId); + super(pageBlobAsyncClient); this.pageBlobAsyncClient = pageBlobAsyncClient; } @@ -147,14 +85,7 @@ public final class PageBlobClient extends BlobClientBase { */ @Override public PageBlobClient getEncryptionScopeClient(String encryptionScope) { - EncryptionScope finalEncryptionScope = null; - if (encryptionScope != null) { - finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope); - } - PageBlobAsyncClient asyncClient = pageBlobAsyncClient.getEncryptionScopeAsyncClient(encryptionScope); - return new PageBlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), - getContainerName(), getBlobName(), getSnapshotId(), getCustomerProvidedKey(), finalEncryptionScope, - getVersionId()); + return new PageBlobClient(pageBlobAsyncClient.getEncryptionScopeAsyncClient(encryptionScope)); } /** @@ -166,17 +97,7 @@ public PageBlobClient getEncryptionScopeClient(String encryptionScope) { */ @Override public PageBlobClient getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) { - CpkInfo finalCustomerProvidedKey = null; - if (customerProvidedKey != null) { - finalCustomerProvidedKey = new CpkInfo() - .setEncryptionKey(customerProvidedKey.getKey()) - .setEncryptionKeySha256(customerProvidedKey.getKeySha256()) - .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm()); - } - PageBlobAsyncClient asyncClient = pageBlobAsyncClient.getCustomerProvidedKeyAsyncClient(customerProvidedKey); - return new PageBlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(), - getContainerName(), getBlobName(), getSnapshotId(), finalCustomerProvidedKey, encryptionScope, - getVersionId()); + return new PageBlobClient(pageBlobAsyncClient.getCustomerProvidedKeyAsyncClient(customerProvidedKey)); } /** @@ -341,45 +262,8 @@ public Response createWithResponse(long size, Long sequenceNumber, */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(PageBlobCreateOptions options, Duration timeout, Context context) { -// Mono> response = pageBlobAsyncClient.createWithResponse(options, context); -// return StorageImplUtils.blockWithOptionalTimeout(response, timeout); - StorageImplUtils.assertNotNull("options", options); - Context finalContext = context == null ? Context.NONE : context; - BlobRequestConditions requestConditions = options.getRequestConditions() == null ? new BlobRequestConditions() - : options.getRequestConditions(); - - if (options.getSize() % PAGE_BYTES != 0) { - // Throwing is preferred to Single.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("size must be a multiple of PageBlobAsyncClient.PAGE_BYTES.")); - } - if (options.getSequenceNumber() != null && options.getSequenceNumber() < 0) { - // Throwing is preferred to Single.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("SequenceNumber must be greater than or equal to 0.")); - } - BlobImmutabilityPolicy immutabilityPolicy = options.getImmutabilityPolicy() == null - ? new BlobImmutabilityPolicy() : options.getImmutabilityPolicy(); - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getPageBlobs().createWithResponse(containerName, blobName, 0, options.getSize(), null, - null, options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), options.getSequenceNumber(), - null, ModelHelper.tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), - immutabilityPolicy.getPolicyMode(), options.isLegalHold(), options.getHeaders(), - getCustomerProvidedKey(), encryptionScope, finalContext)); - - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - PageBlobsCreateHeaders hd = response.getDeserializedHeaders(); - PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), - hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), hd.getXMsEncryptionScope(), - null, hd.getXMsVersionId()); - return new SimpleResponse<>(response, item); + Mono> response = pageBlobAsyncClient.createWithResponse(options, context); + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -440,22 +324,8 @@ public PageBlobItem createIfNotExists(long size) { @ServiceMethod(returns = ReturnType.SINGLE) public Response createIfNotExistsWithResponse(PageBlobCreateOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - options.setRequestConditions(new BlobRequestConditions().setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD) - .setIfNoneMatch(Constants.HeaderConstants.ETAG_WILDCARD)); - try { - return createWithResponse(options, timeout, context); - } catch (BlobStorageException e) { - if (e.getStatusCode() == 409 && (e.getErrorCode().equals(BlobErrorCode.BLOB_ALREADY_EXISTS) - || e.getErrorCode().equals(BlobErrorCode.RESOURCE_ALREADY_EXISTS))) { - HttpResponse res = e.getResponse(); - return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), null); - } else { - throw LOGGER.logExceptionAsError(e); - } - } catch (RuntimeException e) { - throw LOGGER.logExceptionAsError(e); - } + return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient. + createIfNotExistsWithResponse(options, context), timeout); } /** @@ -745,32 +615,10 @@ public PageBlobItem clearPages(PageRange pageRange) { @ServiceMethod(returns = ReturnType.SINGLE) public Response clearPagesWithResponse(PageRange pageRange, PageBlobRequestConditions pageBlobRequestConditions, Duration timeout, Context context) { - PageBlobRequestConditions finalPageBlobRequestConditions = pageBlobRequestConditions == null - ? new PageBlobRequestConditions() : pageBlobRequestConditions; - if (pageRange == null) { - // Throwing is preferred to Single.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError(new IllegalArgumentException("pageRange cannot be null.")); - } - String pageRangeStr = ModelHelper.pageRangeToString(pageRange); - Context finalContext = context == null ? Context.NONE : context; - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> this.azureBlobStorage.getPageBlobs().clearPagesWithResponse(containerName, blobName, 0, null, - pageRangeStr, finalPageBlobRequestConditions.getLeaseId(), - finalPageBlobRequestConditions.getIfSequenceNumberLessThanOrEqualTo(), - finalPageBlobRequestConditions.getIfSequenceNumberLessThan(), - finalPageBlobRequestConditions.getIfSequenceNumberEqualTo(), - finalPageBlobRequestConditions.getIfModifiedSince(), - finalPageBlobRequestConditions.getIfUnmodifiedSince(), finalPageBlobRequestConditions.getIfMatch(), - finalPageBlobRequestConditions.getIfNoneMatch(), finalPageBlobRequestConditions.getTagsConditions(), - null, getCustomerProvidedKey(), encryptionScope, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - PageBlobsClearPagesHeaders hd = response.getDeserializedHeaders(); - PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), - hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), null, - hd.getXMsBlobSequenceNumber()); - return new SimpleResponse<>(response, item); + Mono> response = pageBlobAsyncClient.clearPagesWithResponse(pageRange, + pageBlobRequestConditions, context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -834,21 +682,8 @@ public PageList getPageRanges(BlobRange blobRange) { @Deprecated public Response getPageRangesWithResponse(BlobRange blobRange, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRange finalBlobRange = blobRange == null ? new BlobRange(0) : blobRange; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().getPageRangesWithResponse(containerName, blobName, getSnapshotId(), - null, finalBlobRange.toHeaderValue(), finalRequestConditions.getLeaseId(), - finalRequestConditions.getIfModifiedSince(), finalRequestConditions.getIfUnmodifiedSince(), - finalRequestConditions.getIfMatch(), finalRequestConditions.getIfNoneMatch(), - finalRequestConditions.getTagsConditions(), null, null, null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue()); + return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient + .getPageRangesWithResponse(blobRange, requestConditions, context), timeout); } /** @@ -912,55 +747,13 @@ public PagedIterable listPageRanges(BlobRange blobRange) { @ServiceMethod(returns = ReturnType.SINGLE) public PagedIterable listPageRanges(ListPageRangesOptions options, Duration timeout, Context context) { - Objects.requireNonNull(options, "options must not be null"); - Context finalContext = context == null ? Context.NONE : context; - - // Helper function to retrieve a page of items - BiFunction> pageRetriever = (continuationToken, pageSize) -> { - BlobRequestConditions requestConditions = options.getRequestConditions() == null - ? new BlobRequestConditions() : options.getRequestConditions(); - Integer finalPageSize = pageSize == null ? options.getMaxResultsPerPage() : pageSize; - - // Call the synchronous service method - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().getPageRangesWithResponse(containerName, blobName, getSnapshotId(), - null, options.getRange().toHeaderValue(), requestConditions.getLeaseId(), - requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, continuationToken, finalPageSize, finalContext)); - - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - List value = parsePageRangeItems(response.getValue()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - PageListHelper.getNextMarker(response.getValue()), - response.getDeserializedHeaders()); - }; - return new PagedIterable<>(pageSize -> pageRetriever.apply(null, pageSize), pageRetriever); - } - - private List parsePageRangeItems(PageList pageList) { - if (pageList == null) { - return Collections.emptyList(); - } - return Stream.concat( - pageList.getPageRange().stream().map(this::toPageBlobRange), - pageList.getClearRange().stream().map(this::toPageBlobRange) - ).collect(Collectors.toList()); - } - - private PageRangeItem toPageBlobRange(PageRange range) { - return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart() + 1), false); - } - - private PageRangeItem toPageBlobRange(ClearRange range) { - return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart() + 1), true); + return new PagedIterable<>( + // pull timeout out of options + new PagedFlux<>( + pageSize -> pageBlobAsyncClient.listPageRangesWithOptionalTimeout( + options, timeout, context).apply(null, pageSize), + (continuationToken, pageSize) -> pageBlobAsyncClient.listPageRangesWithOptionalTimeout( + options, timeout, context).apply(continuationToken, pageSize))); } /** @@ -1035,26 +828,9 @@ public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { @Deprecated public Response getPageRangesDiffWithResponse(BlobRange blobRange, String prevSnapshot, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRange finalBlobRange = blobRange == null ? new BlobRange(0) : blobRange; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - - if (prevSnapshot == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("prevSnapshot cannot be null")); - } - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponse(containerName, blobName, - getSnapshotId(), null, prevSnapshot, null, finalBlobRange.toHeaderValue(), - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, null, - null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue()); + return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient + .getPageRangesDiffWithResponse(blobRange, prevSnapshot, null, requestConditions, context), + timeout); } /** @@ -1125,38 +901,13 @@ public PagedIterable listPageRangesDiff(BlobRange blobRange, Stri @ServiceMethod(returns = ReturnType.SINGLE) public PagedIterable listPageRangesDiff(ListPageRangesDiffOptions options, Duration timeout, Context context) { - Objects.requireNonNull(options, "options must not be null"); - Context finalContext = context == null ? Context.NONE : context; - - BiFunction> pageRetriever = (continuationToken, pageSize) -> { - BlobRequestConditions requestConditions = options.getRequestConditions() == null - ? new BlobRequestConditions() : options.getRequestConditions(); - - // Dynamically use pageSize provided during the iteration if available - Integer finalPageSize = pageSize != null ? pageSize : options.getMaxResultsPerPage(); - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponse(containerName, blobName, - getSnapshotId(), null, options.getPreviousSnapshot(), null, options.getRange().toHeaderValue(), - requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), - requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, continuationToken, - finalPageSize, finalContext)); - - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - List value = parsePageRangeItems(response.getValue()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - PageListHelper.getNextMarker(response.getValue()), - response.getDeserializedHeaders()); - }; - return new PagedIterable<>(pageSize -> pageRetriever.apply(null, pageSize), pageRetriever); + return new PagedIterable<>( + // pull timeout out of options + new PagedFlux<>( + pageSize -> pageBlobAsyncClient.listPageRangesDiffWithOptionalTimeout( + options, timeout, context).apply(null, pageSize), + (continuationToken, pageSize) -> pageBlobAsyncClient.listPageRangesDiffWithOptionalTimeout( + options, timeout, context).apply(continuationToken, pageSize))); } /** @@ -1231,31 +982,9 @@ public PageList getManagedDiskPageRangesDiff(BlobRange blobRange, String prevSna @ServiceMethod(returns = ReturnType.SINGLE) public Response getManagedDiskPageRangesDiffWithResponse(BlobRange blobRange, String prevSnapshotUrl, BlobRequestConditions requestConditions, Duration timeout, Context context) { - BlobRange finalBlobRange = blobRange == null ? new BlobRange(0) : blobRange; - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - - if (prevSnapshotUrl == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("prevSnapshot cannot be null")); - } - try { - new URL(prevSnapshotUrl); - } catch (MalformedURLException ex) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'prevSnapshotUrl' is not a valid url.", ex)); - } - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponse(containerName, blobName, - getSnapshotId(), null, null, prevSnapshotUrl, finalBlobRange.toHeaderValue(), - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, null, - null, finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue()); + return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient + .getPageRangesDiffWithResponse(blobRange, null, prevSnapshotUrl, requestConditions, context), + timeout); } /** @@ -1307,29 +1036,9 @@ public PageBlobItem resize(long size) { @ServiceMethod(returns = ReturnType.SINGLE) public Response resizeWithResponse(long size, BlobRequestConditions requestConditions, Duration timeout, Context context) { - if (size % PAGE_BYTES != 0) { - // Throwing is preferred to Single.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("size must be a multiple of PageBlobAsyncClient.PAGE_BYTES.")); - } - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() - : requestConditions; - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = wrapTimeoutServiceCallWithExceptionMapping( - () -> - this.azureBlobStorage.getPageBlobs().resizeWithResponse(containerName, blobName, size, null, - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), null, - getCustomerProvidedKey(), encryptionScope, finalContext)); - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - - PageBlobsResizeHeaders hd = response.getDeserializedHeaders(); - PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), null, null, null, null, - hd.getXMsBlobSequenceNumber()); - return new SimpleResponse<>(response, item); + Mono> response = pageBlobAsyncClient.resizeWithResponse(size, requestConditions, + context); + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -1386,29 +1095,9 @@ public PageBlobItem updateSequenceNumber(SequenceNumberActionType action, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateSequenceNumberWithResponse(SequenceNumberActionType action, Long sequenceNumber, BlobRequestConditions requestConditions, Duration timeout, Context context) { - if (sequenceNumber != null && sequenceNumber < 0) { - // Throwing is preferred to Single.error because this will error out immediately instead of waiting until - // subscription. - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("SequenceNumber must be greater than or equal to 0.")); - } - BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; - Long finalSequenceNumber = action == SequenceNumberActionType.INCREMENT ? null : sequenceNumber; - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().updateSequenceNumberWithResponse(containerName, blobName, action, null, - finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(), - finalRequestConditions.getIfUnmodifiedSince(), finalRequestConditions.getIfMatch(), - finalRequestConditions.getIfNoneMatch(), finalRequestConditions.getTagsConditions(), - finalSequenceNumber, null, finalContext)); - - ResponseBase response = sendRequest(operation, timeout, BlobStorageException.class); - PageBlobsUpdateSequenceNumberHeaders hd = response.getDeserializedHeaders(); - PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), null, null, null, null, - hd.getXMsBlobSequenceNumber()); - return new SimpleResponse<>(response, item); + Mono> response = pageBlobAsyncClient + .updateSequenceNumberWithResponse(action, sequenceNumber, requestConditions, context); + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** @@ -1562,29 +1251,7 @@ public Response copyIncrementalWithResponse(String source, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response copyIncrementalWithResponse(PageBlobCopyIncrementalOptions options, Duration timeout, Context context) { - StorageImplUtils.assertNotNull("options", options); - UrlBuilder builder = UrlBuilder.parse(options.getSource()); - builder.setQueryParameter(Constants.UrlConstants.SNAPSHOT_QUERY_PARAMETER, options.getSnapshot()); - PageBlobCopyIncrementalRequestConditions modifiedRequestConditions = (options.getRequestConditions() == null) - ? new PageBlobCopyIncrementalRequestConditions() : options.getRequestConditions(); - - try { - builder.toUrl(); - } catch (MalformedURLException e) { - // We are parsing a valid url and adding a query parameter. If this fails, we can't recover. - throw LOGGER.logExceptionAsError(new IllegalArgumentException(e)); - } - Context finalContext = context == null ? Context.NONE : context; - - Callable> operation = - wrapTimeoutServiceCallWithExceptionMapping(() -> - this.azureBlobStorage.getPageBlobs().copyIncrementalWithResponse(containerName, blobName, - builder.toString(), null, modifiedRequestConditions.getIfModifiedSince(), - modifiedRequestConditions.getIfUnmodifiedSince(), modifiedRequestConditions.getIfMatch(), - modifiedRequestConditions.getIfNoneMatch(), modifiedRequestConditions.getTagsConditions(), null, - finalContext)); - ResponseBase response = sendRequest(operation, timeout, - BlobStorageException.class); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsCopyStatus()); + Mono> response = pageBlobAsyncClient.copyIncrementalWithResponse(options, context); + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/module-info.java b/sdk/storage/azure-storage-blob/src/main/java/module-info.java index c5bae00754af7..4440b9bcbfb7e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/module-info.java +++ b/sdk/storage/azure-storage-blob/src/main/java/module-info.java @@ -5,7 +5,6 @@ requires transitive com.azure.storage.common; requires com.azure.storage.internal.avro; - requires com.azure.core; exports com.azure.storage.blob; exports com.azure.storage.blob.models; diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/BlobBaseApiTests.java b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/BlobBaseApiTests.java index 1c7a8473bbc29..5a512b5252cfd 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/BlobBaseApiTests.java +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/BlobBaseApiTests.java @@ -35,7 +35,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.io.UncheckedIOException; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; @@ -522,7 +521,8 @@ public void queryFatalError() { liveTestScenarioWithRetry(() -> { /* Input Stream. */ - assertThrows(UncheckedIOException.class, () -> bc.openQueryInputStreamWithResponse(options).getValue()); + InputStream qqStream = bc.openQueryInputStreamWithResponse(options).getValue(); + assertThrows(Throwable.class, () -> readFromInputStream(qqStream, Constants.KB)); /* Output Stream. */ //Exceptions.ReactiveException.class diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 3686eac7d1779..125c549a9e1ca 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -24,7 +24,6 @@ generate-client-as-impl: true generate-client-interfaces: false service-interface-as-public: true license-header: MICROSOFT_MIT_SMALL -enable-sync-stack: true context-client-method-parameter: true optional-constant-as-enum: true default-http-exception-type: com.azure.storage.blob.implementation.models.BlobStorageExceptionInternal diff --git a/sdk/storage/azure-storage-file-datalake/pom.xml b/sdk/storage/azure-storage-file-datalake/pom.xml index 3ae08a8e115a0..a9c861a6a8949 100644 --- a/sdk/storage/azure-storage-file-datalake/pom.xml +++ b/sdk/storage/azure-storage-file-datalake/pom.xml @@ -66,7 +66,7 @@ com.azure azure-core - 1.52.0-beta.1 + 1.51.0 com.azure @@ -147,7 +147,7 @@ com.azure azure-core-http-okhttp - 1.13.0-beta.1 + 1.12.2 test diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java index 718003dad4e9b..696a3a6c9d50b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java @@ -2976,8 +2976,9 @@ public void queryFatalError() { String expression = "SELECT * from BlobStorage"; liveTestScenarioWithRetry(() -> { - assertThrows(UncheckedIOException.class, () -> fc.openQueryInputStreamWithResponse( - new FileQueryOptions(expression).setInputSerialization(new FileQueryJsonSerialization())).getValue()); + InputStream qqStream = fc.openQueryInputStreamWithResponse(new FileQueryOptions(expression) + .setInputSerialization(new FileQueryJsonSerialization())).getValue(); + assertThrows(UncheckedIOException.class, () -> readFromInputStream(qqStream, Constants.KB)); assertThrows(RuntimeException.class, () -> fc.queryWithResponse(new FileQueryOptions(expression, new ByteArrayOutputStream()).setInputSerialization(new FileQueryJsonSerialization()), null, null));