diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java index 8040c6126095..1326018c1e97 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/util/BlobRequestConditionProperty.java @@ -3,11 +3,44 @@ package com.azure.storage.blob.implementation.util; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + public enum BlobRequestConditionProperty { - LEASE_ID, - TAGS_CONDITIONS, - IF_MODIFIED_SINCE, - IF_UNMODIFIED_SINCE, - IF_MATCH, - IF_NONE_MATCH; + LEASE_ID("LeaseId"), + TAGS_CONDITIONS("TagsConditions"), + IF_MODIFIED_SINCE("IfModifiedSince"), + IF_UNMODIFIED_SINCE("IfUnmodifiedSince"), + IF_MATCH("IfMatch"), + IF_NONE_MATCH("IfNoneMatch"); + + /** The actual serialized value for a BlobRequestConditionProperty instance. */ + private final String value; + + BlobRequestConditionProperty(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a BlobRequestConditionProperty instance. + * + * @param value the serialized value to parse. + * @return the parsed BlobRequestConditionProperty object, or null if unable to parse. + */ + @JsonCreator + public static BlobRequestConditionProperty fromString(String value) { + BlobRequestConditionProperty[] items = BlobRequestConditionProperty.values(); + for (BlobRequestConditionProperty item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } } 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 1afb9de4ac41..64dbc43d8885 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 @@ -504,37 +504,65 @@ public static BlobQueryHeaders transformQueryHeaders(HttpHeaders headers) { } public static void validateConditionsNotPresent(BlobRequestConditions requestConditions, - EnumSet invalidConditions) { + EnumSet invalidConditions, String operationName, String parameterName) { if (requestConditions == null) { return; } - if (invalidConditions.contains(BlobRequestConditionProperty.LEASE_ID) - && requestConditions.getLeaseId() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'leaseId' is not applicable to this API.")); - } - if (invalidConditions.contains(BlobRequestConditionProperty.TAGS_CONDITIONS) - && requestConditions.getTagsConditions() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'tagsConditions' is not applicable to " - + "this API.")); - } - if (invalidConditions.contains(BlobRequestConditionProperty.IF_MODIFIED_SINCE) - && requestConditions.getIfModifiedSince() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifModifiedSince' is not applicable to " - + "this API.")); - } - if (invalidConditions.contains(BlobRequestConditionProperty.IF_UNMODIFIED_SINCE) - && requestConditions.getIfUnmodifiedSince() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifUnmodifiedSince' is not applicable to " - + "this API.")); - } - if (invalidConditions.contains(BlobRequestConditionProperty.IF_MATCH) - && requestConditions.getIfMatch() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifMatch' is not applicable to this API.")); + List invalidConditionsFound = null; + + for (BlobRequestConditionProperty condition : invalidConditions) { + switch (condition) { + case LEASE_ID: + if (requestConditions.getLeaseId() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.LEASE_ID.toString()); + } + break; + case TAGS_CONDITIONS: + if (requestConditions.getTagsConditions() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.TAGS_CONDITIONS.toString()); + } + break; + case IF_MODIFIED_SINCE: + if (requestConditions.getIfModifiedSince() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.IF_MODIFIED_SINCE.toString()); + } + break; + case IF_UNMODIFIED_SINCE: + if (requestConditions.getIfUnmodifiedSince() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.IF_UNMODIFIED_SINCE.toString()); + } + break; + case IF_MATCH: + if (requestConditions.getIfMatch() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.IF_MATCH.toString()); + } + break; + case IF_NONE_MATCH: + if (requestConditions.getIfNoneMatch() != null) { + invalidConditionsFound = invalidConditionsFound == null ? new ArrayList<>() + : invalidConditionsFound; + invalidConditionsFound.add(BlobRequestConditionProperty.IF_NONE_MATCH.toString()); + } + break; + default: + break; + } } - if (invalidConditions.contains(BlobRequestConditionProperty.IF_NONE_MATCH) - && requestConditions.getIfNoneMatch() != null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException("'ifNoneMatch' is not applicable to this " - + "API.")); + if (invalidConditionsFound != null && !invalidConditionsFound.isEmpty()) { + String unsupported = String.join(", ", invalidConditionsFound); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("%s does not support the %s request condition(s) for parameter '%s'.", + operationName, unsupported, parameterName))); } } } 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 14d4fdfbdefa..8180c0b4d672 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 @@ -2256,7 +2256,8 @@ Mono> setImmutabilityPolicyWithResponse( ModelHelper.validateConditionsNotPresent(finalRequestConditions, EnumSet.of(BlobRequestConditionProperty.LEASE_ID, BlobRequestConditionProperty.TAGS_CONDITIONS, BlobRequestConditionProperty.IF_MATCH, BlobRequestConditionProperty.IF_NONE_MATCH, - BlobRequestConditionProperty.IF_MODIFIED_SINCE)); + BlobRequestConditionProperty.IF_MODIFIED_SINCE), "setImmutabilityPolicy(WithResponse)", + "requestConditions"); return this.azureBlobStorage.getBlobs().setImmutabilityPolicyWithResponseAsync(containerName, blobName, null, null, finalRequestConditions.getIfUnmodifiedSince(), finalImmutabilityPolicy.getExpiryTime(), diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy index 7cbed8318295..11fce0b43a7c 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/ImmutableStorageWithVersioningTest.groovy @@ -275,15 +275,16 @@ class ImmutableStorageWithVersioningTest extends APISpec { then: def e = thrown(IllegalArgumentException) - e.getMessage() == wrongCondition + " is not applicable to this API." + e.getMessage() == String.format("%s does not support the %s request condition(s) for parameter 'requestConditions'.", "setImmutabilityPolicy(WithResponse)", wrongCondition) where: leaseId | tags | ifMatch | ifNoneMatch | ifModifiedSince || wrongCondition - "leaseId" | null | null | null | null || "'leaseId'" - null | "tagsConditions" | null | null | null || "'tagsConditions'" - null | null | "ifMatch" | null | null || "'ifMatch'" - null | null | null | "ifNoneMatch" | null || "'ifNoneMatch'" - null | null | null | null | oldDate || "'ifModifiedSince'" + "leaseId" | null | null | null | null || "LeaseId" + null | "tagsConditions" | null | null | null || "TagsConditions" + null | null | "ifMatch" | null | null || "IfMatch" + null | null | null | "ifNoneMatch" | null || "IfNoneMatch" + null | null | null | null | oldDate || "IfModifiedSince" + "leaseId" | "tagsConditions" | "ifMatch" | "ifNoneMatch" | oldDate || "LeaseId, TagsConditions, IfModifiedSince, IfMatch, IfNoneMatch" } def "set immutability policy error"() { diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json index 4f3f34498bc4..9357e8ef4026 100644 --- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[0].json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1301e8e8c13d1e4448478653498e9004a219f2?restype=container", + "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1301e8e8c134c16197853efefaa66994939a49?restype=container", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "da7835f2-2cb0-40eb-9f13-0e808de4b12f" + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "38ccfa4b-f382-457e-8fcb-488cfede7886" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "eTag" : "0x8D93288C91D6509", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:12 GMT", + "eTag" : "0x8D9375C70795929", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:21 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "fc34c3f0-f01e-0001-1571-649c3e000000", - "x-ms-client-request-id" : "da7835f2-2cb0-40eb-9f13-0e808de4b12f", - "Date" : "Fri, 18 Jun 2021 18:42:11 GMT" + "x-ms-request-id" : "8dd6dbdf-401e-0021-1f45-69bb8d000000", + "x-ms-client-request-id" : "38ccfa4b-f382-457e-8fcb-488cfede7886", + "Date" : "Thu, 24 Jun 2021 22:07:20 GMT" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1311e8e8c13d1e86956ffcc18240e2b4ad1b61/1e8e8c1321e8e8c13d1e55651a3205039d57541cc88c", + "Uri" : "https://REDACTED.blob.core.windows.net/1e8e8c1311e8e8c134c1025670c7fcee3e5fd4a51807/1e8e8c1321e8e8c134c169613ee066555b8ed4e12bb0", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "b96decb4-acca-4a6c-ada0-f82fe8090be7", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "5b028f24-a557-4591-a57c-deca6a9d878b", "Content-Type" : "application/octet-stream" }, "Response" : { @@ -34,18 +34,18 @@ "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-content-crc64" : "AAAAAAAAAAA=", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:15 GMT", - "x-ms-version-id" : "2021-06-18T18:42:15.2590905Z", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:23 GMT", + "x-ms-version-id" : "2021-06-24T22:07:23.7038470Z", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 18 Jun 2021 18:42:15 GMT", + "Date" : "Thu, 24 Jun 2021 22:07:22 GMT", "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", - "eTag" : "0x8D93288CB03A639", - "x-ms-request-id" : "fc34c401-f01e-0001-2271-649c3e000000", - "x-ms-client-request-id" : "b96decb4-acca-4a6c-ada0-f82fe8090be7" + "eTag" : "0x8D9375C71E5C586", + "x-ms-request-id" : "8dd6dbf3-401e-0021-2c45-69bb8d000000", + "x-ms-client-request-id" : "5b028f24-a557-4591-a57c-deca6a9d878b" }, "Exception" : null } ], - "variables" : [ "1e8e8c1301e8e8c13d1e4448478653498e9004a219f2", "1e8e8c1311e8e8c13d1e86956ffcc18240e2b4ad1b61", "1e8e8c1321e8e8c13d1e55651a3205039d57541cc88c", "2021-06-18T18:42:16.251301Z" ] + "variables" : [ "1e8e8c1301e8e8c134c16197853efefaa66994939a49", "1e8e8c1311e8e8c134c1025670c7fcee3e5fd4a51807", "1e8e8c1321e8e8c134c169613ee066555b8ed4e12bb0", "2021-06-24T22:07:24.781735500Z" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json index 08ba8e7080c0..98798e0b6046 100644 --- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[1].json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5200795bd5264a871964e42487c620d4113860?restype=container", + "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5200795bd52d4e792326e09af9e30304f7c95d?restype=container", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "57037666-1f95-4d07-9930-802b4c50fce4" + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "fc52422a-ff7c-4fc6-b325-b5fec7607ace" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "eTag" : "0x8D93288CC0E4AE6", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:17 GMT", + "eTag" : "0x8D9375C72E47FA9", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:25 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "fc34c419-f01e-0001-3671-649c3e000000", - "x-ms-client-request-id" : "57037666-1f95-4d07-9930-802b4c50fce4", - "Date" : "Fri, 18 Jun 2021 18:42:16 GMT" + "x-ms-request-id" : "8dd6dbfb-401e-0021-3245-69bb8d000000", + "x-ms-client-request-id" : "fc52422a-ff7c-4fc6-b325-b5fec7607ace", + "Date" : "Thu, 24 Jun 2021 22:07:25 GMT" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5210795bd5264a783820c02b3169fc34074a83/0795bd5220795bd5264a93710522f48ec6a7f418d8e3", + "Uri" : "https://REDACTED.blob.core.windows.net/0795bd5210795bd52d4e888129f3fcdcd93de47a491b/0795bd5220795bd52d4e26102b804dc34efd24decb63", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "f6693c7e-5d3d-4091-9256-e17a00c03888", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "cb80a63c-6649-4bd0-981d-399bab45a4b1", "Content-Type" : "application/octet-stream" }, "Response" : { @@ -34,18 +34,18 @@ "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-content-crc64" : "AAAAAAAAAAA=", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:19 GMT", - "x-ms-version-id" : "2021-06-18T18:42:19.0179529Z", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:26 GMT", + "x-ms-version-id" : "2021-06-24T22:07:26.2584157Z", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 18 Jun 2021 18:42:18 GMT", + "Date" : "Thu, 24 Jun 2021 22:07:26 GMT", "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", - "eTag" : "0x8D93288CD4134C9", - "x-ms-request-id" : "fc34c428-f01e-0001-4271-649c3e000000", - "x-ms-client-request-id" : "f6693c7e-5d3d-4091-9256-e17a00c03888" + "eTag" : "0x8D9375C736B915D", + "x-ms-request-id" : "8dd6dc13-401e-0021-4945-69bb8d000000", + "x-ms-client-request-id" : "cb80a63c-6649-4bd0-981d-399bab45a4b1" }, "Exception" : null } ], - "variables" : [ "0795bd5200795bd5264a871964e42487c620d4113860", "0795bd5210795bd5264a783820c02b3169fc34074a83", "0795bd5220795bd5264a93710522f48ec6a7f418d8e3", "2021-06-18T18:42:19.976318300Z" ] + "variables" : [ "0795bd5200795bd52d4e792326e09af9e30304f7c95d", "0795bd5210795bd52d4e888129f3fcdcd93de47a491b", "0795bd5220795bd52d4e26102b804dc34efd24decb63", "2021-06-24T22:07:27.286533500Z" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json index 155f44569994..92c3913250f7 100644 --- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[2].json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9102cb8ee9164102835a79ea298db1a4894aae?restype=container", + "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9102cb8ee91bed53610a276f01a41e6434fbaf?restype=container", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "fd680b20-cd02-4150-b4c3-ce35d27c7128" + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "a97b4482-eaa0-4192-935e-04784020b9db" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "eTag" : "0x8D93288CE06EB2B", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:20 GMT", + "eTag" : "0x8D9375C742868B0", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:27 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "fc34c440-f01e-0001-5171-649c3e000000", - "x-ms-client-request-id" : "fd680b20-cd02-4150-b4c3-ce35d27c7128", - "Date" : "Fri, 18 Jun 2021 18:42:20 GMT" + "x-ms-request-id" : "8dd6dc24-401e-0021-5145-69bb8d000000", + "x-ms-client-request-id" : "a97b4482-eaa0-4192-935e-04784020b9db", + "Date" : "Thu, 24 Jun 2021 22:07:27 GMT" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9112cb8ee9164137518b52f87282b0941deb76/2cb8ee9122cb8ee9164196392ec1ff16ca250421c830", + "Uri" : "https://REDACTED.blob.core.windows.net/2cb8ee9112cb8ee91bed95455fd549f78bd484e758ba/2cb8ee9122cb8ee91bed6881738c6ee0a45de4f189db", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "8a2d1417-399a-449b-91d6-9b63894ecbbc", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "584e7f51-6006-4a36-96cc-a030bae20c6d", "Content-Type" : "application/octet-stream" }, "Response" : { @@ -34,18 +34,18 @@ "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-content-crc64" : "AAAAAAAAAAA=", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:21 GMT", - "x-ms-version-id" : "2021-06-18T18:42:21.4295815Z", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:28 GMT", + "x-ms-version-id" : "2021-06-24T22:07:28.4831467Z", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 18 Jun 2021 18:42:21 GMT", + "Date" : "Thu, 24 Jun 2021 22:07:28 GMT", "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", - "eTag" : "0x8D93288CEB13107", - "x-ms-request-id" : "fc34c44e-f01e-0001-5a71-649c3e000000", - "x-ms-client-request-id" : "8a2d1417-399a-449b-91d6-9b63894ecbbc" + "eTag" : "0x8D9375C74BF08EB", + "x-ms-request-id" : "8dd6dc29-401e-0021-5345-69bb8d000000", + "x-ms-client-request-id" : "584e7f51-6006-4a36-96cc-a030bae20c6d" }, "Exception" : null } ], - "variables" : [ "2cb8ee9102cb8ee9164102835a79ea298db1a4894aae", "2cb8ee9112cb8ee9164137518b52f87282b0941deb76", "2cb8ee9122cb8ee9164196392ec1ff16ca250421c830", "2021-06-18T18:42:22.389302800Z" ] + "variables" : [ "2cb8ee9102cb8ee91bed53610a276f01a41e6434fbaf", "2cb8ee9112cb8ee91bed95455fd549f78bd484e758ba", "2cb8ee9122cb8ee91bed6881738c6ee0a45de4f189db", "2021-06-24T22:07:29.508245100Z" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json index 43467d72fb00..3dc504276025 100644 --- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[3].json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0035a3dfd06a9905570e076781bcfc459ab19?restype=container", + "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0035a3dfd033b53204d0e611e553184cd8a78?restype=container", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "5e16c32a-29b4-47b4-908f-218e8bca0407" + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "a977327c-9588-451b-bb4a-8f6832dc9a4f" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "eTag" : "0x8D93288CF773572", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:22 GMT", + "eTag" : "0x8D9375C757C2DD9", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:29 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "fc34c459-f01e-0001-6471-649c3e000000", - "x-ms-client-request-id" : "5e16c32a-29b4-47b4-908f-218e8bca0407", - "Date" : "Fri, 18 Jun 2021 18:42:22 GMT" + "x-ms-request-id" : "8dd6dc34-401e-0021-5b45-69bb8d000000", + "x-ms-client-request-id" : "a977327c-9588-451b-bb4a-8f6832dc9a4f", + "Date" : "Thu, 24 Jun 2021 22:07:29 GMT" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0135a3dfd06a986521d0138992e11d49bda42/35a3dfd0235a3dfd06a92931554d601c5752c41d4a1d", + "Uri" : "https://REDACTED.blob.core.windows.net/35a3dfd0135a3dfd033b232093d3b71ef67094ee5ad0/35a3dfd0235a3dfd033b14004c56ac713329f46fc9d0", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "d21b6c89-5215-416f-8aeb-1c91a5e2e8ec", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "a2e395e0-a0e0-456e-a0ea-9b67c5e6d970", "Content-Type" : "application/octet-stream" }, "Response" : { @@ -34,18 +34,18 @@ "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-content-crc64" : "AAAAAAAAAAA=", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:23 GMT", - "x-ms-version-id" : "2021-06-18T18:42:23.7032885Z", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:30 GMT", + "x-ms-version-id" : "2021-06-24T22:07:30.6369177Z", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 18 Jun 2021 18:42:23 GMT", + "Date" : "Thu, 24 Jun 2021 22:07:30 GMT", "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", - "eTag" : "0x8D93288D00C21B5", - "x-ms-request-id" : "fc34c460-f01e-0001-6971-649c3e000000", - "x-ms-client-request-id" : "d21b6c89-5215-416f-8aeb-1c91a5e2e8ec" + "eTag" : "0x8D9375C7607AC99", + "x-ms-request-id" : "8dd6dc3c-401e-0021-6045-69bb8d000000", + "x-ms-client-request-id" : "a2e395e0-a0e0-456e-a0ea-9b67c5e6d970" }, "Exception" : null } ], - "variables" : [ "35a3dfd0035a3dfd06a9905570e076781bcfc459ab19", "35a3dfd0135a3dfd06a986521d0138992e11d49bda42", "35a3dfd0235a3dfd06a92931554d601c5752c41d4a1d", "2021-06-18T18:42:24.657302800Z" ] + "variables" : [ "35a3dfd0035a3dfd033b53204d0e611e553184cd8a78", "35a3dfd0135a3dfd033b232093d3b71ef67094ee5ad0", "35a3dfd0235a3dfd033b14004c56ac713329f46fc9d0", "2021-06-24T22:07:31.665230900Z" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json index 8ec72aeea119..00f79d9d9845 100644 --- a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[4].json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491707ae24917e0e112126fda4915ca294f5e942?restype=container", + "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491707ae24917bc139710404c7d1fb8c2473abc8?restype=container", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "dd31cb6e-af83-4c93-9e7d-decd45935e0a" + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "9c39856e-8716-4122-8829-66b4c499c20b" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "eTag" : "0x8D93288D0CC3382", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:24 GMT", + "eTag" : "0x8D9375C76C40DF0", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:31 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "fc34c46e-f01e-0001-7571-649c3e000000", - "x-ms-client-request-id" : "dd31cb6e-af83-4c93-9e7d-decd45935e0a", - "Date" : "Fri, 18 Jun 2021 18:42:24 GMT" + "x-ms-request-id" : "8dd6dc65-401e-0021-0845-69bb8d000000", + "x-ms-client-request-id" : "9c39856e-8716-4122-8829-66b4c499c20b", + "Date" : "Thu, 24 Jun 2021 22:07:31 GMT" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491717ae24917e0e668618a86a9b9006a4da9913/7ae2491727ae24917e0e80803ccac87d6b83647ba9ba", + "Uri" : "https://REDACTED.blob.core.windows.net/7ae2491717ae24917bc16015238f8507a85c448918ed/7ae2491727ae24917bc114276ed054fb924ef4572986", "Headers" : { "x-ms-version" : "2020-10-02", - "User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "0b92404f-d4d0-44db-8aed-950801357fcb", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "1f8645e3-8197-48cb-b97f-eb75014a9c04", "Content-Type" : "application/octet-stream" }, "Response" : { @@ -34,18 +34,18 @@ "x-ms-version" : "2020-10-02", "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", "x-ms-content-crc64" : "AAAAAAAAAAA=", - "Last-Modified" : "Fri, 18 Jun 2021 18:42:25 GMT", - "x-ms-version-id" : "2021-06-18T18:42:25.9120332Z", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:32 GMT", + "x-ms-version-id" : "2021-06-24T22:07:32.7687022Z", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 18 Jun 2021 18:42:25 GMT", + "Date" : "Thu, 24 Jun 2021 22:07:32 GMT", "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", - "eTag" : "0x8D93288D15D28CC", - "x-ms-request-id" : "fc34c47b-f01e-0001-7e71-649c3e000000", - "x-ms-client-request-id" : "0b92404f-d4d0-44db-8aed-950801357fcb" + "eTag" : "0x8D9375C774CF56E", + "x-ms-request-id" : "8dd6dc81-401e-0021-2245-69bb8d000000", + "x-ms-client-request-id" : "1f8645e3-8197-48cb-b97f-eb75014a9c04" }, "Exception" : null } ], - "variables" : [ "7ae2491707ae24917e0e112126fda4915ca294f5e942", "7ae2491717ae24917e0e668618a86a9b9006a4da9913", "7ae2491727ae24917e0e80803ccac87d6b83647ba9ba", "2021-06-18T18:42:26.864331800Z" ] + "variables" : [ "7ae2491707ae24917bc139710404c7d1fb8c2473abc8", "7ae2491717ae24917bc16015238f8507a85c448918ed", "7ae2491727ae24917bc114276ed054fb924ef4572986", "2021-06-24T22:07:33.800377300Z" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[5].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[5].json new file mode 100644 index 000000000000..a3145ffc2e3a --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ImmutableStorageWithVersioningTestSetImmutabilityPolicyACIA[5].json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/63f97856063f9785675201919191943a0db6445efa3b?restype=container", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "4ce5649b-a9e1-4ff6-9247-fd7760bfb4bb" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9375C780C8A27", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:34 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8dd6dca7-401e-0021-4545-69bb8d000000", + "x-ms-client-request-id" : "4ce5649b-a9e1-4ff6-9247-fd7760bfb4bb", + "Date" : "Thu, 24 Jun 2021 22:07:33 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/63f97856163f97856752185088d4212eae2554c17baa/63f97856263f9785675232751a74abf37528f46c4941", + "Headers" : { + "x-ms-version" : "2020-10-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "24643ba0-70fe-4dcc-bd6b-c78101474077", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "AAAAAAAAAAA=", + "Last-Modified" : "Thu, 24 Jun 2021 22:07:34 GMT", + "x-ms-version-id" : "2021-06-24T22:07:34.9214742Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Thu, 24 Jun 2021 22:07:34 GMT", + "Content-MD5" : "1B2M2Y8AsgTpgAmY7PhCfg==", + "eTag" : "0x8D9375C78957216", + "x-ms-request-id" : "8dd6dcb9-401e-0021-5645-69bb8d000000", + "x-ms-client-request-id" : "24643ba0-70fe-4dcc-bd6b-c78101474077" + }, + "Exception" : null + } ], + "variables" : [ "63f97856063f9785675201919191943a0db6445efa3b", "63f97856163f97856752185088d4212eae2554c17baa", "63f97856263f9785675232751a74abf37528f46c4941", "2021-06-24T22:07:35.943525100Z" ] +} \ No newline at end of file