From 2c3b2544df7798bd9fbd2f079a386af33681e400 Mon Sep 17 00:00:00 2001 From: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Date: Fri, 25 Sep 2020 11:47:19 -0700 Subject: [PATCH] Fixed public API for file get range diff (#15562) --- .../file/share/ShareFileAsyncClient.java | 52 +++++--- .../storage/file/share/ShareFileClient.java | 27 ++-- .../models/FilesGetRangeListResponse.java | 9 +- .../storage/file/share/models/ClearRange.java | 68 ++++++++++ .../storage/file/share/models/FileRange.java | 68 ++++++++++ .../file/share/models/ShareFileRangeList.java | 70 ++++++++++ .../ShareFileAsyncJavaDocCodeSamples.java | 28 ++-- .../share/ShareFileJavaDocCodeSamples.java | 34 +++-- .../storage/file/share/FileAPITests.groovy | 62 +++++---- .../FileAPITestsListRangesDiff.json | 125 +++++++++++------- .../swagger/README.md | 2 +- 11 files changed, 399 insertions(+), 146 deletions(-) create mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ClearRange.java create mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileRange.java create mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java index dc55ec4942fa5..d38ee336a9dcb 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java @@ -46,6 +46,7 @@ import com.azure.storage.file.share.models.LeaseStatusType; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.PermissionCopyModeType; +import com.azure.storage.file.share.models.Range; import com.azure.storage.file.share.models.ShareErrorCode; import com.azure.storage.file.share.models.ShareFileCopyInfo; import com.azure.storage.file.share.models.ShareFileDownloadAsyncResponse; @@ -54,6 +55,7 @@ import com.azure.storage.file.share.models.ShareFileMetadataInfo; import com.azure.storage.file.share.models.ShareFileProperties; import com.azure.storage.file.share.models.ShareFileRange; +import com.azure.storage.file.share.models.ShareFileRangeList; import com.azure.storage.file.share.models.ShareFileUploadInfo; import com.azure.storage.file.share.models.ShareFileUploadRangeFromUrlInfo; import com.azure.storage.file.share.models.ShareRequestConditions; @@ -1614,8 +1616,7 @@ public PagedFlux listRanges(ShareFileRange range) { */ public PagedFlux listRanges(ShareFileRange range, ShareRequestConditions requestConditions) { try { - return listRangesWithOptionalTimeout(range, requestConditions, null, - null, Context.NONE); + return listRangesWithOptionalTimeout(range, requestConditions, null, Context.NONE); } catch (RuntimeException ex) { return pagedFluxError(logger, ex); } @@ -1636,11 +1637,12 @@ public PagedFlux listRanges(ShareFileRange range, ShareRequestCo * snapshot, as long as the snapshot specified by previousSnapshot is the older of the two. * @return {@link ShareFileRange ranges} in the files that satisfy the requirements */ - public PagedFlux listRangesDiff(String previousSnapshot) { + public Mono listRangesDiff(String previousSnapshot) { try { - return listRangesDiff(new ShareFileListRangesDiffOptions(previousSnapshot)); + return listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(previousSnapshot)) + .map(Response::getValue); } catch (RuntimeException ex) { - return pagedFluxError(logger, ex); + return monoError(logger, ex); } } @@ -1651,7 +1653,7 @@ public PagedFlux listRangesDiff(String previousSnapshot) { * *

List all ranges within the file range from 1KB to 2KB.

* - * {@codesnippet com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiff#ShareFileListRangesDiffOptions} + * {@codesnippet com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions} * *

For more information, see the * Azure Docs.

@@ -1659,37 +1661,49 @@ public PagedFlux listRangesDiff(String previousSnapshot) { * @param options {@link ShareFileListRangesDiffOptions}. * @return {@link ShareFileRange ranges} in the files that satisfy the requirements */ - public PagedFlux listRangesDiff(ShareFileListRangesDiffOptions options) { + public Mono> listRangesDiffWithResponse(ShareFileListRangesDiffOptions options) { try { StorageImplUtils.assertNotNull("options", options); - return listRangesWithOptionalTimeout(options.getRange(), options.getRequestConditions(), - options.getPreviousSnapshot(), null, Context.NONE); + return listRangesWithResponse(options.getRange(), options.getRequestConditions(), + options.getPreviousSnapshot(), Context.NONE); } catch (RuntimeException ex) { - return pagedFluxError(logger, ex); + return monoError(logger, ex); } } PagedFlux listRangesWithOptionalTimeout(ShareFileRange range, - ShareRequestConditions requestConditions, String previousSnapshot, Duration timeout, + ShareRequestConditions requestConditions, Duration timeout, Context context) { - ShareRequestConditions finalRequestConditions = requestConditions == null - ? new ShareRequestConditions() : requestConditions; - String rangeString = range == null ? null : range.toString(); Function>> retriever = - marker -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.files() - .getRangeListWithRestResponseAsync(shareName, filePath, snapshot, previousSnapshot, - null, rangeString, finalRequestConditions.getLeaseId(), context), timeout) + marker -> StorageImplUtils.applyOptionalTimeout( + this.listRangesWithResponse(range, requestConditions, null, context), timeout) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - response.getValue().stream().map(ShareFileRange::new).collect(Collectors.toList()), + response.getValue().getRanges().stream() + .map(r -> new Range().setStart(r.getStart()).setEnd(r.getEnd())) + .map(ShareFileRange::new).collect(Collectors.toList()), null, - response.getDeserializedHeaders())); + response.getHeaders())); return new PagedFlux<>(() -> retriever.apply(null), retriever); } + Mono> listRangesWithResponse(ShareFileRange range, + ShareRequestConditions requestConditions, String previousSnapshot, Context context) { + + ShareRequestConditions finalRequestConditions = requestConditions == null + ? new ShareRequestConditions() : requestConditions; + String rangeString = range == null ? null : range.toString(); + context = context == null ? Context.NONE : context; + + return this.azureFileStorageClient.files().getRangeListWithRestResponseAsync(shareName, filePath, snapshot, + previousSnapshot, null, rangeString, finalRequestConditions.getLeaseId(), + context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) + .map(response -> new SimpleResponse<>(response, response.getValue())); + } + /** * List of open handles on a file. * diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java index 1a7f078c5fb2e..3c9b325480f49 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java @@ -23,6 +23,7 @@ import com.azure.storage.file.share.models.ShareFileMetadataInfo; import com.azure.storage.file.share.models.ShareFileProperties; import com.azure.storage.file.share.models.ShareFileRange; +import com.azure.storage.file.share.models.ShareFileRangeList; import com.azure.storage.file.share.models.ShareRequestConditions; import com.azure.storage.file.share.models.ShareStorageException; import com.azure.storage.file.share.models.ShareFileUploadInfo; @@ -1243,7 +1244,7 @@ public PagedIterable listRanges(ShareFileRange range, Duration t */ public PagedIterable listRanges(ShareFileRange range, ShareRequestConditions requestConditions, Duration timeout, Context context) { - return new PagedIterable<>(shareFileAsyncClient.listRangesWithOptionalTimeout(range, requestConditions, null, + return new PagedIterable<>(shareFileAsyncClient.listRangesWithOptionalTimeout(range, requestConditions, timeout, context)); } @@ -1254,7 +1255,7 @@ public PagedIterable listRanges(ShareFileRange range, ShareReque * *

List all ranges within the file range from 1KB to 2KB.

* - * {@codesnippet com.azure.storage.file.share.ShareFileClient.listRangesDiff#String-Duration-Context} + * {@codesnippet com.azure.storage.file.share.ShareFileClient.listRangesDiff#String} * *

For more information, see the * Azure Docs.

@@ -1262,15 +1263,12 @@ public PagedIterable listRanges(ShareFileRange range, ShareReque * @param previousSnapshot Specifies that the response will contain only ranges that were changed between target * file and previous snapshot. Changed ranges include both updated and cleared ranges. The target file may be a * snapshot, as long as the snapshot specified by previousSnapshot is the older of the two. - * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout - * concludes a {@link RuntimeException} will be thrown. - * @param context Additional context that is passed through the Http pipeline during the service call. * @return {@link ShareFileRange ranges} in the files that satisfy the requirements * @throws RuntimeException if the operation doesn't complete before the timeout concludes. */ - public PagedIterable listRangesDiff(String previousSnapshot, Duration timeout, - Context context) { - return this.listRangesDiff(new ShareFileListRangesDiffOptions(previousSnapshot), timeout, context); + public ShareFileRangeList listRangesDiff(String previousSnapshot) { + return this.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(previousSnapshot), null, Context.NONE) + .getValue(); } /** @@ -1280,7 +1278,7 @@ public PagedIterable listRangesDiff(String previousSnapshot, Dur * *

List all ranges within the file range from 1KB to 2KB.

* - * {@codesnippet com.azure.storage.file.share.ShareFileClient.listRangesDiff#ShareFileListRangesDiffOptions-Duration-Context} + * {@codesnippet com.azure.storage.file.share.ShareFileClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions-Duration-Context} * *

For more information, see the * Azure Docs.

@@ -1292,12 +1290,13 @@ public PagedIterable listRangesDiff(String previousSnapshot, Dur * @return {@link ShareFileRange ranges} in the files that satisfy the requirements * @throws RuntimeException if the operation doesn't complete before the timeout concludes. */ - public PagedIterable listRangesDiff(ShareFileListRangesDiffOptions options, Duration timeout, - Context context) { + public Response listRangesDiffWithResponse(ShareFileListRangesDiffOptions options, + Duration timeout, Context context) { StorageImplUtils.assertNotNull("options", options); - return new PagedIterable<>(shareFileAsyncClient.listRangesWithOptionalTimeout(options.getRange(), - options.getRequestConditions(), options.getPreviousSnapshot(), timeout, - context)); + Mono> response = shareFileAsyncClient.listRangesWithResponse(options.getRange(), + options.getRequestConditions(), options.getPreviousSnapshot(), context); + + return StorageImplUtils.blockWithOptionalTimeout(response, timeout); } /** diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListResponse.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListResponse.java index eaaea46782a87..de5ca656c1046 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListResponse.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListResponse.java @@ -7,13 +7,12 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; -import com.azure.storage.file.share.models.Range; -import java.util.List; +import com.azure.storage.file.share.models.ShareFileRangeList; /** * Contains all response data for the getRangeList operation. */ -public final class FilesGetRangeListResponse extends ResponseBase> { +public final class FilesGetRangeListResponse extends ResponseBase { /** * Creates an instance of FilesGetRangeListResponse. * @@ -23,7 +22,7 @@ public final class FilesGetRangeListResponse extends ResponseBase value, FileGetRangeListHeaders headers) { + public FilesGetRangeListResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, ShareFileRangeList value, FileGetRangeListHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } @@ -31,7 +30,7 @@ public FilesGetRangeListResponse(HttpRequest request, int statusCode, HttpHeader * @return the deserialized response body. */ @Override - public List getValue() { + public ShareFileRangeList getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ClearRange.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ClearRange.java new file mode 100644 index 0000000000000..8c321e3283a4c --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ClearRange.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.file.share.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * The ClearRange model. + */ +@JacksonXmlRootElement(localName = "ClearRange") +@Fluent +public final class ClearRange { + /* + * The start property. + */ + @JsonProperty(value = "Start", required = true) + private long start; + + /* + * The end property. + */ + @JsonProperty(value = "End", required = true) + private long end; + + /** + * Get the start property: The start property. + * + * @return the start value. + */ + public long getStart() { + return this.start; + } + + /** + * Set the start property: The start property. + * + * @param start the start value to set. + * @return the ClearRange object itself. + */ + public ClearRange setStart(long start) { + this.start = start; + return this; + } + + /** + * Get the end property: The end property. + * + * @return the end value. + */ + public long getEnd() { + return this.end; + } + + /** + * Set the end property: The end property. + * + * @param end the end value to set. + * @return the ClearRange object itself. + */ + public ClearRange setEnd(long end) { + this.end = end; + return this; + } +} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileRange.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileRange.java new file mode 100644 index 0000000000000..d9887a098971c --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileRange.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.file.share.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + +/** + * An Azure Storage file range. + */ +@JacksonXmlRootElement(localName = "Range") +@Fluent +public final class FileRange { + /* + * Start of the range. + */ + @JsonProperty(value = "Start", required = true) + private long start; + + /* + * End of the range. + */ + @JsonProperty(value = "End", required = true) + private long end; + + /** + * Get the start property: Start of the range. + * + * @return the start value. + */ + public long getStart() { + return this.start; + } + + /** + * Set the start property: Start of the range. + * + * @param start the start value to set. + * @return the FileRange object itself. + */ + public FileRange setStart(long start) { + this.start = start; + return this; + } + + /** + * Get the end property: End of the range. + * + * @return the end value. + */ + public long getEnd() { + return this.end; + } + + /** + * Set the end property: End of the range. + * + * @param end the end value to set. + * @return the FileRange object itself. + */ + public FileRange setEnd(long end) { + this.end = end; + return this; + } +} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java new file mode 100644 index 0000000000000..cedb2f7987d8b --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.file.share.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** + * The list of file ranges. + */ +@JacksonXmlRootElement(localName = "ShareFileRangeList") +@Fluent +public final class ShareFileRangeList { + /* + * The ranges property. + */ + @JsonProperty("Range") + private List ranges = new ArrayList<>(); + + /* + * The clearRanges property. + */ + @JsonProperty("ClearRange") + private List clearRanges = new ArrayList<>(); + + /** + * Get the ranges property: The ranges property. + * + * @return the ranges value. + */ + public List getRanges() { + return this.ranges; + } + + /** + * Set the ranges property: The ranges property. + * + * @param ranges the ranges value to set. + * @return the ShareFileRangeList object itself. + */ + public ShareFileRangeList setRanges(List ranges) { + this.ranges = ranges; + return this; + } + + /** + * Get the clearRanges property: The clearRanges property. + * + * @return the clearRanges value. + */ + public List getClearRanges() { + return this.clearRanges; + } + + /** + * Set the clearRanges property: The clearRanges property. + * + * @param clearRanges the clearRanges value to set. + * @return the ShareFileRangeList object itself. + */ + public ShareFileRangeList setClearRanges(List clearRanges) { + this.clearRanges = clearRanges; + return this; + } +} diff --git a/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileAsyncJavaDocCodeSamples.java b/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileAsyncJavaDocCodeSamples.java index 73a31080e9a42..97b66fa0ce52a 100644 --- a/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileAsyncJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileAsyncJavaDocCodeSamples.java @@ -4,6 +4,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.storage.common.StorageSharedKeyCredential; +import com.azure.storage.file.share.models.FileRange; import com.azure.storage.file.share.models.PermissionCopyModeType; import com.azure.storage.file.share.models.ShareFileCopyInfo; import com.azure.storage.file.share.models.ShareFileHttpHeaders; @@ -830,23 +831,30 @@ public void listRangesAsyncMaxOverload() { public void listRangesDiffAsync() { ShareFileAsyncClient shareFileAsyncClient = createAsyncClientWithSASToken(); // BEGIN: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiff#String - shareFileAsyncClient.listRangesDiff("previoussnapshot") - .subscribe(result -> System.out.printf("List ranges completed with start: %d, end: %d", - result.getStart(), result.getEnd())); + final String prevSnapshot = "previoussnapshot"; + shareFileAsyncClient.listRangesDiff(prevSnapshot).subscribe(response -> { + System.out.println("Valid Share File Ranges are:"); + for (FileRange range : response.getRanges()) { + System.out.printf("Start: %s, End: %s%n", range.getStart(), range.getEnd()); + } + }); // END: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiff#String } /** - * Generates a code sample for using {@link ShareFileAsyncClient#listRangesDiff(ShareFileListRangesDiffOptions)} + * Generates a code sample for using {@link ShareFileAsyncClient#listRangesDiffWithResponse(ShareFileListRangesDiffOptions)} */ public void listRangesDiffAsyncOptionalOverload() { ShareFileAsyncClient shareFileAsyncClient = createAsyncClientWithSASToken(); - // BEGIN: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiff#ShareFileListRangesDiffOptions - shareFileAsyncClient.listRangesDiff(new ShareFileListRangesDiffOptions("previoussnapshot") - .setRange(new ShareFileRange(1024, 2048L))) - .subscribe(result -> System.out.printf("List ranges completed with start: %d, end: %d", - result.getStart(), result.getEnd())); - // END: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiff#ShareFileListRangesDiffOptions + // BEGIN: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions + shareFileAsyncClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions("previoussnapshot") + .setRange(new ShareFileRange(1024, 2048L))).subscribe(response -> { + System.out.println("Valid Share File Ranges are:"); + for (FileRange range : response.getValue().getRanges()) { + System.out.printf("Start: %s, End: %s%n", range.getStart(), range.getEnd()); + } + }); + // END: com.azure.storage.file.share.ShareFileAsyncClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions } /** diff --git a/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileJavaDocCodeSamples.java b/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileJavaDocCodeSamples.java index f4f4a6dd814fb..325dde6063700 100644 --- a/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileJavaDocCodeSamples.java +++ b/sdk/storage/azure-storage-file-share/src/samples/java/com/azure/storage/file/share/ShareFileJavaDocCodeSamples.java @@ -8,6 +8,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.file.share.models.CloseHandlesInfo; +import com.azure.storage.file.share.models.FileRange; import com.azure.storage.file.share.models.PermissionCopyModeType; import com.azure.storage.file.share.models.ShareFileCopyInfo; import com.azure.storage.file.share.models.ShareFileHttpHeaders; @@ -15,6 +16,7 @@ import com.azure.storage.file.share.models.ShareFileMetadataInfo; import com.azure.storage.file.share.models.ShareFileProperties; import com.azure.storage.file.share.models.ShareFileRange; +import com.azure.storage.file.share.models.ShareFileRangeList; import com.azure.storage.file.share.models.ShareFileUploadInfo; import com.azure.storage.file.share.models.ShareFileUploadRangeFromUrlInfo; import com.azure.storage.file.share.models.NtfsFileAttributes; @@ -816,29 +818,33 @@ public void listRangesMaxOverload() { } /** - * Generates a code sample for using {@link ShareFileClient#listRangesDiff(String, Duration, Context)} + * Generates a code sample for using {@link ShareFileClient#listRangesDiff(String)} */ public void listRangesDiffOverload() { ShareFileClient fileClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.share.ShareFileClient.listRangesDiff#String-Duration-Context - Iterable ranges = fileClient.listRangesDiff("previoussnapshot", - Duration.ofSeconds(1), new Context(key1, value1)); - ranges.forEach(range -> - System.out.printf("List ranges completed with start: %d, end: %d", range.getStart(), range.getEnd())); - // END: com.azure.storage.file.share.ShareFileClient.listRangesDiff#String-Duration-Context + // BEGIN: com.azure.storage.file.share.ShareFileClient.listRangesDiff#String + ShareFileRangeList rangeList = fileClient.listRangesDiff("previoussnapshot"); + System.out.println("Valid Share File Ranges are:"); + for (FileRange range : rangeList.getRanges()) { + System.out.printf("Start: %s, End: %s%n", range.getStart(), range.getEnd()); + } + // END: com.azure.storage.file.share.ShareFileClient.listRangesDiff#String } /** - * Generates a code sample for using {@link ShareFileClient#listRangesDiff(ShareFileListRangesDiffOptions, Duration, Context)} + * Generates a code sample for using {@link ShareFileClient#listRangesDiffWithResponse(ShareFileListRangesDiffOptions, Duration, Context)} */ public void listRangesDiffOptionalOverload() { ShareFileClient fileClient = createClientWithSASToken(); - // BEGIN: com.azure.storage.file.share.ShareFileClient.listRangesDiff#ShareFileListRangesDiffOptions-Duration-Context - Iterable ranges = fileClient.listRangesDiff(new ShareFileListRangesDiffOptions("previoussnapshot") - .setRange(new ShareFileRange(1024, 2048L)), Duration.ofSeconds(1), new Context(key1, value1)); - ranges.forEach(range -> - System.out.printf("List ranges completed with start: %d, end: %d", range.getStart(), range.getEnd())); - // END: com.azure.storage.file.share.ShareFileClient.listRangesDiff#ShareFileListRangesDiffOptions-Duration-Context + // BEGIN: com.azure.storage.file.share.ShareFileClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions-Duration-Context + ShareFileRangeList rangeList = fileClient.listRangesDiffWithResponse( + new ShareFileListRangesDiffOptions("previoussnapshot") + .setRange(new ShareFileRange(1024, 2048L)), Duration.ofSeconds(1), new Context(key1, value1)).getValue(); + System.out.println("Valid Share File Ranges are:"); + for (FileRange range : rangeList.getRanges()) { + System.out.printf("Start: %s, End: %s%n", range.getStart(), range.getEnd()); + } + // END: com.azure.storage.file.share.ShareFileClient.listRangesDiffWithResponse#ShareFileListRangesDiffOptions-Duration-Context } /** diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAPITests.groovy b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAPITests.groovy index bd6dee974fd4a..1c07af425c278 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAPITests.groovy +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAPITests.groovy @@ -796,23 +796,25 @@ class FileAPITests extends APISpec { def "List ranges diff"() { given: - def fileName = testResourceName.randomName("file", 60) - primaryFileClient.create(1024 + dataLength) - def uploadFile = FileTestHelper.createRandomFileWithLength(1024, testFolder, fileName) - primaryFileClient.uploadFromFile(uploadFile) - + primaryFileClient.create(1024) + primaryFileClient.uploadWithResponse(new ByteArrayInputStream(FileTestHelper.getRandomBuffer(512)),512, 512, null, null) def snapInfo = shareClient.createSnapshot() + primaryFileClient.uploadWithResponse(new ByteArrayInputStream(FileTestHelper.getRandomBuffer(512)),512, 0, null, null) - primaryFileClient.uploadWithResponse(defaultData, dataLength, 1024, null, null) + primaryFileClient.clearRangeWithResponse(512, 512, null, null) - expect: - primaryFileClient.listRangesDiff(snapInfo.getSnapshot(), null, null).each { - assert it.getStart() == 1024 /* These are the changes since the previous snapshot. */ - assert it.getEnd() == 1030 - } + when: + def response = primaryFileClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRange(new ShareFileRange(0, 1024)), null, null) - cleanup: - FileTestHelper.deleteFilesIfExists(testFolder.getPath()) + then: + response.getValue().getRanges().size() == 1 + response.getValue().getRanges().get(0).getStart() == 0 + response.getValue().getRanges().get(0).getEnd() == 511 + response.getValue().getClearRanges().size() == 1 + response.getValue().getClearRanges().get(0).getStart() == 512 + response.getValue().getClearRanges().get(0).getEnd() == 1023 + validateBasicHeaders(response.getHeaders()) + Integer.parseInt(response.getHeaders().getValue("x-ms-content-length")) == 1024 } def "List ranges diff with range"() { @@ -826,11 +828,12 @@ class FileAPITests extends APISpec { primaryFileClient.uploadWithResponse(defaultData, dataLength, 1024, null, null) - expect: - primaryFileClient.listRangesDiff(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRange(new ShareFileRange(1025, 1026)), null, null).each { - assert it.getStart() == 1025 /* These are the changes since the previous snapshot. */ - assert it.getEnd() == 1026 - } + when: + def range = primaryFileClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRange(new ShareFileRange(1025, 1026)), null, null).getValue().getRanges().get(0) + + then: + range.getStart() == 1025 + range.getEnd() == 1026 cleanup: FileTestHelper.deleteFilesIfExists(testFolder.getPath()) @@ -848,11 +851,12 @@ class FileAPITests extends APISpec { primaryFileClient.uploadWithResponse(defaultData, dataLength, 1024, null, null) def leaseId = createLeaseClient(primaryFileClient).acquireLease() - expect: - primaryFileClient.listRangesDiff(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRequestConditions(new ShareRequestConditions().setLeaseId(leaseId)), null, null).each { - assert it.getStart() == 1024 /* These are the changes since the previous snapshot. */ - assert it.getEnd() == 1030 - } + when: + def range = primaryFileClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRequestConditions(new ShareRequestConditions().setLeaseId(leaseId)), null, null).getValue().getRanges().get(0) + + then: + range.getStart() == 1024 + range.getEnd() == 1030 cleanup: FileTestHelper.deleteFilesIfExists(testFolder.getPath()) @@ -870,10 +874,7 @@ class FileAPITests extends APISpec { primaryFileClient.uploadWithResponse(defaultData, dataLength, 1024, null, null) when: - primaryFileClient.listRangesDiff(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRequestConditions(new ShareRequestConditions().setLeaseId(getRandomUUID())), null, null).each { - assert it.getStart() == 1024 /* These are the changes since the previous snapshot. */ - assert it.getEnd() == 1030 - } + primaryFileClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions(snapInfo.getSnapshot()).setRequestConditions(new ShareRequestConditions().setLeaseId(getRandomUUID())), null, null).getValue().getRanges().get(0) then: thrown(ShareStorageException) @@ -890,13 +891,10 @@ class FileAPITests extends APISpec { primaryFileClient.uploadFromFile(uploadFile) when: - primaryFileClient.listRangesDiff(new ShareFileListRangesDiffOptions("2020-08-07T16:58:02.0000000Z"), null, null).each { - assert it.getStart() == 0 - assert it.getEnd() == 511 - } + primaryFileClient.listRangesDiffWithResponse(new ShareFileListRangesDiffOptions("2020-08-07T16:58:02.0000000Z"), null, null).getValue().getRanges().get(0) then: - def e = thrown(ShareStorageException) + thrown(ShareStorageException) cleanup: FileTestHelper.deleteFilesIfExists(testFolder.getPath()) diff --git a/sdk/storage/azure-storage-file-share/src/test/resources/session-records/FileAPITestsListRangesDiff.json b/sdk/storage/azure-storage-file-share/src/test/resources/session-records/FileAPITestsListRangesDiff.json index 534081307dfcc..d29c2c4958733 100644 --- a/sdk/storage/azure-storage-file-share/src/test/resources/session-records/FileAPITestsListRangesDiff.json +++ b/sdk/storage/azure-storage-file-share/src/test/resources/session-records/FileAPITestsListRangesDiff.json @@ -1,32 +1,32 @@ { "networkCallRecords" : [ { "Method" : "PUT", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e?restype=share", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943?restype=share", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "3bfd9f43-7982-4df5-adb4-3b3548e9e4f5" + "x-ms-client-request-id" : "e4671492-1bbd-46e5-bbd7-b6bcc8991cef" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-02-10", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "ETag" : "0x8D850F9A6A4C85B", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:44 GMT", + "ETag" : "0x8D85FE3AAAD822B", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:09 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "377ffef9-f01a-0012-6ee2-82d555000000", - "Date" : "Fri, 04 Sep 2020 17:40:44 GMT", - "x-ms-client-request-id" : "3bfd9f43-7982-4df5-adb4-3b3548e9e4f5" + "x-ms-request-id" : "8298c824-801a-0016-0bcc-9120d7000000", + "Date" : "Wed, 23 Sep 2020 17:11:09 GMT", + "x-ms-client-request-id" : "e4671492-1bbd-46e5-bbd7-b6bcc8991cef" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e/fileapitestslistrangesdiff631724d287033a6dc43", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943/fileapitestslistrangesdiff31257b1ac880eb03b4d", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "25295cb4-c101-4d82-9478-75614292e7c1" + "x-ms-client-request-id" : "e731d9bf-0f92-4554-87cc-a4f383ef9edf" }, "Response" : { "Transfer-Encoding" : "chunked", @@ -34,115 +34,138 @@ "x-ms-file-permission-key" : "990002565778260641*11897905858180131375", "x-ms-file-id" : "13835128424026341376", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-file-creation-time" : "2020-09-04T17:40:45.0104212Z", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:45 GMT", + "x-ms-file-creation-time" : "2020-09-23T17:11:10.3959412Z", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:10 GMT", "retry-after" : "0", "StatusCode" : "201", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 04 Sep 2020 17:40:44 GMT", - "ETag" : "0x8D850F9A6E62394", + "Date" : "Wed, 23 Sep 2020 17:11:09 GMT", + "ETag" : "0x8D85FE3AAFEB574", "x-ms-file-attributes" : "Archive", - "x-ms-file-change-time" : "2020-09-04T17:40:45.0104212Z", + "x-ms-file-change-time" : "2020-09-23T17:11:10.3959412Z", "x-ms-file-parent-id" : "0", - "x-ms-request-id" : "377fff00-f01a-0012-72e2-82d555000000", - "x-ms-client-request-id" : "25295cb4-c101-4d82-9478-75614292e7c1", - "x-ms-file-last-write-time" : "2020-09-04T17:40:45.0104212Z" + "x-ms-request-id" : "8298c827-801a-0016-0ccc-9120d7000000", + "x-ms-client-request-id" : "e731d9bf-0f92-4554-87cc-a4f383ef9edf", + "x-ms-file-last-write-time" : "2020-09-23T17:11:10.3959412Z" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e/fileapitestslistrangesdiff631724d287033a6dc43?comp=range", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943/fileapitestslistrangesdiff31257b1ac880eb03b4d?comp=range", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "e754d49d-11a4-4149-82aa-859be455e924", + "x-ms-client-request-id" : "a2575d14-a476-4dba-a505-878bbdb9776b", "Content-Type" : "application/octet-stream" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-02-10", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "ETag" : "0x8D850F9A70A05BF", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:45 GMT", + "ETag" : "0x8D85FE3AB2B72F1", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:10 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "377fff01-f01a-0012-73e2-82d555000000", + "x-ms-request-id" : "8298c829-801a-0016-0dcc-9120d7000000", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 04 Sep 2020 17:40:44 GMT", - "x-ms-client-request-id" : "e754d49d-11a4-4149-82aa-859be455e924", - "Content-MD5" : "DzQ7CTESaiDxM9Z8KwGKOw==" + "Date" : "Wed, 23 Sep 2020 17:11:09 GMT", + "x-ms-client-request-id" : "a2575d14-a476-4dba-a505-878bbdb9776b", + "Content-MD5" : "BjZoimUMLAwLoDSRbYj+TQ==" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e?restype=share&comp=snapshot", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943?restype=share&comp=snapshot", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "7371d4f5-0fb7-43bf-b887-e51c4794c2fe" + "x-ms-client-request-id" : "46a2a46e-e564-4e2e-8194-3d703908a382" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-02-10", - "x-ms-snapshot" : "2020-09-04T17:40:45.0000000Z", + "x-ms-snapshot" : "2020-09-23T17:11:10.0000000Z", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "ETag" : "0x8D850F9A6A4C85B", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:44 GMT", + "ETag" : "0x8D85FE3AAAD822B", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:09 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "377fff04-f01a-0012-76e2-82d555000000", - "Date" : "Fri, 04 Sep 2020 17:40:44 GMT", - "x-ms-client-request-id" : "7371d4f5-0fb7-43bf-b887-e51c4794c2fe" + "x-ms-request-id" : "8298c82a-801a-0016-0ecc-9120d7000000", + "Date" : "Wed, 23 Sep 2020 17:11:10 GMT", + "x-ms-client-request-id" : "46a2a46e-e564-4e2e-8194-3d703908a382" }, "Exception" : null }, { "Method" : "PUT", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e/fileapitestslistrangesdiff631724d287033a6dc43?comp=range", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943/fileapitestslistrangesdiff31257b1ac880eb03b4d?comp=range", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "a852033a-34ea-4b25-ae68-1cc979bae0c6", + "x-ms-client-request-id" : "156f8c18-0b8e-4bc7-8ebc-d1378069bb63", "Content-Type" : "application/octet-stream" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-02-10", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "ETag" : "0x8D850F9A7284196", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:45 GMT", + "ETag" : "0x8D85FE3AB436C21", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:10 GMT", "retry-after" : "0", "StatusCode" : "201", - "x-ms-request-id" : "377fff05-f01a-0012-77e2-82d555000000", + "x-ms-request-id" : "8298c82b-801a-0016-0fcc-9120d7000000", "x-ms-request-server-encrypted" : "true", - "Date" : "Fri, 04 Sep 2020 17:40:44 GMT", - "x-ms-client-request-id" : "a852033a-34ea-4b25-ae68-1cc979bae0c6", - "Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==" + "Date" : "Wed, 23 Sep 2020 17:11:10 GMT", + "x-ms-client-request-id" : "156f8c18-0b8e-4bc7-8ebc-d1378069bb63", + "Content-MD5" : "SFHe5RMChLWcByze1bDWyA==" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943/fileapitestslistrangesdiff31257b1ac880eb03b4d?comp=range", + "Headers" : { + "x-ms-version" : "2020-02-10", + "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", + "x-ms-client-request-id" : "6af3afb6-b023-425f-b8f5-beddcd7b977a" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2020-02-10", + "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D85FE3AB4DF563", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:10 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8298c82c-801a-0016-10cc-9120d7000000", + "Date" : "Wed, 23 Sep 2020 17:11:10 GMT", + "x-ms-client-request-id" : "6af3afb6-b023-425f-b8f5-beddcd7b977a" }, "Exception" : null }, { "Method" : "GET", - "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff281564a8339fc00204e/fileapitestslistrangesdiff631724d287033a6dc43?prevsharesnapshot=2020-09-04T17%3A40%3A45.0000000Z&comp=rangelist", + "Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestslistrangesdiff6485894771047187943/fileapitestslistrangesdiff31257b1ac880eb03b4d?prevsharesnapshot=2020-09-23T17%3A11%3A10.0000000Z&comp=rangelist", "Headers" : { "x-ms-version" : "2020-02-10", "User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)", - "x-ms-client-request-id" : "2ce716cf-f1ca-46f5-8d58-87c7a77920c2" + "x-ms-client-request-id" : "a3369988-8134-40cc-aaf3-50bda135c84d" }, "Response" : { "Transfer-Encoding" : "chunked", "x-ms-version" : "2020-02-10", "Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-content-length" : "1031", - "Last-Modified" : "Fri, 04 Sep 2020 17:40:45 GMT", + "Access-Control-Allow-Origin" : "*", + "x-ms-content-length" : "1024", + "Last-Modified" : "Wed, 23 Sep 2020 17:11:10 GMT", "retry-after" : "0", "StatusCode" : "200", - "Date" : "Fri, 04 Sep 2020 17:40:45 GMT", - "ETag" : "0x8D850F9A7284196", - "x-ms-request-id" : "377fff0a-f01a-0012-7ce2-82d555000000", - "Body" : "10241030", - "x-ms-client-request-id" : "2ce716cf-f1ca-46f5-8d58-87c7a77920c2", + "Date" : "Wed, 23 Sep 2020 17:11:10 GMT", + "Access-Control-Expose-Headers" : "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-content-length", + "ETag" : "0x8D85FE3AB4DF563", + "x-ms-request-id" : "8298c82e-801a-0016-11cc-9120d7000000", + "Body" : "05115121023", + "x-ms-client-request-id" : "a3369988-8134-40cc-aaf3-50bda135c84d", "Content-Type" : "application/xml" }, "Exception" : null } ], - "variables" : [ "fileapitestslistrangesdiff281564a8339fc00204e", "fileapitestslistrangesdiff631724d287033a6dc43", "filefileapitestslistrangesdiff9d353726e94c78b45b1" ] + "variables" : [ "fileapitestslistrangesdiff6485894771047187943", "fileapitestslistrangesdiff31257b1ac880eb03b4d" ] } \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 687f0924e0706..cf374aa7fe45e 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -26,7 +26,7 @@ license-header: MICROSOFT_MIT_SMALL add-context-parameter: true models-subpackage: implementation.models custom-types-subpackage: models -custom-types: HandleItem,ShareFileHttpHeaders,ShareItem,ShareServiceProperties,ShareCorsRule,ShareProperties,Range,CopyStatusType,ShareSignedIdentifier,SourceModifiedAccessConditions,ShareErrorCode,StorageServiceProperties,ShareMetrics,ShareAccessPolicy,ShareFileDownloadHeaders,LeaseDurationType,LeaseStateType,LeaseStatusType,PermissionCopyModeType,DeleteSnapshotsOptionType +custom-types: HandleItem,ShareFileHttpHeaders,ShareItem,ShareServiceProperties,ShareCorsRule,ShareProperties,Range,FileRange,ClearRange,ShareFileRangeList,CopyStatusType,ShareSignedIdentifier,SourceModifiedAccessConditions,ShareErrorCode,StorageServiceProperties,ShareMetrics,ShareAccessPolicy,ShareFileDownloadHeaders,LeaseDurationType,LeaseStateType,LeaseStatusType,PermissionCopyModeType,DeleteSnapshotsOptionType ``` ### Query Parameters