From a1de91d9e57da8fb1bc3589d785189fc01c0e8b8 Mon Sep 17 00:00:00 2001 From: gapra Date: Tue, 1 Jun 2021 11:51:58 -0700 Subject: [PATCH 1/3] Implemented list deleted root blob with versions --- sdk/storage/azure-storage-blob/CHANGELOG.md | 1 + .../models/BlobItemInternal.java | 26 ++++ .../ContainersGetPropertiesHeaders.java | 55 ++++----- .../blob/implementation/util/ModelHelper.java | 2 + .../models/BlobContainerItemProperties.java | 23 ++-- .../azure/storage/blob/models/BlobItem.java | 26 ++++ .../storage/blob/models/BlobListDetails.java | 24 ++++ .../blob/models/ListBlobsIncludeItem.java | 5 +- .../storage/blob/ContainerAPITest.groovy | 46 +++++++ ...stBlobsFlatOptionsDeletedWithVersions.json | 112 ++++++++++++++++++ ...stBlobsHierOptionsDeletedWithVersions.json | 112 ++++++++++++++++++ .../azure-storage-blob/swagger/README.md | 2 +- 12 files changed, 390 insertions(+), 44 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsFlatOptionsDeletedWithVersions.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsHierOptionsDeletedWithVersions.json diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 4b4fb4ecbecd..cad5ab378fb2 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -2,6 +2,7 @@ ## 12.12.0-beta.2 (Unreleased) - Added support for the 2020-10-02 service version. +- Added support to list blobs deleted with versioning enabled. ## 12.12.0-beta.1 (2021-05-13) - Added support for the 2020-08-04 service version. 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 3aeb32ebad74..223e34a14e65 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 @@ -67,6 +67,12 @@ public final class BlobItemInternal { @JsonProperty(value = "OrMetadata") private Map objectReplicationMetadata; + /* + * The HasVersionsOnly property. + */ + @JsonProperty(value = "HasVersionsOnly") + private Boolean hasVersionsOnly; + /* * The IsPrefix property. */ @@ -253,6 +259,26 @@ public BlobItemInternal setObjectReplicationMetadata(Map objectR return this; } + /** + * Get the hasVersionsOnly property: The HasVersionsOnly property. + * + * @return the hasVersionsOnly value. + */ + public Boolean isHasVersionsOnly() { + return this.hasVersionsOnly; + } + + /** + * Set the hasVersionsOnly property: The HasVersionsOnly property. + * + * @param hasVersionsOnly the hasVersionsOnly value to set. + * @return the BlobItemInternal object itself. + */ + public BlobItemInternal setHasVersionsOnly(Boolean hasVersionsOnly) { + this.hasVersionsOnly = hasVersionsOnly; + return this; + } + /** * Get the isPrefix property: The IsPrefix property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java index 53e1398f6958..c38fcc2a5af0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java @@ -32,12 +32,6 @@ public final class ContainersGetPropertiesHeaders { @JsonProperty(value = "x-ms-version") private String xMsVersion; - /* - * The x-ms-immutable-storage-with-versioning-enabled property. - */ - @JsonProperty(value = "x-ms-immutable-storage-with-versioning-enabled") - private Boolean xMsImmutableStorageWithVersioningEnabled; - /* * The x-ms-lease-state property. */ @@ -92,6 +86,12 @@ public final class ContainersGetPropertiesHeaders { @JsonProperty(value = "x-ms-has-immutability-policy") private Boolean xMsHasImmutabilityPolicy; + /* + * The x-ms-version-level-worm-enabled property. + */ + @JsonProperty(value = "x-ms-version-level-worm-enabled") + private Boolean xMsVersionLevelWormEnabled; + /* * The x-ms-lease-duration property. */ @@ -156,29 +156,6 @@ public ContainersGetPropertiesHeaders setXMsVersion(String xMsVersion) { return this; } - /** - * Get the xMsImmutableStorageWithVersioningEnabled property: The x-ms-immutable-storage-with-versioning-enabled - * property. - * - * @return the xMsImmutableStorageWithVersioningEnabled value. - */ - public Boolean isXMsImmutableStorageWithVersioningEnabled() { - return this.xMsImmutableStorageWithVersioningEnabled; - } - - /** - * Set the xMsImmutableStorageWithVersioningEnabled property: The x-ms-immutable-storage-with-versioning-enabled - * property. - * - * @param xMsImmutableStorageWithVersioningEnabled the xMsImmutableStorageWithVersioningEnabled value to set. - * @return the ContainersGetPropertiesHeaders object itself. - */ - public ContainersGetPropertiesHeaders setXMsImmutableStorageWithVersioningEnabled( - Boolean xMsImmutableStorageWithVersioningEnabled) { - this.xMsImmutableStorageWithVersioningEnabled = xMsImmutableStorageWithVersioningEnabled; - return this; - } - /** * Get the xMsLeaseState property: The x-ms-lease-state property. * @@ -373,6 +350,26 @@ public ContainersGetPropertiesHeaders setXMsHasImmutabilityPolicy(Boolean xMsHas return this; } + /** + * Get the xMsVersionLevelWormEnabled property: The x-ms-version-level-worm-enabled property. + * + * @return the xMsVersionLevelWormEnabled value. + */ + public Boolean isXMsVersionLevelWormEnabled() { + return this.xMsVersionLevelWormEnabled; + } + + /** + * Set the xMsVersionLevelWormEnabled property: The x-ms-version-level-worm-enabled property. + * + * @param xMsVersionLevelWormEnabled the xMsVersionLevelWormEnabled value to set. + * @return the ContainersGetPropertiesHeaders object itself. + */ + public ContainersGetPropertiesHeaders setXMsVersionLevelWormEnabled(Boolean xMsVersionLevelWormEnabled) { + this.xMsVersionLevelWormEnabled = xMsVersionLevelWormEnabled; + return this; + } + /** * Get the xMsLeaseDuration property: The x-ms-lease-duration property. * 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 7d1e0f31de4b..dd939eb1fe75 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 @@ -265,6 +265,8 @@ public static BlobItem populateBlobItem(BlobItemInternal blobItemInternal) { blobItem.setObjectReplicationSourcePolicies( transformObjectReplicationMetadata(blobItemInternal.getObjectReplicationMetadata())); + blobItem.setHasVersionsOnly(blobItemInternal.isHasVersionsOnly()); + return blobItem; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java index 8ee9941b2f2d..c99df1d52fc5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java @@ -89,8 +89,8 @@ public final class BlobContainerItemProperties { /* * Indicates if version level worm is enabled on this container. */ - @JsonProperty(value = "ImmutableStorageWithVersioningEnabled") - private Boolean isImmutableStorageWithVersioningEnabled; + @JsonProperty(value = "VersionLevelWormEnabled") + private Boolean isVersionLevelWormEnabled; /** * Get the lastModified property: The Last-Modified property. @@ -348,25 +348,22 @@ public BlobContainerItemProperties setRemainingRetentionDays(Integer remainingRe } /** - * Get the isImmutableStorageWithVersioningEnabled property: Indicates if version level worm is enabled on this - * container. + * Get the isVersionLevelWormEnabled property: Indicates if version level worm is enabled on this container. * - * @return the isImmutableStorageWithVersioningEnabled value. + * @return the isVersionLevelWormEnabled value. */ - public Boolean isImmutableStorageWithVersioningEnabled() { - return this.isImmutableStorageWithVersioningEnabled; + public Boolean isVersionLevelWormEnabled() { + return this.isVersionLevelWormEnabled; } /** - * Set the isImmutableStorageWithVersioningEnabled property: Indicates if version level worm is enabled on this - * container. + * Set the isVersionLevelWormEnabled property: Indicates if version level worm is enabled on this container. * - * @param isImmutableStorageWithVersioningEnabled the isImmutableStorageWithVersioningEnabled value to set. + * @param isVersionLevelWormEnabled the isVersionLevelWormEnabled value to set. * @return the BlobContainerItemProperties object itself. */ - public BlobContainerItemProperties setIsImmutableStorageWithVersioningEnabled( - Boolean isImmutableStorageWithVersioningEnabled) { - this.isImmutableStorageWithVersioningEnabled = isImmutableStorageWithVersioningEnabled; + public BlobContainerItemProperties setIsVersionLevelWormEnabled(Boolean isVersionLevelWormEnabled) { + this.isVersionLevelWormEnabled = isVersionLevelWormEnabled; 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 8d7f452f3738..c3b02028d4c1 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 @@ -70,6 +70,12 @@ public final class BlobItem { @JsonProperty(value = "IsPrefix") private Boolean isPrefix; + /* + * The HasVersionsOnly property. + */ + @JsonProperty(value = "HasVersionsOnly") + private Boolean hasVersionsOnly; + /** * Get the name property: The name property. * @@ -253,6 +259,26 @@ public BlobItem setObjectReplicationSourcePolicies(List return this; } + /** + * Get the hasVersionsOnly property: The HasVersionsOnly property. + * + * @return the hasVersionsOnly value. + */ + public Boolean hasVersionsOnly() { + return this.hasVersionsOnly; + } + + /** + * Set the hasVersionsOnly property: The HasVersionsOnly property. + * + * @param hasVersionsOnly the hasVersionsOnly value to set. + * @return the BlobItemInternal object itself. + */ + public BlobItem setHasVersionsOnly(Boolean hasVersionsOnly) { + this.hasVersionsOnly = hasVersionsOnly; + return this; + } + /** * Get the isPrefix property: The isPrefix property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java index ba7e4ae38999..9ed444ec714c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java @@ -23,6 +23,7 @@ public final class BlobListDetails { private boolean retrieveUncommittedBlobs; private boolean retrieveDeletedBlobs; private boolean retrieveVersions; + private boolean retrieveDeletedWithVersions; /** * Constructs an unpopulated {@link BlobListDetails}. @@ -172,6 +173,26 @@ public BlobListDetails setRetrieveDeletedBlobs(boolean retrieveDeletedBlobs) { return this; } + /** + * Whether blobs which have been deleted with versioning. + * + * @return a flag indicating if deleted blobs with versioning will be returned in the listing + */ + public boolean getRetrieveDeletedBlobsWitVersions() { + return retrieveDeletedWithVersions; + } + + /** + * Whether blobs which have been deleted with versioning should be returned. + * + * @param retrieveDeletedWithVersions Flag indicating whether deleted blobs with versioning should be returned + * @return the updated BlobListDetails object + */ + public BlobListDetails setRetrieveDeletedBlobsWitVersions(boolean retrieveDeletedWithVersions) { + this.retrieveDeletedWithVersions = retrieveDeletedWithVersions; + return this; + } + /** * @return a list of the flag set to true */ @@ -198,6 +219,9 @@ public ArrayList toList() { if (this.retrieveVersions) { details.add(ListBlobsIncludeItem.VERSIONS); } + if (this.retrieveDeletedWithVersions) { + details.add(ListBlobsIncludeItem.DELETEDWITHVERSIONS); + } return details; } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java index ad4397648c4d..c6e027742245 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsIncludeItem.java @@ -34,7 +34,10 @@ public enum ListBlobsIncludeItem { IMMUTABILITYPOLICY("immutabilitypolicy"), /** Enum value legalhold. */ - LEGALHOLD("legalhold"); + LEGALHOLD("legalhold"), + + /** Enum value deletedwithversions. */ + DELETEDWITHVERSIONS("deletedwithversions"); /** The actual serialized value for a ListBlobsIncludeItem instance. */ private final String value; 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 ebdcddea4d7d..6934e736d2cf 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 @@ -921,6 +921,29 @@ class ContainerAPITest extends APISpec { .verifyComplete() } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") + def "list blobs flat options deleted with versions"() { + setup: + def blobName = generateBlobName() + def blob = cc.getBlobClient(blobName).getAppendBlobClient() + blob.create() + def metadata = new HashMap() + metadata.put("foo", "bar") + blob.setMetadata(metadata) + blob.delete() + def options = new ListBlobsOptions().setPrefix(blobName) + .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWitVersions(true)) + + when: + def blobs = cc.listBlobs(options, null).iterator() + + then: + def b = blobs.next() + !blobs.hasNext() + b.getName() == blobName + b.hasVersionsOnly() + } + def "List blobs prefix with comma"() { setup: def prefix = generateBlobName() + ", " + generateBlobName() @@ -1303,6 +1326,29 @@ class ContainerAPITest extends APISpec { } } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02") + def "list blobs hier options deleted with versions"() { + setup: + def blobName = generateBlobName() + def blob = cc.getBlobClient(blobName).getAppendBlobClient() + blob.create() + def metadata = new HashMap() + metadata.put("foo", "bar") + blob.setMetadata(metadata) + blob.delete() + def options = new ListBlobsOptions().setPrefix(blobName) + .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWitVersions(true)) + + when: + def blobs = cc.listBlobsByHierarchy("", options, null).iterator() + + then: + def b = blobs.next() + !blobs.hasNext() + b.getName() == blobName + b.hasVersionsOnly() + } + @Unroll def "List blobs hier options fail"() { when: diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsFlatOptionsDeletedWithVersions.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsFlatOptionsDeletedWithVersions.json new file mode 100644 index 000000000000..556128b6e9ad --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsFlatOptionsDeletedWithVersions.json @@ -0,0 +1,112 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d?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" : "230a2772-1c69-4408-9f21-2424e9a84d78" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E3D6FD9CB", + "Last-Modified" : "Tue, 01 Jun 2021 18:51:17 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6d10ded9-c01e-0014-6917-5792ad000000", + "x-ms-client-request-id" : "230a2772-1c69-4408-9f21-2424e9a84d78", + "Date" : "Tue, 01 Jun 2021 18:51:17 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8", + "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" : "4c66d24b-834b-4a3f-845f-996c3121ba78" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E3DB29E26", + "Last-Modified" : "Tue, 01 Jun 2021 18:51:18 GMT", + "x-ms-version-id" : "2021-06-01T18:51:18.3475238Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6d10dfab-c01e-0014-5c17-5792ad000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "4c66d24b-834b-4a3f-845f-996c3121ba78", + "Date" : "Tue, 01 Jun 2021 18:51:18 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8?comp=metadata", + "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" : "eb48934a-df4c-47bf-90c5-945199f73eb1" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E3DCCBA9B", + "Last-Modified" : "Tue, 01 Jun 2021 18:51:18 GMT", + "x-ms-version-id" : "2021-06-01T18:51:18.5196459Z", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "6d10dfdc-c01e-0014-7c17-5792ad000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "eb48934a-df4c-47bf-90c5-945199f73eb1", + "Date" : "Tue, 01 Jun 2021 18:51:18 GMT" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8", + "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" : "6d85a718-b07e-4d6e-ac99-3b622bdf53b3" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-delete-type-permanent" : "false", + "retry-after" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "6d10e00a-c01e-0014-1317-5792ad000000", + "x-ms-client-request-id" : "6d85a718-b07e-4d6e-ac99-3b622bdf53b3", + "Date" : "Tue, 01 Jun 2021 18:51:18 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d?restype=container&comp=list&prefix=8295186e18295186e767817414aac029851164b3b9b8&include=deletedwithversions", + "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" : "7bf450cd-e0d3-45a1-b672-6e34f25fa9d2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "6d10e03a-c01e-0014-2a17-5792ad000000", + "Body" : "8295186e18295186e767817414aac029851164b3b9b88295186e18295186e767817414aac029851164b3b9b8trueTue, 01 Jun 2021 18:51:18 GMTTue, 01 Jun 2021 18:51:18 GMT0x8D9252E3DCCBA9B0application/octet-streamAppendBlobunlockedavailabletrue", + "x-ms-client-request-id" : "7bf450cd-e0d3-45a1-b672-6e34f25fa9d2", + "Date" : "Tue, 01 Jun 2021 18:51:18 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "8295186e08295186e76780860dbc07e929472486d90d", "8295186e18295186e767817414aac029851164b3b9b8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsHierOptionsDeletedWithVersions.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsHierOptionsDeletedWithVersions.json new file mode 100644 index 000000000000..62ca418c4b0a --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/ContainerAPITestListBlobsHierOptionsDeletedWithVersions.json @@ -0,0 +1,112 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/bd465e190bd465e19dd42664791b7d0f52cdc4260b90?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" : "13f95fba-b06f-4ac1-8f87-41bbd13d6845" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E2EEF2C55", + "Last-Modified" : "Tue, 01 Jun 2021 18:50:53 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c1d30bd1-e01e-0013-0717-57fece000000", + "x-ms-client-request-id" : "13f95fba-b06f-4ac1-8f87-41bbd13d6845", + "Date" : "Tue, 01 Jun 2021 18:50:52 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/bd465e190bd465e19dd42664791b7d0f52cdc4260b90/bd465e191bd465e19dd460231e493f5fe94664b838a3", + "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" : "06615617-d81d-4083-9358-a120d707f7ef" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E2F317F9E", + "Last-Modified" : "Tue, 01 Jun 2021 18:50:54 GMT", + "x-ms-version-id" : "2021-06-01T18:50:54.0132254Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c1d30c55-e01e-0013-7217-57fece000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "06615617-d81d-4083-9358-a120d707f7ef", + "Date" : "Tue, 01 Jun 2021 18:50:53 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.blob.core.windows.net/bd465e190bd465e19dd42664791b7d0f52cdc4260b90/bd465e191bd465e19dd460231e493f5fe94664b838a3?comp=metadata", + "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" : "0638132e-5519-4644-96f2-fca545f7f3cf" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8D9252E2F4112D8", + "Last-Modified" : "Tue, 01 Jun 2021 18:50:54 GMT", + "x-ms-version-id" : "2021-06-01T18:50:54.1172991Z", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "c1d30c8d-e01e-0013-2417-57fece000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "0638132e-5519-4644-96f2-fca545f7f3cf", + "Date" : "Tue, 01 Jun 2021 18:50:53 GMT" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://REDACTED.blob.core.windows.net/bd465e190bd465e19dd42664791b7d0f52cdc4260b90/bd465e191bd465e19dd460231e493f5fe94664b838a3", + "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" : "e8931cba-3b55-40cd-ae18-2f6a0db7f608" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-delete-type-permanent" : "false", + "retry-after" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "c1d30cc2-e01e-0013-5417-57fece000000", + "x-ms-client-request-id" : "e8931cba-3b55-40cd-ae18-2f6a0db7f608", + "Date" : "Tue, 01 Jun 2021 18:50:53 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://REDACTED.blob.core.windows.net/bd465e190bd465e19dd42664791b7d0f52cdc4260b90?restype=container&comp=list&prefix=bd465e191bd465e19dd460231e493f5fe94664b838a3&delimiter=&include=deletedwithversions", + "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" : "d0616405-0176-47cd-9682-76988c45dfdc" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-10-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "c1d30cfd-e01e-0013-0217-57fece000000", + "Body" : "bd465e191bd465e19dd460231e493f5fe94664b838a3bd465e191bd465e19dd460231e493f5fe94664b838a3trueTue, 01 Jun 2021 18:50:54 GMTTue, 01 Jun 2021 18:50:54 GMT0x8D9252E2F4112D80application/octet-streamAppendBlobunlockedavailabletrue", + "x-ms-client-request-id" : "d0616405-0176-47cd-9682-76988c45dfdc", + "Date" : "Tue, 01 Jun 2021 18:50:53 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "bd465e190bd465e19dd42664791b7d0f52cdc4260b90", "bd465e191bd465e19dd460231e493f5fe94664b838a3" ] +} \ 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 2cfdc9d3b232..0e81396c19ec 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -16,7 +16,7 @@ autorest --java --use:@autorest/java@4.0.x ### 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/2020-10-02/blob.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a16ce6ff5dd8e57c4300b81dfa06021e13b942f5/specification/storage/data-plane/Microsoft.BlobStorage/preview/2020-10-02/blob.json java: true output-folder: ../ namespace: com.azure.storage.blob From 53b5d83c2c323c42a68ec9537bbad0c3b06f0950 Mon Sep 17 00:00:00 2001 From: gapra Date: Thu, 3 Jun 2021 14:07:13 -0700 Subject: [PATCH 2/3] Regenerated code --- .../blob/implementation/AppendBlobsImpl.java | 5 ++ .../blob/implementation/BlobsImpl.java | 5 ++ .../blob/implementation/BlockBlobsImpl.java | 10 ++++ .../blob/implementation/PageBlobsImpl.java | 5 ++ .../ContainersGetPropertiesHeaders.java | 55 ++++++++++--------- .../models/BlobContainerItemProperties.java | 23 ++++---- .../specialized/AppendBlobAsyncClient.java | 2 +- .../blob/specialized/BlobAsyncClientBase.java | 2 +- .../specialized/BlockBlobAsyncClient.java | 4 +- .../blob/specialized/PageBlobAsyncClient.java | 2 +- .../azure-storage-blob/swagger/README.md | 2 +- 11 files changed, 73 insertions(+), 42 deletions(-) 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 0f5b9bea4d58..c6c02f080f5e 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 @@ -162,6 +162,7 @@ Mono appendBlockFromUrl( @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); @@ -497,6 +498,8 @@ public Mono appendBlockWithResponseAsync( * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScope Parameter group. * @param context The context to associate with this operation. @@ -529,6 +532,7 @@ public Mono appendBlockFromUrlWithRespons String sourceIfMatch, String sourceIfNoneMatch, String requestId, + String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { @@ -595,6 +599,7 @@ public Mono appendBlockFromUrlWithRespons sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, 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 23133e3b561c..8278fa0eaaa4 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 @@ -561,6 +561,7 @@ Mono copyFromURL( @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry, @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode, @HeaderParam("x-ms-legal-hold") Boolean legalHold, + @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); @@ -2167,6 +2168,8 @@ public Mono startCopyFromURLWithResponseAsync( * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire. * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob. * @param legalHold Specified if a legal hold should be set on the blob. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws StorageErrorException thrown if the request is rejected by server. @@ -2197,6 +2200,7 @@ public Mono copyFromURLWithResponseAsync( OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, + String copySourceAuthorization, Context context) { final String xMsRequiresSync = "true"; final String accept = "application/xml"; @@ -2237,6 +2241,7 @@ public Mono copyFromURLWithResponseAsync( immutabilityPolicyExpiryConverted, immutabilityPolicyMode, legalHold, + copySourceAuthorization, accept, 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 9770b1489f9f..b573724af9a6 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 @@ -148,6 +148,7 @@ Mono putBlobFromUrl( @HeaderParam("x-ms-tags") String blobTagsString, @HeaderParam("x-ms-copy-source") URL copySource, @HeaderParam("x-ms-copy-source-blob-properties") Boolean copySourceBlobProperties, + @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); @@ -201,6 +202,7 @@ Mono stageBlockFromURL( @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); @@ -473,6 +475,8 @@ public Mono uploadWithResponseAsync( * @param blobTagsString Optional. Used to set blob tags in various blob operations. * @param copySourceBlobProperties Optional, default is true. Indicates if properties from the source blob should be * copied. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScope Parameter group. @@ -507,6 +511,7 @@ public Mono putBlobFromUrlWithResponseAsync( byte[] sourceContentMD5, String blobTagsString, Boolean copySourceBlobProperties, + String copySourceAuthorization, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScope, @@ -611,6 +616,7 @@ public Mono putBlobFromUrlWithResponseAsync( blobTagsString, copySource, copySourceBlobProperties, + copySourceAuthorization, accept, context); } @@ -729,6 +735,8 @@ public Mono stageBlockWithResponseAsync( * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScope Parameter group. * @param context The context to associate with this operation. @@ -754,6 +762,7 @@ public Mono stageBlockFromURLWithResponseAs String sourceIfMatch, String sourceIfNoneMatch, String requestId, + String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { @@ -808,6 +817,7 @@ public Mono stageBlockFromURLWithResponseAs sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, 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 88dd509959c1..c4af4b1b3dac 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 @@ -208,6 +208,7 @@ Mono uploadPagesFromURL( @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("Accept") String accept, Context context); @@ -757,6 +758,8 @@ public Mono clearPagesWithResponseAsync( * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to + * copy source. * @param cpkInfo Parameter group. * @param encryptionScope Parameter group. * @param context The context to associate with this operation. @@ -790,6 +793,7 @@ public Mono uploadPagesFromURLWithResponseA String sourceIfMatch, String sourceIfNoneMatch, String requestId, + String copySourceAuthorization, CpkInfo cpkInfo, EncryptionScope encryptionScope, Context context) { @@ -858,6 +862,7 @@ public Mono uploadPagesFromURLWithResponseA sourceIfNoneMatch, this.client.getVersion(), requestId, + copySourceAuthorization, accept, context); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java index c38fcc2a5af0..53e1398f6958 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetPropertiesHeaders.java @@ -32,6 +32,12 @@ public final class ContainersGetPropertiesHeaders { @JsonProperty(value = "x-ms-version") private String xMsVersion; + /* + * The x-ms-immutable-storage-with-versioning-enabled property. + */ + @JsonProperty(value = "x-ms-immutable-storage-with-versioning-enabled") + private Boolean xMsImmutableStorageWithVersioningEnabled; + /* * The x-ms-lease-state property. */ @@ -86,12 +92,6 @@ public final class ContainersGetPropertiesHeaders { @JsonProperty(value = "x-ms-has-immutability-policy") private Boolean xMsHasImmutabilityPolicy; - /* - * The x-ms-version-level-worm-enabled property. - */ - @JsonProperty(value = "x-ms-version-level-worm-enabled") - private Boolean xMsVersionLevelWormEnabled; - /* * The x-ms-lease-duration property. */ @@ -156,6 +156,29 @@ public ContainersGetPropertiesHeaders setXMsVersion(String xMsVersion) { return this; } + /** + * Get the xMsImmutableStorageWithVersioningEnabled property: The x-ms-immutable-storage-with-versioning-enabled + * property. + * + * @return the xMsImmutableStorageWithVersioningEnabled value. + */ + public Boolean isXMsImmutableStorageWithVersioningEnabled() { + return this.xMsImmutableStorageWithVersioningEnabled; + } + + /** + * Set the xMsImmutableStorageWithVersioningEnabled property: The x-ms-immutable-storage-with-versioning-enabled + * property. + * + * @param xMsImmutableStorageWithVersioningEnabled the xMsImmutableStorageWithVersioningEnabled value to set. + * @return the ContainersGetPropertiesHeaders object itself. + */ + public ContainersGetPropertiesHeaders setXMsImmutableStorageWithVersioningEnabled( + Boolean xMsImmutableStorageWithVersioningEnabled) { + this.xMsImmutableStorageWithVersioningEnabled = xMsImmutableStorageWithVersioningEnabled; + return this; + } + /** * Get the xMsLeaseState property: The x-ms-lease-state property. * @@ -350,26 +373,6 @@ public ContainersGetPropertiesHeaders setXMsHasImmutabilityPolicy(Boolean xMsHas return this; } - /** - * Get the xMsVersionLevelWormEnabled property: The x-ms-version-level-worm-enabled property. - * - * @return the xMsVersionLevelWormEnabled value. - */ - public Boolean isXMsVersionLevelWormEnabled() { - return this.xMsVersionLevelWormEnabled; - } - - /** - * Set the xMsVersionLevelWormEnabled property: The x-ms-version-level-worm-enabled property. - * - * @param xMsVersionLevelWormEnabled the xMsVersionLevelWormEnabled value to set. - * @return the ContainersGetPropertiesHeaders object itself. - */ - public ContainersGetPropertiesHeaders setXMsVersionLevelWormEnabled(Boolean xMsVersionLevelWormEnabled) { - this.xMsVersionLevelWormEnabled = xMsVersionLevelWormEnabled; - return this; - } - /** * Get the xMsLeaseDuration property: The x-ms-lease-duration property. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java index c99df1d52fc5..8ee9941b2f2d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobContainerItemProperties.java @@ -89,8 +89,8 @@ public final class BlobContainerItemProperties { /* * Indicates if version level worm is enabled on this container. */ - @JsonProperty(value = "VersionLevelWormEnabled") - private Boolean isVersionLevelWormEnabled; + @JsonProperty(value = "ImmutableStorageWithVersioningEnabled") + private Boolean isImmutableStorageWithVersioningEnabled; /** * Get the lastModified property: The Last-Modified property. @@ -348,22 +348,25 @@ public BlobContainerItemProperties setRemainingRetentionDays(Integer remainingRe } /** - * Get the isVersionLevelWormEnabled property: Indicates if version level worm is enabled on this container. + * Get the isImmutableStorageWithVersioningEnabled property: Indicates if version level worm is enabled on this + * container. * - * @return the isVersionLevelWormEnabled value. + * @return the isImmutableStorageWithVersioningEnabled value. */ - public Boolean isVersionLevelWormEnabled() { - return this.isVersionLevelWormEnabled; + public Boolean isImmutableStorageWithVersioningEnabled() { + return this.isImmutableStorageWithVersioningEnabled; } /** - * Set the isVersionLevelWormEnabled property: Indicates if version level worm is enabled on this container. + * Set the isImmutableStorageWithVersioningEnabled property: Indicates if version level worm is enabled on this + * container. * - * @param isVersionLevelWormEnabled the isVersionLevelWormEnabled value to set. + * @param isImmutableStorageWithVersioningEnabled the isImmutableStorageWithVersioningEnabled value to set. * @return the BlobContainerItemProperties object itself. */ - public BlobContainerItemProperties setIsVersionLevelWormEnabled(Boolean isVersionLevelWormEnabled) { - this.isVersionLevelWormEnabled = isVersionLevelWormEnabled; + public BlobContainerItemProperties setIsImmutableStorageWithVersioningEnabled( + Boolean isImmutableStorageWithVersioningEnabled) { + this.isImmutableStorageWithVersioningEnabled = isImmutableStorageWithVersioningEnabled; return this; } } 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 83a1ba8b4f7f..17ce58fbb9a9 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 @@ -369,7 +369,7 @@ Mono> appendBlockFromUrlWithResponse(String sourceUrl, destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), - sourceRequestConditions.getIfNoneMatch(), null, getCustomerProvidedKey(), encryptionScope, + sourceRequestConditions.getIfNoneMatch(), null, null, getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { AppendBlobsAppendBlockFromUrlHeaders 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 8a358e19ecb9..f8b6be7915d6 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 @@ -832,7 +832,7 @@ Mono> copyFromUrlWithResponse(BlobCopyFromUrlOptions options, C destRequestConditions.getIfUnmodifiedSince(), destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), destRequestConditions.getLeaseId(), null, null, - tagsToString(options.getTags()), null, null, null, context) + tagsToString(options.getTags()), null, null, null, null, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyId())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java index 25dd01dc286e..8a77e35c2953 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 @@ -387,7 +387,7 @@ Mono> uploadFromUrlWithResponse(BlobUploadFromUrlOptions sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), - options.isCopySourceBlobProperties(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, + options.isCopySourceBlobProperties(), null, options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders(); @@ -554,7 +554,7 @@ Mono> stageBlockFromUrlWithResponse(String base64BlockId, String return this.azureBlobStorage.getBlockBlobs().stageBlockFromURLWithResponseAsync(containerName, blobName, base64BlockId, 0, url, sourceRange.toHeaderValue(), sourceContentMd5, null, null, leaseId, sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), - sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, + sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), null, null, getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response, null)); 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 013f067bd9e7..8f748b12e37d 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 @@ -470,7 +470,7 @@ Mono> uploadPagesFromUrlWithResponse(PageRange range, Str destRequestConditions.getIfMatch(), destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), - sourceRequestConditions.getIfNoneMatch(), null, getCustomerProvidedKey(), encryptionScope, + sourceRequestConditions.getIfNoneMatch(), null, null, getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { PageBlobsUploadPagesFromURLHeaders hd = rb.getDeserializedHeaders(); diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 0e81396c19ec..2cfdc9d3b232 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -16,7 +16,7 @@ autorest --java --use:@autorest/java@4.0.x ### Code generation settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a16ce6ff5dd8e57c4300b81dfa06021e13b942f5/specification/storage/data-plane/Microsoft.BlobStorage/preview/2020-10-02/blob.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.BlobStorage/preview/2020-10-02/blob.json java: true output-folder: ../ namespace: com.azure.storage.blob From c7e0630589c2fb1b99825be897f500843811e92f Mon Sep 17 00:00:00 2001 From: gapra Date: Fri, 11 Jun 2021 13:48:43 -0700 Subject: [PATCH 3/3] Fix typo --- .../azure/storage/blob/models/BlobListDetails.java | 4 ++-- .../com/azure/storage/blob/ContainerAPITest.groovy | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java index 9ed444ec714c..0859cc0678a3 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java @@ -178,7 +178,7 @@ public BlobListDetails setRetrieveDeletedBlobs(boolean retrieveDeletedBlobs) { * * @return a flag indicating if deleted blobs with versioning will be returned in the listing */ - public boolean getRetrieveDeletedBlobsWitVersions() { + public boolean getRetrieveDeletedBlobsWithVersions() { return retrieveDeletedWithVersions; } @@ -188,7 +188,7 @@ public boolean getRetrieveDeletedBlobsWitVersions() { * @param retrieveDeletedWithVersions Flag indicating whether deleted blobs with versioning should be returned * @return the updated BlobListDetails object */ - public BlobListDetails setRetrieveDeletedBlobsWitVersions(boolean retrieveDeletedWithVersions) { + public BlobListDetails setRetrieveDeletedBlobsWithVersions(boolean retrieveDeletedWithVersions) { this.retrieveDeletedWithVersions = retrieveDeletedWithVersions; return this; } 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 6934e736d2cf..bd09796bc6c3 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 @@ -3,15 +3,13 @@ package com.azure.storage.blob -import com.azure.core.http.rest.PagedIterable -import com.azure.core.http.rest.PagedResponse + import com.azure.core.http.rest.Response import com.azure.identity.DefaultAzureCredentialBuilder import com.azure.storage.blob.models.AccessTier import com.azure.storage.blob.models.AppendBlobItem import com.azure.storage.blob.models.BlobAccessPolicy import com.azure.storage.blob.models.BlobErrorCode -import com.azure.storage.blob.models.BlobItem import com.azure.storage.blob.models.BlobListDetails import com.azure.storage.blob.models.BlobProperties import com.azure.storage.blob.models.BlobRequestConditions @@ -31,14 +29,10 @@ import com.azure.storage.blob.options.BlobSetAccessTierOptions import com.azure.storage.blob.options.PageBlobCreateOptions import com.azure.storage.blob.specialized.AppendBlobClient import com.azure.storage.blob.specialized.BlobClientBase -import com.azure.storage.common.StorageSharedKeyCredential import com.azure.storage.common.Utility -import com.azure.storage.common.implementation.StorageImplUtils import com.azure.storage.common.test.shared.extensions.PlaybackOnly import com.azure.storage.common.test.shared.extensions.RequiredServiceVersion import reactor.test.StepVerifier -import spock.lang.Requires -import spock.lang.ResourceLock import spock.lang.Unroll import java.time.Duration @@ -932,7 +926,7 @@ class ContainerAPITest extends APISpec { blob.setMetadata(metadata) blob.delete() def options = new ListBlobsOptions().setPrefix(blobName) - .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWitVersions(true)) + .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWithVersions(true)) when: def blobs = cc.listBlobs(options, null).iterator() @@ -1337,7 +1331,7 @@ class ContainerAPITest extends APISpec { blob.setMetadata(metadata) blob.delete() def options = new ListBlobsOptions().setPrefix(blobName) - .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWitVersions(true)) + .setDetails(new BlobListDetails().setRetrieveDeletedBlobsWithVersions(true)) when: def blobs = cc.listBlobsByHierarchy("", options, null).iterator()