diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java index 95eccfcca197..fa28f6e26d0e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageBuilder.java @@ -67,9 +67,6 @@ public AzureBlobStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureBlobStorageImpl. */ public AzureBlobStorageImpl build() { - if (version == null) { - this.version = "2018-11-09"; - } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } @@ -79,6 +76,8 @@ public AzureBlobStorageImpl build() { } if (this.version != null) { client.setVersion(this.version); + } else { + client.setVersion("2018-11-09"); } return client; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java index 598e19f68192..efb3b64cdf8b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java @@ -108,7 +108,7 @@ private interface ContainersService { @Put("{containerName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(StorageErrorException.class) - Mono setAccessPolicy(@PathParam("containerName") String containerName, @HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifierWrapper containerAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); + Mono setAccessPolicy(@PathParam("containerName") String containerName, @HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifiersWrapper containerAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-blob-public-access") PublicAccessType access, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Put("{containerName}") @ExpectedResponses({201}) @@ -381,7 +381,7 @@ public Mono setAccessPolicyWithRestResponseAs final String restype = "container"; final String comp = "acl"; final String leaseId = null; - SignedIdentifierWrapper containerAclConverted = new SignedIdentifierWrapper(null); + SignedIdentifiersWrapper containerAclConverted = new SignedIdentifiersWrapper(null); DateTimeRfc1123 ifModifiedSinceConverted = null; DateTimeRfc1123 ifUnmodifiedSinceConverted = null; return service.setAccessPolicy(containerName, this.client.getUrl(), containerAclConverted, timeout, access, this.client.getVersion(), requestId, restype, comp, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, context); @@ -417,7 +417,7 @@ public Mono setAccessPolicyWithRestResponseAs if (modifiedAccessConditions != null) { ifUnmodifiedSince = modifiedAccessConditions.ifUnmodifiedSince(); } - SignedIdentifierWrapper containerAclConverted = new SignedIdentifierWrapper(containerAcl); + SignedIdentifiersWrapper containerAclConverted = new SignedIdentifiersWrapper(containerAcl); DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.setAccessPolicy(containerName, this.client.getUrl(), containerAclConverted, timeout, access, this.client.getVersion(), requestId, restype, comp, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, context); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifierWrapper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifiersWrapper.java similarity index 71% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifierWrapper.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifiersWrapper.java index 69a4eb5ed6c5..34509edfc9cf 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifierWrapper.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/SignedIdentifiersWrapper.java @@ -15,18 +15,18 @@ * A wrapper around List<SignedIdentifier> which provides top-level metadata for serialization. */ @JacksonXmlRootElement(localName = "SignedIdentifiers") -public final class SignedIdentifierWrapper { +public final class SignedIdentifiersWrapper { @JacksonXmlProperty(localName = "SignedIdentifier") - private final List signedIdentifier; + private final List signedIdentifiers; /** - * Creates an instance of SignedIdentifierWrapper. + * Creates an instance of SignedIdentifiersWrapper. * - * @param signedIdentifier the list. + * @param signedIdentifiers the list. */ @JsonCreator - public SignedIdentifierWrapper(@JsonProperty("SignedIdentifier") List signedIdentifier) { - this.signedIdentifier = signedIdentifier; + public SignedIdentifiersWrapper(@JsonProperty("SignedIdentifier") List signedIdentifiers) { + this.signedIdentifiers = signedIdentifiers; } /** @@ -35,6 +35,6 @@ public SignedIdentifierWrapper(@JsonProperty("SignedIdentifier") List items() { - return signedIdentifier; + return signedIdentifiers; } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobHierarchyListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobHierarchyListSegment.java index d90e89ab602f..e1634cce1e1c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobHierarchyListSegment.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobHierarchyListSegment.java @@ -6,6 +6,7 @@ import com.azure.core.implementation.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; @@ -14,6 +15,7 @@ * The BlobHierarchyListSegment model. */ @JacksonXmlRootElement(localName = "Blobs") +@JsonDeserialize(using = CustomHierarchicalListingDeserializer.class) @Fluent public final class BlobHierarchyListSegment { /* diff --git a/sdk/storage/azure-storage-blob/swagger/blob.json b/sdk/storage/azure-storage-blob/swagger/blob.json index 19d7f37b25a6..0bf6a308f327 100644 --- a/sdk/storage/azure-storage-blob/swagger/blob.json +++ b/sdk/storage/azure-storage-blob/swagger/blob.json @@ -7706,11 +7706,14 @@ "description": "a collection of signed identifiers", "type": "array", "items": { - "$ref": "#/definitions/SignedIdentifier" + "$ref": "#/definitions/SignedIdentifier", + "xml": { + "name": "SignedIdentifier" + } }, "xml": { "wrapped": true, - "name": "SignedIdentifier" + "name": "SignedIdentifiers" } }, "StaticWebsite": { @@ -8641,4 +8644,4 @@ "description": "Content disposition for given resource" } } -} \ No newline at end of file +} diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java index 789baa8a8181..32e49120832a 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/ShareAsyncClient.java @@ -431,7 +431,7 @@ private Response mapGetPropertiesResponse(SharesGetPropertiesRe } private Response mapGetStatisticsResponse(SharesGetStatisticsResponse response) { - ShareStatistics shareStatistics = new ShareStatistics(response.value().shareUsageBytes() / 1024); + ShareStatistics shareStatistics = new ShareStatistics((int) (response.value().shareUsageBytes() / 1024)); return new SimpleResponse<>(response.request(), response.statusCode(), response.headers(), shareStatistics); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java index 21b560b7dd71..39584a1738f9 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/AzureFileStorageBuilder.java @@ -67,14 +67,15 @@ public AzureFileStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureFileStorageImpl. */ public AzureFileStorageImpl build() { - if (version == null) { - this.version = "2018-11-09"; - } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } AzureFileStorageImpl client = new AzureFileStorageImpl(pipeline); - client.setVersion(this.version); + if (this.version != null) { + client.setVersion(this.version); + } else { + client.setVersion("2018-11-09"); + } if (this.url != null) { client.setUrl(this.url); } diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/DirectorysImpl.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/DirectorysImpl.java index d1d4201b5e48..4d6953cdd9d0 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/DirectorysImpl.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/DirectorysImpl.java @@ -26,7 +26,6 @@ import com.azure.storage.file.models.DirectorysListFilesAndDirectoriesSegmentResponse; import com.azure.storage.file.models.DirectorysListHandlesResponse; import com.azure.storage.file.models.DirectorysSetMetadataResponse; -import com.azure.storage.file.models.FilesDeleteResponse; import com.azure.storage.file.models.StorageErrorException; import java.util.Map; import reactor.core.publisher.Mono; @@ -183,7 +182,6 @@ public Mono deleteWithRestResponseAsync(String shareNa return service.delete(shareName, directoryPath, this.client.getUrl(), timeout, this.client.getVersion(), restype, context); } - /** * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. * diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/SharesImpl.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/SharesImpl.java index d8cf1352359b..d847d3ecd9ff 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/SharesImpl.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/implementation/SharesImpl.java @@ -33,7 +33,6 @@ import com.azure.storage.file.models.SignedIdentifier; import com.azure.storage.file.models.StorageErrorException; import java.util.List; -import reactor.core.publisher.Mono; import java.util.Map; import reactor.core.publisher.Mono; diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ListFilesAndDirectoriesSegmentResponse.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ListFilesAndDirectoriesSegmentResponse.java index 76fb6e22ea5f..a1b837aec251 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ListFilesAndDirectoriesSegmentResponse.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ListFilesAndDirectoriesSegmentResponse.java @@ -28,7 +28,7 @@ public final class ListFilesAndDirectoriesSegmentResponse { private String shareName; /* - * The snapshot property. + * The shareSnapshot property. */ @JacksonXmlProperty(localName = "ShareSnapshot", isAttribute = true) private String shareSnapshot; @@ -110,18 +110,18 @@ public ListFilesAndDirectoriesSegmentResponse shareName(String shareName) { } /** - * Get the snapshot property: The snapshot property. + * Get the shareSnapshot property: The shareSnapshot property. * - * @return the snapshot value. + * @return the shareSnapshot value. */ public String shareSnapshot() { return this.shareSnapshot; } /** - * Set the snapshot property: The snapshot property. + * Set the shareSnapshot property: The shareSnapshot property. * - * @param shareSnapshot the snapshot value to set. + * @param shareSnapshot the shareSnapshot value to set. * @return the ListFilesAndDirectoriesSegmentResponse object itself. */ public ListFilesAndDirectoriesSegmentResponse shareSnapshot(String shareSnapshot) { diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareProperties.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareProperties.java index f87a79b1a4e8..fea8c2de4c9d 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareProperties.java @@ -8,7 +8,6 @@ import com.azure.core.implementation.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; - import java.time.OffsetDateTime; import java.util.Map; diff --git a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareStats.java b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareStats.java index 8d3c2c6e69df..806f0dff400d 100644 --- a/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareStats.java +++ b/sdk/storage/azure-storage-file/src/main/java/com/azure/storage/file/models/ShareStats.java @@ -20,7 +20,7 @@ public final class ShareStats { * created or recently resized files. */ @JsonProperty(value = "ShareUsageBytes", required = true) - private int shareUsageBytes; + private long shareUsageBytes; /** * Get the shareUsageBytes property: The approximate size of the data @@ -29,7 +29,7 @@ public final class ShareStats { * * @return the shareUsageBytes value. */ - public int shareUsageBytes() { + public long shareUsageBytes() { return this.shareUsageBytes; } @@ -41,7 +41,7 @@ public int shareUsageBytes() { * @param shareUsageBytes the shareUsageBytes value to set. * @return the ShareStats object itself. */ - public ShareStats shareUsageBytes(int shareUsageBytes) { + public ShareStats shareUsageBytes(long shareUsageBytes) { this.shareUsageBytes = shareUsageBytes; return this; } diff --git a/sdk/storage/azure-storage-file/swagger/file.json b/sdk/storage/azure-storage-file/swagger/file.json index 2b5af714a1ee..26efc70f6af0 100644 --- a/sdk/storage/azure-storage-file/swagger/file.json +++ b/sdk/storage/azure-storage-file/swagger/file.json @@ -3398,7 +3398,8 @@ "properties": { "ShareUsageBytes": { "description": "The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value may not include all recently created or recently resized files.", - "type": "integer" + "type": "integer", + "format": "int64" } } }, @@ -3545,7 +3546,7 @@ "required": true, "type": "string", "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": false }, "FileCacheControl": { "name": "x-ms-cache-control", @@ -3627,7 +3628,7 @@ "required": true, "type": "string", "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true + "x-ms-skip-url-encoding": false }, "FileType": { "name": "x-ms-type", diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java index a19ff01cb0d9..bf79a8453997 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/implementation/AzureQueueStorageBuilder.java @@ -67,9 +67,6 @@ public AzureQueueStorageBuilder pipeline(HttpPipeline pipeline) { * @return an instance of AzureQueueStorageImpl. */ public AzureQueueStorageImpl build() { - if (version == null) { - this.version = "2018-03-28"; - } if (pipeline == null) { this.pipeline = RestProxy.createDefaultPipeline(); } @@ -77,7 +74,11 @@ public AzureQueueStorageImpl build() { if (this.url != null) { client.setUrl(this.url); } - client.setVersion(this.version); + if (this.version != null) { + client.setVersion(this.version); + } else { + client.setVersion("2018-03-28"); + } return client; } } diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/DequeuedMessage.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/DequeuedMessage.java index a601ccd8f5d4..81614fc1cba9 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/DequeuedMessage.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/DequeuedMessage.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.storage.queue.models; diff --git a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/PeekedMessage.java b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/PeekedMessage.java index 77c200fe1e1b..c8a3c26ab973 100644 --- a/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/PeekedMessage.java +++ b/sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/models/PeekedMessage.java @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.storage.queue.models;