From e16399717804eb390263d373448b0bee419e9c89 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Wed, 3 Jun 2020 14:43:53 -0700 Subject: [PATCH 1/4] Added updated swagger change --- .../blob/implementation/AppendBlobsImpl.java | 43 +++- .../blob/implementation/BlobsImpl.java | 211 +++++++++++++----- .../blob/implementation/BlockBlobsImpl.java | 43 +++- .../blob/implementation/PageBlobsImpl.java | 71 ++++-- .../models/BlobItemInternal.java | 54 ++--- .../models/DataLakeStorageError.java | 21 +- .../models/ModifiedAccessConditions.java | 45 ++++ .../azure/storage/blob/models/BlobItem.java | 76 +++---- .../blob/models/BlobItemProperties.java | 27 +-- .../specialized/AppendBlobAsyncClient.java | 6 +- .../blob/specialized/BlobAsyncClientBase.java | 20 +- .../specialized/BlobLeaseAsyncClient.java | 10 +- .../specialized/BlockBlobAsyncClient.java | 6 +- .../blob/specialized/PageBlobAsyncClient.java | 10 +- .../storage/blob/ContainerAPITest.groovy | 33 +++ .../ContainerAPITestlistblobsflators.json | 128 +++++++++++ .../azure-storage-blob/swagger/README.md | 2 +- 17 files changed, 556 insertions(+), 250 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ModifiedAccessConditions.java create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json 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 77cde5845e7e..3166b686d903 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 @@ -25,6 +25,7 @@ import com.azure.storage.blob.implementation.models.AppendBlobsCreateResponse; import com.azure.storage.blob.implementation.models.AppendBlobsSealResponse; import com.azure.storage.blob.implementation.models.EncryptionScope; +import com.azure.storage.blob.implementation.models.ModifiedAccessConditions; import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.CpkInfo; @@ -71,17 +72,17 @@ private interface AppendBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-blob-type") String blobType, @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-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, Context context); + Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-blob-type") String blobType, @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-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-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono appendBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @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("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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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, Context context); + Mono appendBlock(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @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("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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono appendBlockFromUrl(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @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-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-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, @QueryParam("comp") String comp, @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, Context context); + Mono appendBlockFromUrl(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @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-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-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, @QueryParam("comp") String comp, @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-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @@ -118,10 +119,11 @@ public Mono createWithRestResponseAsync(String contai final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String contentMd5Converted = null; - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -142,12 +144,13 @@ public Mono createWithRestResponseAsync(String contai * @param blobHttpHeaders Additional parameters for the operation. * @param cpkInfo Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "AppendBlob"; String contentType = null; if (blobHttpHeaders != null) { @@ -189,10 +192,14 @@ public Mono createWithRestResponseAsync(String contai if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -220,11 +227,12 @@ public Mono appendBlockWithRestResponseAsync(Str final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String transactionalContentMD5Converted = null; String transactionalContentCrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -247,12 +255,13 @@ public Mono appendBlockWithRestResponseAsync(Str * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono appendBlockWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono appendBlockWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "appendblock"; String encryptionKey = null; if (cpkInfo != null) { @@ -270,11 +279,15 @@ public Mono appendBlockWithRestResponseAsync(Str if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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 service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.appendBlock(containerName, blob, this.client.getUrl(), body, timeout, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -305,6 +318,7 @@ public Mono appendBlockFromUrlWithRestRes final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String sourceContentMD5Converted = null; String sourceContentcrc64Converted = null; String transactionalContentMD5Converted = null; @@ -312,7 +326,7 @@ public Mono appendBlockFromUrlWithRestRes DateTimeRfc1123 ifUnmodifiedSinceConverted = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; - return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -341,12 +355,13 @@ public Mono appendBlockFromUrlWithRestRes * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL 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, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono appendBlockFromUrlWithRestResponseAsync(String containerName, String blob, URL 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, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "appendblock"; String encryptionKey = null; if (cpkInfo != null) { @@ -364,6 +379,10 @@ public Mono appendBlockFromUrlWithRestRes if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5); String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64); String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); @@ -371,7 +390,7 @@ public Mono appendBlockFromUrlWithRestRes 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 service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.appendBlockFromUrl(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength, transactionalContentMD5Converted, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** 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 8abff9b4caee..a1112d32db0a 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 @@ -54,6 +54,7 @@ import com.azure.storage.blob.implementation.models.DataLakeStorageErrorException; import com.azure.storage.blob.implementation.models.DirectoryHttpHeaders; import com.azure.storage.blob.implementation.models.EncryptionScope; +import com.azure.storage.blob.implementation.models.ModifiedAccessConditions; import com.azure.storage.blob.implementation.models.QueryRequest; import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.AccessTier; @@ -103,17 +104,17 @@ private interface BlobsService { @Get("{containerName}/{blob}") @ExpectedResponses({200, 206}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono download(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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("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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-encryption-key") String encryptionKey, @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, Context context); + Mono download(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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("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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @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-if-tags") String ifTags, Context context); @Head("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getProperties(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-encryption-key") String encryptionKey, @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256, @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm, Context context); + Mono getProperties(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @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-if-tags") String ifTags, Context context); @Delete("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono delete(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, Context context); + Mono delete(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Patch("{filesystem}/{path}") @ExpectedResponses({200}) @@ -143,52 +144,52 @@ private interface BlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono setHTTPHeaders(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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-blob-content-disposition") String contentDisposition, Context context); + Mono setHTTPHeaders(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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-blob-content-disposition") String contentDisposition, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono setMetadata(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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, Context context); + Mono setMetadata(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono acquireLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, Context context); + Mono acquireLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono releaseLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, Context context); + Mono releaseLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono renewLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, Context context); + Mono renewLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono changeLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, Context context); + Mono changeLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono breakLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, Context context); + Mono breakLease(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono createSnapshot(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @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-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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, Context context); + Mono createSnapshot(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @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-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @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-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono startCopyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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("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-copy-source") URL 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, Context context); + Mono startCopyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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("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-copy-source") URL 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-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({202}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-copy-source") URL 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-seal-blob") Boolean sealBlob, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, Context context); + Mono copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-copy-source") URL 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-seal-blob") Boolean sealBlob, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({204}) @@ -213,12 +214,12 @@ private interface BlobsService { @Get("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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, @QueryParam("comp") String comp, Context context); + Mono getTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({204}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono setTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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, @BodyParam("application/xml; charset=utf-8") BlobTags tags, @QueryParam("comp") String comp, Context context); + Mono setTags(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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, @BodyParam("application/xml; charset=utf-8") BlobTags tags, @QueryParam("comp") String comp, @HeaderParam("x-ms-if-tags") String ifTags, Context context); } /** @@ -245,9 +246,10 @@ public Mono downloadWithRestResponseAsync(String containe final String encryptionKey = null; final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, context); + return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifTags, context); } /** @@ -268,12 +270,13 @@ public Mono downloadWithRestResponseAsync(String containe * @param ifNoneMatch 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 cpkInfo Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadWithRestResponseAsync(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 requestId, CpkInfo cpkInfo, Context context) { + public Mono downloadWithRestResponseAsync(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 requestId, CpkInfo cpkInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { String encryptionKey = null; if (cpkInfo != null) { encryptionKey = cpkInfo.getEncryptionKey(); @@ -286,9 +289,13 @@ public Mono downloadWithRestResponseAsync(String containe if (cpkInfo != null) { encryptionAlgorithm = cpkInfo.getEncryptionAlgorithm(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, context); + return service.download(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifTags, context); } /** @@ -312,9 +319,10 @@ public Mono getPropertiesWithRestResponseAsync(Strin final String encryptionKey = null; final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, context); + return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifTags, context); } /** @@ -332,12 +340,13 @@ public Mono getPropertiesWithRestResponseAsync(Strin * @param ifNoneMatch 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 cpkInfo Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, Context context) { + public Mono getPropertiesWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, ModifiedAccessConditions modifiedAccessConditions, Context context) { String encryptionKey = null; if (cpkInfo != null) { encryptionKey = cpkInfo.getEncryptionKey(); @@ -350,9 +359,13 @@ public Mono getPropertiesWithRestResponseAsync(Strin if (cpkInfo != null) { encryptionAlgorithm = cpkInfo.getEncryptionAlgorithm(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, context); + return service.getProperties(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifTags, context); } /** @@ -374,9 +387,10 @@ public Mono deleteWithRestResponseAsync(String containerNam final String ifMatch = null; final String ifNoneMatch = null; final String requestId = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, context); + return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, ifTags, context); } /** @@ -394,15 +408,20 @@ public Mono deleteWithRestResponseAsync(String containerNam * @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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono deleteWithRestResponseAsync(String containerName, String blob, String snapshot, String versionId, Integer timeout, String leaseId, DeleteSnapshotsOptionType deleteSnapshots, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, context); + return service.delete(containerName, blob, this.client.getUrl(), snapshot, versionId, timeout, leaseId, deleteSnapshots, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, ifTags, context); } /** @@ -679,10 +698,11 @@ public Mono setHTTPHeadersWithRestResponseAsync(Str final String contentEncoding = null; final String contentLanguage = null; final String contentDisposition = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String contentMd5Converted = null; - return service.setHTTPHeaders(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, contentDisposition, context); + return service.setHTTPHeaders(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, contentDisposition, ifTags, context); } /** @@ -698,12 +718,13 @@ public Mono setHTTPHeadersWithRestResponseAsync(Str * @param ifNoneMatch 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 blobHttpHeaders Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setHTTPHeadersWithRestResponseAsync(String containerName, String blob, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, BlobHttpHeaders blobHttpHeaders, Context context) { + public Mono setHTTPHeadersWithRestResponseAsync(String containerName, String blob, Integer timeout, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, BlobHttpHeaders blobHttpHeaders, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "properties"; String cacheControl = null; if (blobHttpHeaders != null) { @@ -729,10 +750,14 @@ public Mono setHTTPHeadersWithRestResponseAsync(Str if (blobHttpHeaders != null) { contentDisposition = blobHttpHeaders.getContentDisposition(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHTTPHeaders(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, contentDisposition, context); + return service.setHTTPHeaders(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, cacheControl, contentType, contentMd5Converted, contentEncoding, contentLanguage, contentDisposition, ifTags, context); } /** @@ -757,9 +782,10 @@ public Mono setMetadataWithRestResponseAsync(String co final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -777,12 +803,13 @@ public Mono setMetadataWithRestResponseAsync(String co * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono setMetadataWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "metadata"; String encryptionKey = null; if (cpkInfo != null) { @@ -800,9 +827,13 @@ public Mono setMetadataWithRestResponseAsync(String co if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.setMetadata(containerName, blob, this.client.getUrl(), timeout, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -824,9 +855,10 @@ public Mono acquireLeaseWithRestResponseAsync(String final String requestId = null; final String comp = "lease"; final String action = "acquire"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.acquireLease(containerName, blob, this.client.getUrl(), timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.acquireLease(containerName, blob, this.client.getUrl(), timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -842,17 +874,22 @@ public Mono acquireLeaseWithRestResponseAsync(String * @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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseWithRestResponseAsync(String containerName, String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono acquireLeaseWithRestResponseAsync(String containerName, String blob, Integer timeout, Integer duration, String proposedLeaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "lease"; final String action = "acquire"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.acquireLease(containerName, blob, this.client.getUrl(), timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.acquireLease(containerName, blob, this.client.getUrl(), timeout, duration, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -873,9 +910,10 @@ public Mono releaseLeaseWithRestResponseAsync(String final String requestId = null; final String comp = "lease"; final String action = "release"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.releaseLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.releaseLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -890,17 +928,22 @@ public Mono releaseLeaseWithRestResponseAsync(String * @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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono releaseLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "lease"; final String action = "release"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.releaseLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.releaseLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -921,9 +964,10 @@ public Mono renewLeaseWithRestResponseAsync(String cont final String requestId = null; final String comp = "lease"; final String action = "renew"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.renewLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.renewLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -938,17 +982,22 @@ public Mono renewLeaseWithRestResponseAsync(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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono renewLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "lease"; final String action = "renew"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.renewLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.renewLease(containerName, blob, this.client.getUrl(), timeout, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -970,9 +1019,10 @@ public Mono changeLeaseWithRestResponseAsync(String co final String requestId = null; final String comp = "lease"; final String action = "change"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.changeLease(containerName, blob, this.client.getUrl(), timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.changeLease(containerName, blob, this.client.getUrl(), timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -988,17 +1038,22 @@ public Mono changeLeaseWithRestResponseAsync(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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono changeLeaseWithRestResponseAsync(String containerName, String blob, String leaseId, String proposedLeaseId, Integer timeout, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "lease"; final String action = "change"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.changeLease(containerName, blob, this.client.getUrl(), timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.changeLease(containerName, blob, this.client.getUrl(), timeout, leaseId, proposedLeaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -1019,9 +1074,10 @@ public Mono breakLeaseWithRestResponseAsync(String cont final String requestId = null; final String comp = "lease"; final String action = "break"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.breakLease(containerName, blob, this.client.getUrl(), timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.breakLease(containerName, blob, this.client.getUrl(), timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -1036,17 +1092,22 @@ public Mono breakLeaseWithRestResponseAsync(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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseWithRestResponseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono breakLeaseWithRestResponseAsync(String containerName, String blob, Integer timeout, Integer breakPeriod, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "lease"; final String action = "break"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.breakLease(containerName, blob, this.client.getUrl(), timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, context); + return service.breakLease(containerName, blob, this.client.getUrl(), timeout, breakPeriod, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, action, ifTags, context); } /** @@ -1071,9 +1132,10 @@ public Mono createSnapshotWithRestResponseAsync(Str final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -1091,12 +1153,13 @@ public Mono createSnapshotWithRestResponseAsync(Str * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono createSnapshotWithRestResponseAsync(String containerName, String blob, Integer timeout, Map metadata, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String leaseId, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "snapshot"; String encryptionKey = null; if (cpkInfo != null) { @@ -1114,9 +1177,13 @@ public Mono createSnapshotWithRestResponseAsync(Str if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.createSnapshot(containerName, blob, this.client.getUrl(), timeout, metadata, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, leaseId, this.client.getVersion(), requestId, comp, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -1143,11 +1210,12 @@ public Mono startCopyFromURLWithRestResponseAsync final String requestId = null; final String blobTagsString = null; final Boolean sealBlob = null; + final String ifTags = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, context); + return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, ifTags, context); } /** @@ -1172,17 +1240,22 @@ public Mono startCopyFromURLWithRestResponseAsync * @param requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyFromURLWithRestResponseAsync(String containerName, String blob, URL 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 leaseId, String requestId, String blobTagsString, Boolean sealBlob, Context context) { + public Mono startCopyFromURLWithRestResponseAsync(String containerName, String blob, URL 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 leaseId, String requestId, String blobTagsString, Boolean sealBlob, ModifiedAccessConditions modifiedAccessConditions, Context context) { + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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); - return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, context); + return service.startCopyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, rehydratePriority, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, blobTagsString, sealBlob, ifTags, context); } /** @@ -1209,12 +1282,13 @@ public Mono copyFromURLWithRestResponseAsync(String co final String blobTagsString = null; final Boolean sealBlob = null; final String xMsRequiresSync = "true"; + final String ifTags = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String sourceContentMD5Converted = null; - return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, context); + return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, ifTags, context); } /** @@ -1239,19 +1313,24 @@ public Mono copyFromURLWithRestResponseAsync(String co * @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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, Boolean sealBlob, Context context) { + public Mono copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, Boolean sealBlob, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String xMsRequiresSync = "true"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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); - return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, context); + return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, ifTags, context); } /** @@ -1436,7 +1515,8 @@ public Mono getTagsWithRestResponseAsync(String containerN final String snapshot = null; final String versionId = null; final String comp = "tags"; - return service.getTags(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, snapshot, versionId, comp, context); + final String ifTags = null; + return service.getTags(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, snapshot, versionId, comp, ifTags, context); } /** @@ -1448,14 +1528,19 @@ public Mono getTagsWithRestResponseAsync(String containerN * @param requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTagsWithRestResponseAsync(String containerName, String blob, Integer timeout, String requestId, String snapshot, String versionId, Context context) { + public Mono getTagsWithRestResponseAsync(String containerName, String blob, Integer timeout, String requestId, String snapshot, String versionId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "tags"; - return service.getTags(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, snapshot, versionId, comp, context); + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } + return service.getTags(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, snapshot, versionId, comp, ifTags, context); } /** @@ -1474,9 +1559,10 @@ public Mono setTagsWithRestResponseAsync(String containerN final String requestId = null; final BlobTags tags = null; final String comp = "tags"; + final String ifTags = null; String transactionalContentMD5Converted = null; String transactionalContentCrc64Converted = null; - return service.setTags(containerName, blob, this.client.getUrl(), this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, tags, comp, context); + return service.setTags(containerName, blob, this.client.getUrl(), this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, tags, comp, ifTags, context); } /** @@ -1490,15 +1576,20 @@ public Mono setTagsWithRestResponseAsync(String containerN * @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 tags Blob tags. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setTagsWithRestResponseAsync(String containerName, String blob, Integer timeout, String versionId, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, BlobTags tags, Context context) { + public Mono setTagsWithRestResponseAsync(String containerName, String blob, Integer timeout, String versionId, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String requestId, BlobTags tags, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "tags"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64); - return service.setTags(containerName, blob, this.client.getUrl(), this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, tags, comp, context); + return service.setTags(containerName, blob, this.client.getUrl(), this.client.getVersion(), timeout, versionId, transactionalContentMD5Converted, transactionalContentCrc64Converted, requestId, tags, comp, ifTags, context); } } 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 32423559a8f4..e3a038b8e077 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 @@ -27,6 +27,7 @@ import com.azure.storage.blob.implementation.models.BlockBlobsStageBlockResponse; import com.azure.storage.blob.implementation.models.BlockBlobsUploadResponse; import com.azure.storage.blob.implementation.models.EncryptionScope; +import com.azure.storage.blob.implementation.models.ModifiedAccessConditions; import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.AccessTier; import com.azure.storage.blob.models.BlobHttpHeaders; @@ -76,7 +77,7 @@ private interface BlockBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono upload(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-blob-type") String blobType, @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-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, Context context); + Mono upload(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-MD5") String transactionalContentMD5, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-blob-type") String blobType, @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-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-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @@ -91,12 +92,12 @@ private interface BlockBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono commitBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @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-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, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @QueryParam("comp") String comp, @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("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, Context context); + Mono commitBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @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-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, @BodyParam("application/xml; charset=utf-8") BlockLookupList blocks, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString, @QueryParam("comp") String comp, @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("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-if-tags") String ifTags, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("blocklisttype") BlockListType listType, @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, @QueryParam("comp") String comp, Context context); + Mono getBlockList(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("blocklisttype") BlockListType listType, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-if-tags") String ifTags, Context context); } /** @@ -130,11 +131,12 @@ public Mono uploadWithRestResponseAsync(String contain final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String transactionalContentMD5Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String contentMd5Converted = null; - return service.upload(containerName, blob, this.client.getUrl(), body, timeout, transactionalContentMD5Converted, contentLength, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.upload(containerName, blob, this.client.getUrl(), body, timeout, transactionalContentMD5Converted, contentLength, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -158,12 +160,13 @@ public Mono uploadWithRestResponseAsync(String contain * @param blobHttpHeaders Additional parameters for the operation. * @param cpkInfo Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono uploadWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, Integer timeout, byte[] transactionalContentMD5, Map metadata, String leaseId, AccessTier tier, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "BlockBlob"; String contentType = null; if (blobHttpHeaders != null) { @@ -205,11 +208,15 @@ public Mono uploadWithRestResponseAsync(String contain if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.upload(containerName, blob, this.client.getUrl(), body, timeout, transactionalContentMD5Converted, contentLength, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.upload(containerName, blob, this.client.getUrl(), body, timeout, transactionalContentMD5Converted, contentLength, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -394,12 +401,13 @@ public Mono commitBlockListWithRestResponseAs final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String transactionalContentMD5Converted = null; String transactionalContentCrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String contentMd5Converted = null; - return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blocks, this.client.getVersion(), requestId, blobTagsString, comp, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blocks, this.client.getVersion(), requestId, blobTagsString, comp, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -423,12 +431,13 @@ public Mono commitBlockListWithRestResponseAs * @param blobHttpHeaders Additional parameters for the operation. * @param cpkInfo Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono commitBlockListWithRestResponseAsync(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 requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono commitBlockListWithRestResponseAsync(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 requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "blocklist"; String cacheControl = null; if (blobHttpHeaders != null) { @@ -470,12 +479,16 @@ public Mono commitBlockListWithRestResponseAs if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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); String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blocks, this.client.getVersion(), requestId, blobTagsString, comp, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.commitBlockList(containerName, blob, this.client.getUrl(), timeout, transactionalContentMD5Converted, transactionalContentCrc64Converted, metadata, leaseId, tier, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blocks, this.client.getVersion(), requestId, blobTagsString, comp, cacheControl, contentType, contentEncoding, contentLanguage, contentMd5Converted, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -495,7 +508,8 @@ public Mono getBlockListWithRestResponseAsync(St final String leaseId = null; final String requestId = null; final String comp = "blocklist"; - return service.getBlockList(containerName, blob, this.client.getUrl(), snapshot, listType, timeout, leaseId, this.client.getVersion(), requestId, comp, context); + final String ifTags = null; + return service.getBlockList(containerName, blob, this.client.getUrl(), snapshot, listType, timeout, leaseId, this.client.getVersion(), requestId, comp, ifTags, context); } /** @@ -508,13 +522,18 @@ public Mono getBlockListWithRestResponseAsync(St * @param timeout The timeout parameter is expressed in seconds. For more information, see <a href="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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBlockListWithRestResponseAsync(String containerName, String blob, BlockListType listType, String snapshot, Integer timeout, String leaseId, String requestId, Context context) { + public Mono getBlockListWithRestResponseAsync(String containerName, String blob, BlockListType listType, String snapshot, Integer timeout, String leaseId, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "blocklist"; - return service.getBlockList(containerName, blob, this.client.getUrl(), snapshot, listType, timeout, leaseId, this.client.getVersion(), requestId, comp, context); + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } + return service.getBlockList(containerName, blob, this.client.getUrl(), snapshot, listType, timeout, leaseId, this.client.getVersion(), requestId, comp, ifTags, context); } } 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 e314fe4b6645..84daf0bad5f2 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 @@ -22,6 +22,7 @@ import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; import com.azure.storage.blob.implementation.models.EncryptionScope; +import com.azure.storage.blob.implementation.models.ModifiedAccessConditions; import com.azure.storage.blob.implementation.models.PageBlobsClearPagesResponse; import com.azure.storage.blob.implementation.models.PageBlobsCopyIncrementalResponse; import com.azure.storage.blob.implementation.models.PageBlobsCreateResponse; @@ -79,12 +80,12 @@ private interface PageBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-access-tier") PremiumPageBlobAccessTier tier, @HeaderParam("x-ms-meta-") Map metadata, @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-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-blob-type") String blobType, @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-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, Context context); + Mono create(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-access-tier") PremiumPageBlobAccessTier tier, @HeaderParam("x-ms-meta-") Map metadata, @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-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-blob-type") String blobType, @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-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-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono uploadPages(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @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-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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @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, Context context); + Mono uploadPages(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @BodyParam("application/octet-stream") Flux body, @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-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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @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-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({201}) @@ -94,17 +95,17 @@ private interface PageBlobsService { @Put("{containerName}/{blob}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono uploadPagesFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @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-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-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, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @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, Context context); + Mono uploadPagesFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @HeaderParam("x-ms-copy-source") URL copySource, @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-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-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, @QueryParam("comp") String comp, @HeaderParam("x-ms-page-write") String pageWrite, @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-tags") String ifTags, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getPageRanges(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); + Mono getPageRanges(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Get("{containerName}/{blob}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getPageRangesDiff(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, @HeaderParam("x-ms-previous-snapshot-url") URL 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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, Context context); + Mono getPageRangesDiff(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("snapshot") String snapshot, @QueryParam("timeout") Integer timeout, @QueryParam("prevsnapshot") String prevsnapshot, @HeaderParam("x-ms-previous-snapshot-url") URL 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-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("comp") String comp, @HeaderParam("x-ms-if-tags") String ifTags, Context context); @Put("{containerName}/{blob}") @ExpectedResponses({200}) @@ -154,10 +155,11 @@ public Mono createWithRestResponseAsync(String containe final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; String contentMd5Converted = null; - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, tier, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, tier, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -181,12 +183,13 @@ public Mono createWithRestResponseAsync(String containe * @param blobHttpHeaders Additional parameters for the operation. * @param cpkInfo Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, long blobContentLength, Integer timeout, PremiumPageBlobAccessTier tier, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long blobSequenceNumber, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono createWithRestResponseAsync(String containerName, String blob, long contentLength, long blobContentLength, Integer timeout, PremiumPageBlobAccessTier tier, Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long blobSequenceNumber, String requestId, String blobTagsString, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String blobType = "PageBlob"; String contentType = null; if (blobHttpHeaders != null) { @@ -228,10 +231,14 @@ public Mono createWithRestResponseAsync(String containe if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, tier, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.create(containerName, blob, this.client.getUrl(), timeout, contentLength, tier, metadata, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, blobContentLength, blobSequenceNumber, this.client.getVersion(), requestId, blobTagsString, blobType, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -262,11 +269,12 @@ public Mono uploadPagesWithRestResponseAsync(Strin final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String transactionalContentMD5Converted = null; String transactionalContentCrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -291,12 +299,13 @@ public Mono uploadPagesWithRestResponseAsync(Strin * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadPagesWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, 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 requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono uploadPagesWithRestResponseAsync(String containerName, String blob, Flux body, long contentLength, 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 requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "page"; final String pageWrite = "update"; String encryptionKey = null; @@ -315,11 +324,15 @@ public Mono uploadPagesWithRestResponseAsync(Strin if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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 service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.uploadPages(containerName, blob, this.client.getUrl(), body, contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -433,13 +446,14 @@ public Mono uploadPagesFromURLWithRestRespo final String encryptionKeySha256 = null; final EncryptionAlgorithmType encryptionAlgorithm = null; final String encryptionScope = null; + final String ifTags = null; String sourceContentMD5Converted = null; String sourceContentcrc64Converted = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; DateTimeRfc1123 sourceIfModifiedSinceConverted = null; DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null; - return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, context); + return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifTags, context); } /** @@ -469,12 +483,13 @@ public Mono uploadPagesFromURLWithRestRespo * @param requestId Provides 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 Additional parameters for the operation. * @param encryptionScope Additional parameters for the operation. + * @param modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadPagesFromURLWithRestResponseAsync(String containerName, String blob, URL 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, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { + public Mono uploadPagesFromURLWithRestResponseAsync(String containerName, String blob, URL 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, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScope, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "page"; final String pageWrite = "update"; String encryptionKey = null; @@ -493,13 +508,17 @@ public Mono uploadPagesFromURLWithRestRespo if (encryptionScope != null) { encryptionScope1 = encryptionScope.getEncryptionScope(); } + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } 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 service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, context); + return service.uploadPagesFromURL(containerName, blob, this.client.getUrl(), sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, contentLength, timeout, range, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, comp, pageWrite, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope1, ifTags, context); } /** @@ -521,9 +540,10 @@ public Mono getPageRangesWithRestResponseAsync(S final String ifNoneMatch = null; final String requestId = null; final String comp = "pagelist"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.getPageRanges(containerName, blob, this.client.getUrl(), snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, context); + return service.getPageRanges(containerName, blob, this.client.getUrl(), snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, ifTags, context); } /** @@ -540,16 +560,21 @@ public Mono getPageRangesWithRestResponseAsync(S * @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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesWithRestResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono getPageRangesWithRestResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "pagelist"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRanges(containerName, blob, this.client.getUrl(), snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, context); + return service.getPageRanges(containerName, blob, this.client.getUrl(), snapshot, timeout, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, ifTags, context); } /** @@ -573,9 +598,10 @@ public Mono getPageRangesDiffWithRestRespons final String ifNoneMatch = null; final String requestId = null; final String comp = "pagelist"; + final String ifTags = null; DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; - return service.getPageRangesDiff(containerName, blob, this.client.getUrl(), snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, context); + return service.getPageRangesDiff(containerName, blob, this.client.getUrl(), snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, ifTags, context); } /** @@ -594,16 +620,21 @@ public Mono getPageRangesDiffWithRestRespons * @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 requestId Provides 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 modifiedAccessConditions Additional parameters for the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @return a Mono which performs the network request upon subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesDiffWithRestResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, URL prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, Context context) { + public Mono getPageRangesDiffWithRestResponseAsync(String containerName, String blob, String snapshot, Integer timeout, String prevsnapshot, URL prevSnapshotUrl, String range, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String requestId, ModifiedAccessConditions modifiedAccessConditions, Context context) { final String comp = "pagelist"; + String ifTags = null; + if (modifiedAccessConditions != null) { + ifTags = modifiedAccessConditions.getIfTags(); + } DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesDiff(containerName, blob, this.client.getUrl(), snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, context); + return service.getPageRangesDiff(containerName, blob, this.client.getUrl(), snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, this.client.getVersion(), requestId, comp, ifTags, context); } /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobItemInternal.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobItemInternal.java index 17474c6e248a..3ae5b08e5009 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobItemInternal.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobItemInternal.java @@ -64,16 +64,10 @@ public final class BlobItemInternal { private BlobTags blobTags; /* - * The objectReplicationPolicyId property. + * The objectReplicationMetadata property. */ - @JsonProperty(value = "ObjectReplicationPolicyId") - private String objectReplicationPolicyId; - - /* - * The objectReplicationRules property. - */ - @JsonProperty(value = "BlobObjectReplicationRules") - private Map objectReplicationRules; + @JsonProperty(value = "OrMetadata") + private Map objectReplicationMetadata; /* * The isPrefix property. @@ -242,47 +236,25 @@ public BlobItemInternal setBlobTags(BlobTags blobTags) { } /** - * Get the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. + * Get the objectReplicationMetadata property: The + * objectReplicationMetadata property. * - * @return the objectReplicationPolicyId value. + * @return the objectReplicationMetadata value. */ - public String getObjectReplicationPolicyId() { - return this.objectReplicationPolicyId; + public Map getObjectReplicationMetadata() { + return this.objectReplicationMetadata; } /** - * Set the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. + * Set the objectReplicationMetadata property: The + * objectReplicationMetadata property. * - * @param objectReplicationPolicyId the objectReplicationPolicyId value to + * @param objectReplicationMetadata the objectReplicationMetadata value to * set. * @return the BlobItemInternal object itself. */ - public BlobItemInternal setObjectReplicationPolicyId(String objectReplicationPolicyId) { - this.objectReplicationPolicyId = objectReplicationPolicyId; - return this; - } - - /** - * Get the objectReplicationRules property: The objectReplicationRules - * property. - * - * @return the objectReplicationRules value. - */ - public Map getObjectReplicationRules() { - return this.objectReplicationRules; - } - - /** - * Set the objectReplicationRules property: The objectReplicationRules - * property. - * - * @param objectReplicationRules the objectReplicationRules value to set. - * @return the BlobItemInternal object itself. - */ - public BlobItemInternal setObjectReplicationRules(Map objectReplicationRules) { - this.objectReplicationRules = objectReplicationRules; + public BlobItemInternal setObjectReplicationMetadata(Map objectReplicationMetadata) { + this.objectReplicationMetadata = objectReplicationMetadata; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/DataLakeStorageError.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/DataLakeStorageError.java index dd2d6ba4ef39..d0445476d009 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/DataLakeStorageError.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/DataLakeStorageError.java @@ -18,25 +18,28 @@ public final class DataLakeStorageError { * The service error response object. */ @JsonProperty(value = "error") - private DataLakeStorageErrorError error; + private DataLakeStorageErrorError dataLakeStorageErrorDetails; /** - * Get the error property: The service error response object. + * Get the dataLakeStorageErrorDetails property: The service error response + * object. * - * @return the error value. + * @return the dataLakeStorageErrorDetails value. */ - public DataLakeStorageErrorError getError() { - return this.error; + public DataLakeStorageErrorError getDataLakeStorageErrorDetails() { + return this.dataLakeStorageErrorDetails; } /** - * Set the error property: The service error response object. + * Set the dataLakeStorageErrorDetails property: The service error response + * object. * - * @param error the error value to set. + * @param dataLakeStorageErrorDetails the dataLakeStorageErrorDetails value + * to set. * @return the DataLakeStorageError object itself. */ - public DataLakeStorageError setError(DataLakeStorageErrorError error) { - this.error = error; + public DataLakeStorageError setDataLakeStorageErrorDetails(DataLakeStorageErrorError dataLakeStorageErrorDetails) { + this.dataLakeStorageErrorDetails = dataLakeStorageErrorDetails; return this; } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ModifiedAccessConditions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ModifiedAccessConditions.java new file mode 100644 index 000000000000..a6c820c0f924 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ModifiedAccessConditions.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * Additional parameters for a set of operations. + */ +@JacksonXmlRootElement(localName = "modified-access-conditions") +@Fluent +public final class ModifiedAccessConditions { + /* + * Specify a SQL where clause on blob tags to operate only on blobs with a + * matching value. + */ + @JsonProperty(value = "ifTags") + private String ifTags; + + /** + * Get the ifTags property: Specify a SQL where clause on blob tags to + * operate only on blobs with a matching value. + * + * @return the ifTags value. + */ + public String getIfTags() { + return this.ifTags; + } + + /** + * Set the ifTags property: Specify a SQL where clause on blob tags to + * operate only on blobs with a matching value. + * + * @param ifTags the ifTags value to set. + * @return the ModifiedAccessConditions object itself. + */ + public ModifiedAccessConditions setIfTags(String ifTags) { + this.ifTags = ifTags; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java index 6eb9f6b76397..73e0069033b6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java @@ -25,6 +25,7 @@ public final class BlobItem { */ public BlobItem() { tags = null; + objectReplicationSourcePolicies = null; } /** @@ -48,6 +49,24 @@ public BlobItem(BlobItemInternal blobItemInternal) { this.tags.put(tag.getKey(), tag.getValue()); } } + this.objectReplicationSourcePolicies = null; + if (blobItemInternal.getObjectReplicationMetadata() != null) { + this.objectReplicationSourcePolicies = new HashMap<>(); + for (String orString : blobItemInternal.getObjectReplicationMetadata().keySet()) { + String str = orString.startsWith("or-") ? orString.substring(3) : orString; + String[] split = str.split("_"); + String policyId = split[0]; + String ruleId = split[1]; + if (objectReplicationSourcePolicies.containsKey(policyId)) { + objectReplicationSourcePolicies.get(policyId) + .putRuleAndStatus(ruleId, blobItemInternal.getObjectReplicationMetadata().get(orString)); + } else { + ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); + policy.putRuleAndStatus(ruleId, blobItemInternal.getObjectReplicationMetadata().get(orString)); + objectReplicationSourcePolicies.put(policyId, policy); + } + } + } } /* @@ -90,17 +109,10 @@ public BlobItem(BlobItemInternal blobItemInternal) { private Boolean isCurrentVersion; - /* - * The objectReplicationPolicyId property. + /* + * The objectReplicationSourcePolicies property. */ - @JsonProperty(value = "ObjectReplicationPolicyId") - private String objectReplicationPolicyId; - - /* - * The objectReplicationRuleStatus property. - */ - @JsonProperty(value = "BlobObjectReplicationRuleStatus") - private Map objectReplicationRuleStatus; + private Map objectReplicationSourcePolicies; /* * The isPrefix property. @@ -258,48 +270,26 @@ public BlobItem setIsCurrentVersion(Boolean isCurrentVersion) { } /** - * Get the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. - * - * @return the objectReplicationPolicyId value. - */ - public String getObjectReplicationPolicyId() { - return this.objectReplicationPolicyId; - } - - /** - * Set the objectReplicationPolicyId property: The - * objectReplicationPolicyId property. - * - * @param objectReplicationPolicyId the objectReplicationPolicyId value to - * set. - * @return the BlobItem object itself. - */ - public BlobItem setObjectReplicationPolicyId(String objectReplicationPolicyId) { - this.objectReplicationPolicyId = objectReplicationPolicyId; - return this; - } - - /** - * Get the objectReplicationRuleStatus property: The - * objectReplicationRuleStatus property. + * Get the objectReplicationSourcePolicies property: The + * objectReplicationSourcePolicies property. * - * @return the objectReplicationRuleStatus value. + * @return the objectReplicationSourcePolicies value. */ - public Map getObjectReplicationRuleStatus() { - return this.objectReplicationRuleStatus; + public Map getObjectReplicationSourcePolicies() { + return this.objectReplicationSourcePolicies; } /** - * Set the objectReplicationRuleStatus property: The - * objectReplicationRuleStatus property. + * Set the objectReplicationSourcePolicies property: The + * objectReplicationSourcePolicies property. * - * @param objectReplicationRuleStatus the objectReplicationRuleStatus value + * @param objectReplicationSourcePolicies the objectReplicationSourcePolicies value * to set. * @return the BlobItem object itself. */ - public BlobItem setObjectReplicationRuleStatus(Map objectReplicationRuleStatus) { - this.objectReplicationRuleStatus = objectReplicationRuleStatus; + public BlobItem setObjectReplicationSourcePolicies( + Map objectReplicationSourcePolicies) { + this.objectReplicationSourcePolicies = objectReplicationSourcePolicies; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java index 507e7b557b66..88168e9901b9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItemProperties.java @@ -9,6 +9,7 @@ import com.azure.storage.blob.implementation.models.BlobItemPropertiesInternal; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + import java.time.OffsetDateTime; /** @@ -64,25 +65,6 @@ public BlobItemProperties(BlobItemPropertiesInternal blobItemPropertiesInternal) this.encryptionScope = blobItemPropertiesInternal.getEncryptionScope(); this.accessTierChangeTime = blobItemPropertiesInternal.getAccessTierChangeTime(); this.tagCount = blobItemPropertiesInternal.getTagCount(); - - // TODO: (rickle-msft) Uncomment when these properties are returned on lists. - /*this.objectReplicationSourcePolicies = new HashMap<>(); - this.objectReplicationDestinationPolicyId = objectReplicationStatus.getOrDefault("policy-id", null); - if (objectReplicationDestinationPolicyId == null) { - for (String str : objectReplicationStatus.keySet()) { - String[] split = str.split("_"); - String policyId = split[0]; - String ruleId = split[1]; - if (objectReplicationSourcePolicies.containsKey(policyId)) { - objectReplicationSourcePolicies.get(policyId) - .putRuleAndStatus(ruleId, objectReplicationStatus.get(str)); - } else { - ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); - policy.putRuleAndStatus(ruleId, objectReplicationStatus.get(str)); - objectReplicationSourcePolicies.put(policyId, policy); - } - } - }*/ } /* @@ -280,13 +262,6 @@ public BlobItemProperties(BlobItemPropertiesInternal blobItemPropertiesInternal) @JsonProperty(value = "AccessTierChangeTime") private OffsetDateTime accessTierChangeTime; - // TODO: (rickle-msft) uncomment when these are returned on lists. - /* - private Map objectReplicationSourcePolicies; - - private String objectReplicationDestinationPolicyId; - */ - /* * The tagCount property. */ 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 1ef4b15d0e6d..6a092b5e7521 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 @@ -191,7 +191,7 @@ Mono> createWithResponse(AppendBlobCreateOptions option options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), null, tagsToString(options.getTags()), options.getHeaders(), - getCustomerProvidedKey(), encryptionScope, + getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { AppendBlobCreateHeaders hd = rb.getDeserializedHeaders(); @@ -269,7 +269,7 @@ Mono> appendBlockWithResponse(Flux data, lo appendBlobRequestConditions.getMaxSize(), appendBlobRequestConditions.getAppendPosition(), appendBlobRequestConditions.getIfModifiedSince(), appendBlobRequestConditions.getIfUnmodifiedSince(), appendBlobRequestConditions.getIfMatch(), appendBlobRequestConditions.getIfNoneMatch(), null, - getCustomerProvidedKey(), encryptionScope, + getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { AppendBlobAppendBlockHeaders hd = rb.getDeserializedHeaders(); @@ -357,7 +357,7 @@ Mono> appendBlockFromUrlWithResponse(String sourceUrl, destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, - getCustomerProvidedKey(), encryptionScope, + getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { AppendBlobAppendBlockFromUrlHeaders hd = rb.getDeserializedHeaders(); 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 0efe941280e7..eeb6a46f26e8 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 @@ -536,7 +536,7 @@ private Mono onStart(String sourceUrl, Map metadat sourceModifiedRequestConditions.getIfNoneMatch(), destinationRequestConditions.getIfModifiedSince(), destinationRequestConditions.getIfUnmodifiedSince(), destinationRequestConditions.getIfMatch(), destinationRequestConditions.getIfNoneMatch(), destinationRequestConditions.getLeaseId(), null, - tagsToString(tags), null, context)) + tagsToString(tags), null, null, context)) .map(response -> { final BlobStartCopyFromURLHeaders headers = response.getDeserializedHeaders(); @@ -755,7 +755,7 @@ Mono> copyFromUrlWithResponse(String copySource, BlobCopyFromUr sourceModifiedRequestConditions.getIfNoneMatch(), destRequestConditions.getIfModifiedSince(), destRequestConditions.getIfUnmodifiedSince(), destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), destRequestConditions.getLeaseId(), null, null, - tagsToString(options.getTags()), null, context) + tagsToString(options.getTags()), null, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getCopyId())); } @@ -829,7 +829,7 @@ private Mono downloadHelper(BlobRange range, DownloadRetryOpti return azureBlobStorage.blobs().downloadWithRestResponseAsync(null, null, snapshot, versionId, null, range.toHeaderValue(), requestConditions.getLeaseId(), getMD5, null, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, customerProvidedKey, context) + requestConditions.getIfNoneMatch(), null, customerProvidedKey, null, context) .map(response -> { info.setETag(response.getDeserializedHeaders().getETag()); return new ReliableDownload(response, options, info, updatedInfo -> @@ -1248,7 +1248,7 @@ Mono> deleteWithResponse(DeleteSnapshotsOptionType deleteBlobSnap return this.azureBlobStorage.blobs().deleteWithRestResponseAsync(null, null, snapshot, versionId, null, requestConditions.getLeaseId(), deleteBlobSnapshotOptions, requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, context) + requestConditions.getIfNoneMatch(), null, null, context) .map(response -> new SimpleResponse<>(response, null)); } @@ -1301,7 +1301,7 @@ Mono> getPropertiesWithResponse(BlobRequestConditions r null, null, snapshot, versionId, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, customerProvidedKey, + requestConditions.getIfNoneMatch(), null, customerProvidedKey, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlobGetPropertiesHeaders hd = rb.getDeserializedHeaders(); @@ -1373,7 +1373,7 @@ Mono> setHttpHeadersWithResponse(BlobHttpHeaders headers, BlobReq return this.azureBlobStorage.blobs().setHTTPHeadersWithRestResponseAsync( null, null, null, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, headers, context) + requestConditions.getIfNoneMatch(), null, headers, null, context) .map(response -> new SimpleResponse<>(response, null)); } @@ -1431,7 +1431,7 @@ Mono> setMetadataWithResponse(Map metadata, BlobR return this.azureBlobStorage.blobs().setMetadataWithRestResponseAsync( null, null, null, metadata, requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, customerProvidedKey, encryptionScope, + requestConditions.getIfNoneMatch(), null, customerProvidedKey, encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, null)); } @@ -1475,7 +1475,7 @@ public Mono>> getTagsWithResponse() { Mono>> getTagsWithResponse(Context context) { return this.azureBlobStorage.blobs().getTagsWithRestResponseAsync(null, null, null, null, snapshot, - versionId, context) + versionId, null, context) .map(response -> { Map tags = new HashMap<>(); for (BlobTag tag : response.getValue().getBlobTagSet()) { @@ -1535,7 +1535,7 @@ Mono> setTagsWithResponse(Map tags, Context conte } BlobTags t = new BlobTags().setBlobTagSet(tagList); return this.azureBlobStorage.blobs().setTagsWithRestResponseAsync(null, null, null, versionId, null, null, null, - t, context) + t, null, context) .map(response -> new SimpleResponse<>(response, null)); } @@ -1592,7 +1592,7 @@ Mono> createSnapshotWithResponse(Map new SimpleResponse<>(rb, this.getSnapshotClient(rb.getDeserializedHeaders().getSnapshot()))); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java index 88cafec6ad34..b48b2faeeba5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseAsyncClient.java @@ -137,7 +137,7 @@ Mono> acquireLeaseWithResponse(int duration, RequestConditions if (this.isBlob) { return this.client.blobs().acquireLeaseWithRestResponseAsync(null, null, null, duration, this.leaseId, modifiedRequestConditions.getIfModifiedSince(), modifiedRequestConditions.getIfUnmodifiedSince(), - modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, + modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseId())); } else { @@ -195,7 +195,7 @@ Mono> renewLeaseWithResponse(RequestConditions modifiedRequestC if (this.isBlob) { return this.client.blobs().renewLeaseWithRestResponseAsync(null, null, this.leaseId, null, modifiedRequestConditions.getIfModifiedSince(), modifiedRequestConditions.getIfUnmodifiedSince(), - modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, + modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseId())); } else { @@ -254,7 +254,7 @@ Mono> releaseLeaseWithResponse(RequestConditions modifiedRequestC if (this.isBlob) { return this.client.blobs().releaseLeaseWithRestResponseAsync(null, null, this.leaseId, null, modifiedRequestConditions.getIfModifiedSince(), modifiedRequestConditions.getIfUnmodifiedSince(), - modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, + modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, null)); } else { @@ -322,7 +322,7 @@ Mono> breakLeaseWithResponse(Integer breakPeriodInSeconds, if (this.isBlob) { return this.client.blobs().breakLeaseWithRestResponseAsync(null, null, null, breakPeriodInSeconds, modifiedRequestConditions.getIfModifiedSince(), modifiedRequestConditions.getIfUnmodifiedSince(), - modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, + modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseTime())); } else { @@ -383,7 +383,7 @@ Mono> changeLeaseWithResponse(String proposedId, RequestConditi if (this.isBlob) { return this.client.blobs().changeLeaseWithRestResponseAsync(null, null, this.leaseId, proposedId, null, modifiedRequestConditions.getIfModifiedSince(), modifiedRequestConditions.getIfUnmodifiedSince(), - modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, + modifiedRequestConditions.getIfMatch(), modifiedRequestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getLeaseId())); } else { 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 b8f5e033e997..285c426e809f 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 @@ -255,7 +255,7 @@ Mono> uploadWithResponse(Flux data, long len null, data, length, null, options.getContentMd5(), options.getMetadata(), requestConditions.getLeaseId(), options.getTier(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), null, tagsToString(options.getTags()), - options.getHeaders(), getCustomerProvidedKey(), encryptionScope, + options.getHeaders(), getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlockBlobUploadHeaders hd = rb.getDeserializedHeaders(); @@ -470,7 +470,7 @@ public Mono> listBlocksWithResponse(BlockListType listType, Mono> listBlocksWithResponse(BlockListType listType, String leaseId, Context context) { return this.azureBlobStorage.blockBlobs().getBlockListWithRestResponseAsync( - null, null, listType, getSnapshotId(), null, leaseId, null, context) + null, null, listType, getSnapshotId(), null, leaseId, null, null, context) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -593,7 +593,7 @@ Mono> commitBlockListWithResponse(List base64Blo requestConditions.getLeaseId(), options.getTier(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), null, tagsToString(options.getTags()), options.getHeaders(), - getCustomerProvidedKey(), encryptionScope, + getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlockBlobCommitBlockListHeaders hd = rb.getDeserializedHeaders(); 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 ac838bded9c8..6fdd1963c676 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 @@ -242,7 +242,7 @@ Mono> createWithResponse(long size, PageBlobCreateOptions options.getMetadata(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), options.getSequenceNumber(), null, tagsToString(options.getTags()), - options.getHeaders(), getCustomerProvidedKey(), encryptionScope, + options.getHeaders(), getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { PageBlobCreateHeaders hd = rb.getDeserializedHeaders(); @@ -336,7 +336,7 @@ Mono> uploadPagesWithResponse(PageRange pageRange, Flux { PageBlobUploadPagesHeaders hd = rb.getDeserializedHeaders(); @@ -455,7 +455,7 @@ Mono> uploadPagesFromUrlWithResponse(PageRange range, Str destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, - getCustomerProvidedKey(), encryptionScope, + getCustomerProvidedKey(), encryptionScope, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { PageBlobUploadPagesFromURLHeaders hd = rb.getDeserializedHeaders(); @@ -592,7 +592,7 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ return this.azureBlobStorage.pageBlobs().getPageRangesWithRestResponseAsync(null, null, getSnapshotId(), null, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), null, + requestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, response.getValue())); } @@ -727,7 +727,7 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri return this.azureBlobStorage.pageBlobs().getPageRangesDiffWithRestResponseAsync(null, null, getSnapshotId(), null, prevSnapshot, url, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), - requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), null, + requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, response.getValue())); } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy index 429a044a1f52..396ef909c9cc 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy @@ -26,6 +26,7 @@ import com.azure.storage.blob.specialized.AppendBlobClient import com.azure.storage.blob.specialized.BlobClientBase import com.azure.storage.common.Utility import reactor.test.StepVerifier +import spock.lang.Requires import spock.lang.Unroll import java.time.Duration @@ -934,6 +935,38 @@ class ContainerAPITest extends APISpec { pagedResponse2.getContinuationToken() == null } + /* + This test requires two accounts that are configured in a very specific way. It is not feasible to setup that + relationship programmatically, so we have recorded a successful interaction and only test recordings. + */ + @Requires( {playbackMode()}) + def "List blobs flat ORS"() { + setup: + def sourceContainer = primaryBlobServiceClient.getBlobContainerClient("test1") + def destContainer = alternateBlobServiceClient.getBlobContainerClient("test2") + + when: + def sourceBlobs = sourceContainer.listBlobs().stream().collect(Collectors.toList()) + def destBlobs = destContainer.listBlobs().stream().collect(Collectors.toList()) + + then: + int i = 0 + for (def blob : sourceBlobs) { + if (i == 1) { + assert blob.getObjectReplicationSourcePolicies() == null /* Why? */ + } else { + assert blob.getObjectReplicationSourcePolicies().get("fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80") + .getRules().get("105f9aad-f39b-4064-8e47-ccd7937295ca") == "complete" + } + i++ + } + + /* No ors metadata on the dest blobs. Why? */ + for (def blob : destBlobs) { + assert blob.getObjectReplicationSourcePolicies() == null + } + } + def "List blobs flat error"() { setup: cc = primaryBlobServiceClient.getBlobContainerClient(generateContainerName()) diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json new file mode 100644 index 000000000000..77f02c020842 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestlistblobsflators.json @@ -0,0 +1,128 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobsflators0containerapitestlistblobsflators5f356926a?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "3290e461-7115-4e80-b517-221f6b23b297" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D807FCED8FAEDC", + "Last-Modified" : "Wed, 03 Jun 2020 20:30:17 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "70926a02-e01e-006c-16e5-39a637000000", + "Date" : "Wed, 03 Jun 2020 20:30:16 GMT", + "x-ms-client-request-id" : "3290e461-7115-4e80-b517-221f6b23b297" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test1?restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "557f745a-3d87-453e-b365-305f87feb579" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "ccd0c323-501e-0079-38e5-39b184000000", + "Body" : "bla.txt2020-05-18T09:53:04.5502688ZtrueMon, 18 May 2020 09:53:04 GMTMon, 18 May 2020 09:53:04 GMT0x8D7FB114288CFC90application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruecompleteempty.txt2020-03-19T18:21:09.4878662ZtrueThu, 19 Mar 2020 18:21:09 GMTThu, 19 Mar 2020 18:21:09 GMT0x8D7CC324C3049C60text/plain1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrueempty2.txt2020-03-19T18:36:03.0870309ZtrueThu, 19 Mar 2020 18:36:03 GMTThu, 19 Mar 2020 18:36:03 GMT0x8D7CC3460D0B3250text/plain1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruecompletejavablobgetpropertiesors2blobapitestgetpropertiesors57d93407b2020-04-21T21:14:42.3905881ZtrueTue, 21 Apr 2020 21:14:42 GMTTue, 21 Apr 2020 21:14:42 GMT0x8D7E6390264E6597application/octet-streamwh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruecompletejavablobgetpropertiesors2blobapitestgetpropertiesorsa300090272020-04-21T21:12:08.2403198ZtrueTue, 21 Apr 2020 21:12:08 GMTTue, 21 Apr 2020 21:12:08 GMT0x8D7E638A68348677application/octet-streamwh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruecompletenetgetpropertiesors2blobapitestgetpropertiesors2020-04-23T22:04:56.9882747ZtrueThu, 23 Apr 2020 22:04:56 GMTThu, 23 Apr 2020 22:04:56 GMT0x8D7E7D25C0F807B1024application/octet-streameyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruecompletepythonorstest2020-05-19T08:19:55.0147367ZtrueTue, 19 May 2020 08:19:55 GMTTue, 19 May 2020 08:19:55 GMT0x8D7FBCD695347271024application/octet-streameyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruecompletetest-blob-05f305ef-7c62-4100-9be8-dfdc35d9acb42020-04-08T16:37:22.3864005ZtrueWed, 08 Apr 2020 16:37:22 GMTWed, 08 Apr 2020 16:37:22 GMT0x8D7DBDB1CCF02C51024application/octet-streamTVB1AC66UQCYabsrh5MhTw==BlockBlobHottrueunlockedavailabletruecompletetest-blob-19f4217a-3814-436b-a70d-3be4b0c604e22020-04-15T09:03:31.2849799ZtrueWed, 15 Apr 2020 09:03:31 GMTWed, 15 Apr 2020 09:03:31 GMT0x8D7E11BDEB2C86B1024application/octet-streamsVLUBL9mQUUJgLz3ayOPnw==BlockBlobHottrueunlockedavailabletruecompletetest-blob-2e0fea14-bcfe-49d1-a9d0-fefeee868ba82020-04-21T16:46:42.8364584ZtrueTue, 21 Apr 2020 16:46:42 GMTTue, 21 Apr 2020 16:46:42 GMT0x8D7E613923BA7281024application/octet-streamBQnM0Erc5PApw5lFS13g4A==BlockBlobHottrueunlockedavailabletruecompletetest-blob-4151db5a-2efb-4721-a652-b5fec185effd2020-04-21T18:07:56.6479262ZtrueTue, 21 Apr 2020 18:07:56 GMTTue, 21 Apr 2020 18:07:56 GMT0x8D7E61EEB40439E1024application/octet-streamr4Yw3MbQxkZ1CKa/aNq3zQ==BlockBlobHottrueunlockedavailabletruecompletetest-blob-42ac4530-d57f-4274-bec5-24008e067aa02020-04-17T10:46:50.9617246ZtrueFri, 17 Apr 2020 10:46:50 GMTFri, 17 Apr 2020 10:46:50 GMT0x8D7E2BCA2D2085E1024application/octet-streamNM1NnZ45A+0PgMnJhRd50w==BlockBlobHottrueunlockedavailabletruecompletetest-blob-439e07c8-3a3d-4884-bf70-e579e5465b9e2020-04-10T07:22:59.7039968ZtrueFri, 10 Apr 2020 07:22:59 GMTFri, 10 Apr 2020 07:22:59 GMT0x8D7DD1FFF87F7601024application/octet-streamr02uYRKktDbx7O7jr2JPEg==BlockBlobHottrueunlockedavailabletruecompletetest-blob-63a40b42-a397-49c1-9dd5-5313d1b40b0f2020-04-21T08:06:03.1429891ZtrueTue, 21 Apr 2020 08:06:03 GMTTue, 21 Apr 2020 08:06:03 GMT0x8D7E5CAD5ECB9031024application/octet-streamVHLGWd6QIy8A8j1NJLEbuQ==BlockBlobHottrueunlockedavailabletruecompletetest-blob-680635f3-442e-489f-9a85-2ac8bcc7b6642020-04-21T07:47:05.4214801ZtrueTue, 21 Apr 2020 07:47:05 GMTTue, 21 Apr 2020 07:47:05 GMT0x8D7E5C82FCA32911024application/octet-streamuy19XrzHIPUNECh4XUK9fA==BlockBlobHottrueunlockedavailabletruecompletetest-blob-7eb1888f-3392-4ac5-8ecf-32c3dcaef4242020-04-21T08:22:32.1786871ZtrueTue, 21 Apr 2020 08:22:32 GMTTue, 21 Apr 2020 08:22:32 GMT0x8D7E5CD236F70DC1024application/octet-streamz981+quoexH/KoB87CpRrQ==BlockBlobHottrueunlockedavailabletruecompletetest-blob-87054792-7952-454d-a3a4-d24d7a58072b2020-04-10T07:20:29.9760980ZtrueFri, 10 Apr 2020 07:20:29 GMTFri, 10 Apr 2020 07:20:29 GMT0x8D7DD1FA64926391024application/octet-streamn+6QqYEY1j6JhXTlQsO5+A==BlockBlobHottrueunlockedavailabletruecompletetest-blob-8d8191bb-2590-4f0c-970c-f4b5d93549372020-04-15T22:18:12.9226671ZtrueWed, 15 Apr 2020 22:18:12 GMTWed, 15 Apr 2020 22:18:12 GMT0x8D7E18AE32B73AF1024application/octet-streamBlbYwBg67aey1pHWTobLaw==BlockBlobHottrueunlockedavailabletruecompletetest-blob-94b860e9-1362-4477-87a9-b39bd5e031cd2020-04-21T08:15:11.4478471ZtrueTue, 21 Apr 2020 08:15:11 GMTTue, 21 Apr 2020 08:15:11 GMT0x8D7E5CC1CBD40751024application/octet-streamuZ68a1o3ZeCZEYGay4DNJw==BlockBlobHottrueunlockedavailabletruecompletetest-blob-9c51ac1f-7aae-41da-860f-68d24c824aec2020-04-21T17:14:10.8319566ZtrueTue, 21 Apr 2020 17:14:10 GMTTue, 21 Apr 2020 17:14:10 GMT0x8D7E6176883CF4E1024application/octet-stream5QQwR+oxRUo47fAKLNwJww==BlockBlobHottrueunlockedavailabletruecompletetest-blob-c50911a3-0d56-63b7-b271-fc06433b5a612020-04-23T21:27:51.6362967ZtrueThu, 23 Apr 2020 21:27:51 GMTThu, 23 Apr 2020 21:27:51 GMT0x8D7E7CD2DA595B71024application/octet-streamXjWQ6axCDNvVTMJmkQR5mA==BlockBlobHottrueunlockedavailabletruecompletetest-blob-d7451209-53d0-4714-8f45-5b730ff969cf2020-04-21T17:24:27.4949876ZtrueTue, 21 Apr 2020 17:24:27 GMTTue, 21 Apr 2020 17:24:27 GMT0x8D7E618D812F7D81024application/octet-streamexjSPFwG8ok4r9hKhMrSDg==BlockBlobHottrueunlockedavailabletruecompletetest-blob-d882af08-437d-41b2-b706-473aa2ca27872020-04-17T08:33:03.1782868ZtrueFri, 17 Apr 2020 08:33:03 GMTFri, 17 Apr 2020 08:33:03 GMT0x8D7E2A9F1E356C11024application/octet-streamhpZ34Awx6h0noqHRbaCziA==BlockBlobHottrueunlockedavailabletruecompletetest-blob-eb5df4b6-f52c-4c23-8e18-ffaacbc311a72020-04-21T18:15:43.5177127ZtrueTue, 21 Apr 2020 18:15:43 GMTTue, 21 Apr 2020 18:15:43 GMT0x8D7E6200186F0A71024application/octet-streamacz4lRSrvmKwlanXE6jyxA==BlockBlobHottrueunlockedavailabletruecompletetest-blob-f18c2461-e619-4fd9-ae17-c773a23dc2042020-04-21T20:55:33.4973249ZtrueTue, 21 Apr 2020 20:55:33 GMTTue, 21 Apr 2020 20:55:33 GMT0x8D7E63655998C251024application/octet-stream8kNAIpqymDVPTJuX7MXX4g==BlockBlobHottrueunlockedavailabletruecomplete", + "Date" : "Wed, 03 Jun 2020 20:30:17 GMT", + "x-ms-client-request-id" : "557f745a-3d87-453e-b365-305f87feb579", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/test2?restype=container&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "bb787576-6f60-4480-bace-f71f595c20f0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "51be92f5-101e-004a-01e5-39794d000000", + "Body" : "bla.txtMon, 18 May 2020 09:55:04 GMTMon, 18 May 2020 09:55:04 GMT0x8D7FB118A463E240application/octet-streamAAAAAAAAAAA=1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletrueempty2.txtThu, 19 Mar 2020 18:37:06 GMTThu, 19 Mar 2020 18:37:06 GMT0x8D7CC3486E43BC60text/plainAAAAAAAAAAA=1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottrueunlockedavailabletruejavablobgetpropertiesors2blobapitestgetpropertiesors57d93407b2020-04-21T21:15:42.8141548ZtrueTue, 21 Apr 2020 21:15:42 GMTTue, 21 Apr 2020 21:15:42 GMT0x8D7E6392667E1617application/octet-stream6RYQPwaVsyQ=wh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruejavablobgetpropertiesors2blobapitestgetpropertiesorsa30009027Tue, 21 Apr 2020 21:13:08 GMTTue, 21 Apr 2020 21:13:08 GMT0x8D7E638CA717B137application/octet-stream6RYQPwaVsyQ=wh+Wm18D0z1D4E+PE252gg==BlockBlobHottrueunlockedavailabletruenetgetpropertiesors2blobapitestgetpropertiesorsThu, 23 Apr 2020 22:06:35 GMTThu, 23 Apr 2020 22:06:35 GMT0x8D7E7D296E942361024application/octet-streammvPi4gbJB9o=eyObQAWrMwC74Eh3CuRM2g==BlockBlobHottrueunlockedavailabletruepythonorstest2020-05-19T08:22:07.2080089ZtrueTue, 19 May 2020 08:22:07 GMTTue, 19 May 2020 08:22:07 GMT0x8D7FBCDB81E37C01024application/octet-streamBlockBlobHottrueunlockedavailabletruetest-blob-05f305ef-7c62-4100-9be8-dfdc35d9acb4Wed, 08 Apr 2020 16:38:23 GMTWed, 08 Apr 2020 16:38:23 GMT0x8D7DBDB414196751024application/octet-streamvzsWK4EwEM8=TVB1AC66UQCYabsrh5MhTw==BlockBlobHottrueunlockedavailabletruetest-blob-19f4217a-3814-436b-a70d-3be4b0c604e22020-04-15T09:05:43.9282492ZtrueWed, 15 Apr 2020 09:05:43 GMTWed, 15 Apr 2020 09:05:43 GMT0x8D7E11C2DC2456B1024application/octet-stream94WCAc7HFGQ=sVLUBL9mQUUJgLz3ayOPnw==BlockBlobHottrueunlockedavailabletruetest-blob-2e0fea14-bcfe-49d1-a9d0-fefeee868ba8Tue, 21 Apr 2020 16:48:43 GMTTue, 21 Apr 2020 16:48:43 GMT0x8D7E613DA21804F1024application/octet-stream2AEPgK6WcRU=BQnM0Erc5PApw5lFS13g4A==BlockBlobHottrueunlockedavailabletruetest-blob-4151db5a-2efb-4721-a652-b5fec185effd2020-04-21T18:09:56.8642226ZtrueTue, 21 Apr 2020 18:09:56 GMTTue, 21 Apr 2020 18:09:56 GMT0x8D7E61F32E750AE1024application/octet-streamFKAwHELGpEk=r4Yw3MbQxkZ1CKa/aNq3zQ==BlockBlobHottrueunlockedavailabletruetest-blob-42ac4530-d57f-4274-bec5-24008e067aa02020-04-17T10:47:52.6161586ZtrueFri, 17 Apr 2020 10:47:52 GMTFri, 17 Apr 2020 10:47:52 GMT0x8D7E2BCC790854D1024application/octet-streamny13PyKggJA=NM1NnZ45A+0PgMnJhRd50w==BlockBlobHottrueunlockedavailabletruetest-blob-439e07c8-3a3d-4884-bf70-e579e5465b9e2020-04-10T07:24:00.8336842ZtrueFri, 10 Apr 2020 07:24:00 GMTFri, 10 Apr 2020 07:24:00 GMT0x8D7DD2023F7613E1024application/octet-streamueplB3xcclM=r02uYRKktDbx7O7jr2JPEg==BlockBlobHottrueunlockedavailabletruetest-blob-63a40b42-a397-49c1-9dd5-5313d1b40b0f2020-04-21T08:06:46.5658017ZtrueTue, 21 Apr 2020 08:06:46 GMTTue, 21 Apr 2020 08:06:46 GMT0x8D7E5CAEFCDBDCB1024application/octet-streampv1DSIX8Aug=VHLGWd6QIy8A8j1NJLEbuQ==BlockBlobHottrueunlockedavailabletruetest-blob-680635f3-442e-489f-9a85-2ac8bcc7b6642020-04-21T07:48:05.8375466ZtrueTue, 21 Apr 2020 07:48:05 GMTTue, 21 Apr 2020 07:48:05 GMT0x8D7E5C853CC8C9D1024application/octet-streamrB/sHxxAu74=uy19XrzHIPUNECh4XUK9fA==BlockBlobHottrueunlockedavailabletruetest-blob-7eb1888f-3392-4ac5-8ecf-32c3dcaef424Tue, 21 Apr 2020 08:23:33 GMTTue, 21 Apr 2020 08:23:33 GMT0x8D7E5CD480678311024application/octet-streamNVq4+4q4WAg=z981+quoexH/KoB87CpRrQ==BlockBlobHottrueunlockedavailabletruetest-blob-87054792-7952-454d-a3a4-d24d7a58072bFri, 10 Apr 2020 07:21:30 GMTFri, 10 Apr 2020 07:21:30 GMT0x8D7DD1FCA9E644B1024application/octet-stream78b8bLSaYTk=n+6QqYEY1j6JhXTlQsO5+A==BlockBlobHottrueunlockedavailabletruetest-blob-8d8191bb-2590-4f0c-970c-f4b5d9354937Wed, 15 Apr 2020 22:20:15 GMTWed, 15 Apr 2020 22:20:15 GMT0x8D7E18B2C53F4011024application/octet-streamN1JkDoXufCw=BlbYwBg67aey1pHWTobLaw==BlockBlobHottrueunlockedavailabletruetest-blob-94b860e9-1362-4477-87a9-b39bd5e031cdTue, 21 Apr 2020 08:16:11 GMTTue, 21 Apr 2020 08:16:11 GMT0x8D7E5CC40B5EF1E1024application/octet-streammSC4kYrqGq0=uZ68a1o3ZeCZEYGay4DNJw==BlockBlobHottrueunlockedavailabletruetest-blob-9c51ac1f-7aae-41da-860f-68d24c824aecTue, 21 Apr 2020 17:15:11 GMTTue, 21 Apr 2020 17:15:11 GMT0x8D7E6178C9C508D1024application/octet-streamUOHbAMSrNKQ=5QQwR+oxRUo47fAKLNwJww==BlockBlobHottrueunlockedavailabletruetest-blob-c50911a3-0d56-63b7-b271-fc06433b5a612020-04-23T21:28:52.8914699ZtrueThu, 23 Apr 2020 21:28:52 GMTThu, 23 Apr 2020 21:28:52 GMT0x8D7E7CD5225B0151024application/octet-stream7yvhFMRIIAk=XjWQ6axCDNvVTMJmkQR5mA==BlockBlobHottrueunlockedavailabletruetest-blob-d7451209-53d0-4714-8f45-5b730ff969cf2020-04-21T17:25:28.3005754ZtrueTue, 21 Apr 2020 17:25:28 GMTTue, 21 Apr 2020 17:25:28 GMT0x8D7E618FC506BCC1024application/octet-streamgO24LhpeW7s=exjSPFwG8ok4r9hKhMrSDg==BlockBlobHottrueunlockedavailabletruetest-blob-d882af08-437d-41b2-b706-473aa2ca27872020-04-17T08:35:03.7666402ZtrueFri, 17 Apr 2020 08:35:03 GMTFri, 17 Apr 2020 08:35:03 GMT0x8D7E2AA39C304501024application/octet-streamuxjWsOvJkEo=hpZ34Awx6h0noqHRbaCziA==BlockBlobHottrueunlockedavailabletruetest-blob-eb5df4b6-f52c-4c23-8e18-ffaacbc311a7Tue, 21 Apr 2020 18:16:44 GMTTue, 21 Apr 2020 18:16:44 GMT0x8D7E620261B77FD1024application/octet-streamPf+f927c8hk=acz4lRSrvmKwlanXE6jyxA==BlockBlobHottrueunlockedavailabletruetest-blob-f18c2461-e619-4fd9-ae17-c773a23dc2042020-04-21T20:57:34.8379538ZtrueTue, 21 Apr 2020 20:57:34 GMTTue, 21 Apr 2020 20:57:34 GMT0x8D7E6369DEC0BA61024application/octet-stream6K5HggNY5Fg=8kNAIpqymDVPTJuX7MXX4g==BlockBlobHottrueunlockedavailabletrue", + "Date" : "Wed, 03 Jun 2020 20:30:18 GMT", + "x-ms-client-request-id" : "bb787576-6f60-4480-bace-f71f595c20f0", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtclistblobsflators&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "a5365d78-e01d-43b2-932d-3982c686c2c2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5afc6e4e-d01e-003a-7ee5-3957d8000000", + "Body" : "jtclistblobsflators/ortestsaccountcbn1/$blobchangefeed", + "Date" : "Wed, 03 Jun 2020 20:30:18 GMT", + "x-ms-client-request-id" : "a5365d78-e01d-43b2-932d-3982c686c2c2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net?prefix=jtclistblobsflators&marker=/ortestsaccountcbn1/%24blobchangefeed&comp=list", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "a85a6de4-9ab5-44fd-97c8-cbe3d7430b6b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "5bbf970a-701e-0033-6fe5-39120b000000", + "Body" : "jtclistblobsflators/ortestsaccountcbn1/$blobchangefeedjtclistblobsflators0containerapitestlistblobsflators5f356926aWed, 03 Jun 2020 20:30:17 GMT\"0x8D807FCED8FAEDC\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Wed, 03 Jun 2020 20:30:18 GMT", + "x-ms-client-request-id" : "a85a6de4-9ab5-44fd-97c8-cbe3d7430b6b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/jtclistblobsflators0containerapitestlistblobsflators5f356926a?restype=container", + "Headers" : { + "x-ms-version" : "2019-12-12", + "User-Agent" : "azsdk-java-azure-storage-blob/12.7.0-beta.1 (11.0.7; Windows 10 10.0)", + "x-ms-client-request-id" : "eecf3660-5d38-4014-9ac8-3599e4dc6701" + }, + "Response" : { + "x-ms-version" : "2019-12-12", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "cd35b552-d01e-0067-65e5-395d5c000000", + "Date" : "Wed, 03 Jun 2020 20:30:19 GMT", + "x-ms-client-request-id" : "eecf3660-5d38-4014-9ac8-3599e4dc6701" + }, + "Exception" : null + } ], + "variables" : [ "jtclistblobsflators0containerapitestlistblobsflators5f356926a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 1ce5e9346940..2217bf62aac1 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -15,7 +15,7 @@ autorest --use=@microsoft.azure/autorest.java@3.0.4 --use=jianghaolu/autorest.mo ### Code generation settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.BlobStorage/preview/2019-12-12/blob.json +input-file: C:\azure-rest-api-specs\specification\storage\data-plane\Microsoft.BlobStorage\preview\2019-12-12\blob.json java: true output-folder: ../ namespace: com.azure.storage.blob From 41b30e55052233d6bb3270572f3cf44e535a36e7 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Wed, 3 Jun 2020 15:32:49 -0700 Subject: [PATCH 2/4] Changed keyset to entryset --- .../main/java/com/azure/storage/blob/models/BlobItem.java | 7 ++++--- sdk/storage/azure-storage-blob/swagger/README.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java index 73e0069033b6..12cb566d5a02 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobItem.java @@ -52,17 +52,18 @@ public BlobItem(BlobItemInternal blobItemInternal) { this.objectReplicationSourcePolicies = null; if (blobItemInternal.getObjectReplicationMetadata() != null) { this.objectReplicationSourcePolicies = new HashMap<>(); - for (String orString : blobItemInternal.getObjectReplicationMetadata().keySet()) { + for (Map.Entry p : blobItemInternal.getObjectReplicationMetadata().entrySet()) { + String orString = p.getKey(); String str = orString.startsWith("or-") ? orString.substring(3) : orString; String[] split = str.split("_"); String policyId = split[0]; String ruleId = split[1]; if (objectReplicationSourcePolicies.containsKey(policyId)) { objectReplicationSourcePolicies.get(policyId) - .putRuleAndStatus(ruleId, blobItemInternal.getObjectReplicationMetadata().get(orString)); + .putRuleAndStatus(ruleId, p.getValue()); } else { ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); - policy.putRuleAndStatus(ruleId, blobItemInternal.getObjectReplicationMetadata().get(orString)); + policy.putRuleAndStatus(ruleId, p.getValue()); objectReplicationSourcePolicies.put(policyId, policy); } } diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 2217bf62aac1..1ce5e9346940 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -15,7 +15,7 @@ autorest --use=@microsoft.azure/autorest.java@3.0.4 --use=jianghaolu/autorest.mo ### Code generation settings ``` yaml -input-file: C:\azure-rest-api-specs\specification\storage\data-plane\Microsoft.BlobStorage\preview\2019-12-12\blob.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.BlobStorage/preview/2019-12-12/blob.json java: true output-folder: ../ namespace: com.azure.storage.blob From a0914057f69e03ade457a171edee15eaf5a1446d Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Wed, 3 Jun 2020 15:33:39 -0700 Subject: [PATCH 3/4] Changed one comment --- .../test/java/com/azure/storage/blob/ContainerAPITest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy index 396ef909c9cc..bf509424bbb3 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ContainerAPITest.groovy @@ -961,7 +961,7 @@ class ContainerAPITest extends APISpec { i++ } - /* No ors metadata on the dest blobs. Why? */ + /* Service specifies no ors metadata on the dest blobs. */ for (def blob : destBlobs) { assert blob.getObjectReplicationSourcePolicies() == null } From 8b22a966f4cce51950e327e4af427a1baa558dc8 Mon Sep 17 00:00:00 2001 From: Gauri Prasad Date: Thu, 25 Jun 2020 11:27:14 -0700 Subject: [PATCH 4/4] modified it to return null in emptu set case --- .../azure/storage/blob/implementation/util/ModelHelper.java | 4 ++++ 1 file changed, 4 insertions(+) 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 e4c999ff3a1d..85fd41fa8a08 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 @@ -255,6 +255,7 @@ public static BlobItemProperties populateBlobItemProperties(BlobItemPropertiesIn private static List transformObjectReplicationMetadata( Map objectReplicationMetadata) { + Map> internalSourcePolicies = new HashMap<>(); objectReplicationMetadata = objectReplicationMetadata == null ? new HashMap<>() : objectReplicationMetadata; for (Map.Entry entry : objectReplicationMetadata.entrySet()) { @@ -271,6 +272,9 @@ private static List transformObjectReplicationMetadata( internalSourcePolicies.get(policyId).add(rule); } + if (internalSourcePolicies.isEmpty()) { + return null; + } List objectReplicationSourcePolicies = new ArrayList<>(); for (Map.Entry> entry : internalSourcePolicies.entrySet()) { objectReplicationSourcePolicies.add(new ObjectReplicationPolicy(entry.getKey(), entry.getValue()));