diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java index e47e219591fd..4633719eb49c 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java @@ -18,6 +18,10 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; @@ -40,6 +44,7 @@ import com.azure.storage.file.share.implementation.models.FilesForceCloseHandlesHeaders; import com.azure.storage.file.share.implementation.models.FilesGetPropertiesHeaders; import com.azure.storage.file.share.implementation.models.FilesGetRangeListHeaders; +import com.azure.storage.file.share.implementation.models.FilesGetRangeListNextHeaders; import com.azure.storage.file.share.implementation.models.FilesGetSymbolicLinkHeaders; import com.azure.storage.file.share.implementation.models.FilesListHandlesHeaders; import com.azure.storage.file.share.implementation.models.FilesReleaseLeaseHeaders; @@ -57,6 +62,7 @@ import com.azure.storage.file.share.models.FileLastWrittenMode; import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.FilePropertySemantics; +import com.azure.storage.file.share.models.FileRange; import com.azure.storage.file.share.models.ModeCopyMode; import com.azure.storage.file.share.models.NfsFileType; import com.azure.storage.file.share.models.OwnerCopyMode; @@ -963,8 +969,8 @@ Mono> getRangeList(@H @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @Get("/{shareName}/{fileName}") @ExpectedResponses({ 200 }) @@ -977,8 +983,8 @@ Mono> getRangeListNoCustomHeaders(@HostParam("url") @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @Get("/{shareName}/{fileName}") @ExpectedResponses({ 200 }) @@ -991,8 +997,8 @@ ResponseBase getRangeListSync(@Hos @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @Get("/{shareName}/{fileName}") @ExpectedResponses({ 200 }) @@ -1005,8 +1011,8 @@ Response getRangeListNoCustomHeadersSync(@HostParam("url") S @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}/{fileName}") @ExpectedResponses({ 202 }) @@ -1511,6 +1517,54 @@ Response createHardLinkNoCustomHeadersSync(@HostParam("url") String url, @HeaderParam("x-ms-file-target-file") String targetFile, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, @HeaderParam("Accept") String accept, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) + Mono> getRangeListNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) + Mono> getRangeListNextNoCustomHeaders( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) + ResponseBase getRangeListNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) + Response getRangeListNextNoCustomHeadersSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, + @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @HeaderParam("Accept") String accept, + Context context); } /** @@ -6557,19 +6611,30 @@ public Response uploadRangeFromURLNoCustomHeadersWithResponse(String share * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRangeListWithResponseAsync( - String shareName, String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, - String range, String leaseId, Boolean supportRename) { + public Mono> getRangeListSinglePageAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults) { + final String comp = "rangelist"; + final String accept = "application/xml"; return FluxUtil - .withContext(context -> getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, - timeout, range, leaseId, supportRename, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + .withContext(context -> service.getRangeList(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, + prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, marker, maxresults, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** @@ -6591,23 +6656,31 @@ public Mono> getRange * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link ResponseBase} on successful completion of {@link Mono}. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRangeListWithResponseAsync( - String shareName, String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, - String range, String leaseId, Boolean supportRename, Context context) { + public Mono> getRangeListSinglePageAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; return service .getRangeList(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + this.client.getFileRequestIntent(), supportRename, marker, maxresults, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); } /** @@ -6629,18 +6702,25 @@ public Mono> getRange * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges on successful completion of {@link Mono}. + * @return the list of file ranges as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRangeListAsync(String shareName, String fileName, String sharesnapshot, - String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename) { - return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getRangeListAsync(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults) { + return new PagedFlux<>( + () -> getRangeListSinglePageAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, + leaseId, supportRename, marker, maxresults), + nextLink -> getRangeListNextSinglePageAsync(nextLink, range, leaseId, supportRename)); } /** @@ -6662,20 +6742,26 @@ public Mono getRangeListAsync(String shareName, String fileN * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges on successful completion of {@link Mono}. + * @return the list of file ranges as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRangeListAsync(String shareName, String fileName, String sharesnapshot, - String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, - Context context) { - return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getRangeListAsync(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults, Context context) { + return new PagedFlux<>( + () -> getRangeListSinglePageAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, + leaseId, supportRename, marker, maxresults, context), + nextLink -> getRangeListNextSinglePageAsync(nextLink, range, leaseId, supportRename, context)); } /** @@ -6697,19 +6783,31 @@ public Mono getRangeListAsync(String shareName, String fileN * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link Response} on successful completion of {@link Mono}. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRangeListNoCustomHeadersWithResponseAsync(String shareName, - String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, - Boolean supportRename) { + public Mono> getRangeListNoCustomHeadersSinglePageAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults) { + final String comp = "rangelist"; + final String accept = "application/xml"; return FluxUtil - .withContext(context -> getRangeListNoCustomHeadersWithResponseAsync(shareName, fileName, sharesnapshot, - prevsharesnapshot, timeout, range, leaseId, supportRename, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + .withContext(context -> service.getRangeListNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, + sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, marker, maxresults, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null)); } /** @@ -6731,23 +6829,71 @@ public Mono> getRangeListNoCustomHeadersWithRespons * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link Response} on successful completion of {@link Mono}. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRangeListNoCustomHeadersWithResponseAsync(String shareName, - String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, - Boolean supportRename, Context context) { + public Mono> getRangeListNoCustomHeadersSinglePageAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults, Context context) { final String comp = "rangelist"; final String accept = "application/xml"; return service .getRangeListNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + this.client.getFileRequestIntent(), supportRename, marker, maxresults, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null)); + } + + /** + * Returns the list of valid ranges for a file. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getRangeListNoCustomHeadersAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults) { + return new PagedFlux<>( + () -> getRangeListNoCustomHeadersSinglePageAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, + timeout, range, leaseId, supportRename, marker, maxresults), + nextLink -> getRangeListNextSinglePageAsync(nextLink, range, leaseId, supportRename)); } /** @@ -6769,25 +6915,26 @@ public Mono> getRangeListNoCustomHeadersWithRespons * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link ResponseBase}. + * @return the list of file ranges as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getRangeListWithResponse(String shareName, - String fileName, String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, - Boolean supportRename, Context context) { - try { - final String comp = "rangelist"; - final String accept = "application/xml"; - return service.getRangeListSync(this.client.getUrl(), shareName, fileName, comp, sharesnapshot, - prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), supportRename, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getRangeListNoCustomHeadersAsync(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults, Context context) { + return new PagedFlux<>( + () -> getRangeListNoCustomHeadersSinglePageAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, + timeout, range, leaseId, supportRename, marker, maxresults, context), + nextLink -> getRangeListNextSinglePageAsync(nextLink, range, leaseId, supportRename, context)); } /** @@ -6809,17 +6956,30 @@ public ResponseBase getRangeListWi * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges. + * @return the list of file ranges along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareFileRangeList getRangeList(String shareName, String fileName, String sharesnapshot, - String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename) { + public PagedResponse getRangeListSinglePage(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults) { try { - return getRangeListWithResponse(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename, Context.NONE).getValue(); + final String comp = "rangelist"; + final String accept = "application/xml"; + ResponseBase res = service.getRangeListSync( + this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, timeout, + this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, marker, maxresults, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -6844,109 +7004,377 @@ public ShareFileRangeList getRangeList(String shareName, String fileName, String * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of file ranges along with {@link Response}. + * @return the list of file ranges along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRangeListNoCustomHeadersWithResponse(String shareName, String fileName, - String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, - Boolean supportRename, Context context) { + public PagedResponse getRangeListSinglePage(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults, Context context) { try { final String comp = "rangelist"; final String accept = "application/xml"; - return service.getRangeListNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, - sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context); + ResponseBase res = service.getRangeListSync( + this.client.getUrl(), shareName, fileName, comp, sharesnapshot, prevsharesnapshot, timeout, + this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, marker, maxresults, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Copies a blob or file to a destination file within the storage account. + * Returns the list of valid ranges for a file. * * @param shareName The name of the target share. * @param fileName The path of the target file. - * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another - * file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying - * a file from another storage account, or if you are copying a blob from the same storage account or another - * storage account, then you must authenticate the source file or blob using a shared access signature. If the - * source is a public blob, no authentication is required to perform the copy operation. A file in a share snapshot - * can also be specified as a copy source. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting * Timeouts for File Service Operations.</a>. - * @param metadata A name-value pair to associate with a file storage object. - * @param filePermission If specified the permission (security descriptor) shall be set for the directory/file. This - * header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default - * value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the - * x-ms-file-permission or x-ms-file-permission-key should be specified. - * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which - * the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified - * or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is - * explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the - * permission. - * @param filePermissionKey Key of the permission to be set for the directory/file. Note: Only one of the - * x-ms-file-permission or x-ms-file-permission-key should be specified. + * @param range Specifies the range of bytes over which to list ranges, inclusively. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param owner Optional, NFS only. The owner of the file or directory. - * @param group Optional, NFS only. The owning group of the file or directory. - * @param fileMode Optional, NFS only. The file mode of the file or directory. - * @param fileModeCopyMode NFS only. Applicable only when the copy source is a File. Determines the copy behavior of - * the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The - * mode on the destination file is determined via the x-ms-mode header. - * @param fileOwnerCopyMode NFS only. Determines the copy behavior of the owner user identifier (UID) and group - * identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the - * destination file is copied from the source file. override: The owner user identifier (UID) and group identifier - * (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers. - * @param copyFileSmbInfo Parameter group. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @return the list of file ranges as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyWithResponseAsync(String shareName, String fileName, - String copySource, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String leaseId, String owner, String group, - String fileMode, ModeCopyMode fileModeCopyMode, OwnerCopyMode fileOwnerCopyMode, - CopyFileSmbInfo copyFileSmbInfo) { - return FluxUtil - .withContext(context -> startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, - filePermission, filePermissionFormat, filePermissionKey, leaseId, owner, group, fileMode, - fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getRangeList(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults) { + return new PagedIterable<>( + () -> getRangeListSinglePage(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, leaseId, + supportRename, marker, maxresults), + nextLink -> getRangeListNextSinglePage(nextLink, range, leaseId, supportRename)); } /** - * Copies a blob or file to a destination file within the storage account. + * Returns the list of valid ranges for a file. * * @param shareName The name of the target share. * @param fileName The path of the target file. - * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another - * file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying - * a file from another storage account, or if you are copying a blob from the same storage account or another - * storage account, then you must authenticate the source file or blob using a shared access signature. If the - * source is a public blob, no authentication is required to perform the copy operation. A file in a share snapshot - * can also be specified as a copy source. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. * @param timeout The timeout parameter is expressed in seconds. For more information, see <a * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting * Timeouts for File Service Operations.</a>. - * @param metadata A name-value pair to associate with a file storage object. - * @param filePermission If specified the permission (security descriptor) shall be set for the directory/file. This - * header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default - * value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the - * x-ms-file-permission or x-ms-file-permission-key should be specified. - * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which - * the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified - * or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is - * explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the - * permission. - * @param filePermissionKey Key of the permission to be set for the directory/file. Note: Only one of the - * x-ms-file-permission or x-ms-file-permission-key should be specified. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getRangeList(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults, Context context) { + return new PagedIterable<>( + () -> getRangeListSinglePage(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, leaseId, + supportRename, marker, maxresults, context), + nextLink -> getRangeListNextSinglePage(nextLink, range, leaseId, supportRename, context)); + } + + /** + * Returns the list of valid ranges for a file. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNoCustomHeadersSinglePage(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults) { + try { + final String comp = "rangelist"; + final String accept = "application/xml"; + Response res = service.getRangeListNoCustomHeadersSync(this.client.getUrl(), shareName, + fileName, comp, sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, marker, maxresults, + accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Returns the list of valid ranges for a file. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNoCustomHeadersSinglePage(String shareName, String fileName, + String sharesnapshot, String prevsharesnapshot, Integer timeout, String range, String leaseId, + Boolean supportRename, String marker, Integer maxresults, Context context) { + try { + final String comp = "rangelist"; + final String accept = "application/xml"; + Response res = service.getRangeListNoCustomHeadersSync(this.client.getUrl(), shareName, + fileName, comp, sharesnapshot, prevsharesnapshot, timeout, this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, marker, maxresults, + accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Returns the list of valid ranges for a file. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getRangeListNoCustomHeaders(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults) { + return new PagedIterable<>( + () -> getRangeListNoCustomHeadersSinglePage(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, + range, leaseId, supportRename, marker, maxresults), + nextLink -> getRangeListNextSinglePage(nextLink, range, leaseId, supportRename)); + } + + /** + * Returns the list of valid ranges for a file. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share + * snapshot to query. + * @param prevsharesnapshot The previous snapshot parameter is an opaque DateTime value that, when present, + * specifies the previous snapshot. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param marker A string value that identifies the portion of the list to be returned with the next list operation. + * The operation returns a marker value within the response body if the list returned was not complete. The marker + * value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to + * the client. + * @param maxresults Specifies the maximum number of entries to return. If the request does not specify maxresults, + * or specifies a value greater than 5,000, the server will return up to 5,000 items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getRangeListNoCustomHeaders(String shareName, String fileName, String sharesnapshot, + String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, + Integer maxresults, Context context) { + return new PagedIterable<>( + () -> getRangeListNoCustomHeadersSinglePage(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, + range, leaseId, supportRename, marker, maxresults, context), + nextLink -> getRangeListNextSinglePage(nextLink, range, leaseId, supportRename, context)); + } + + /** + * Copies a blob or file to a destination file within the storage account. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another + * file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying + * a file from another storage account, or if you are copying a blob from the same storage account or another + * storage account, then you must authenticate the source file or blob using a shared access signature. If the + * source is a public blob, no authentication is required to perform the copy operation. A file in a share snapshot + * can also be specified as a copy source. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param metadata A name-value pair to associate with a file storage object. + * @param filePermission If specified the permission (security descriptor) shall be set for the directory/file. This + * header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default + * value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the + * x-ms-file-permission or x-ms-file-permission-key should be specified. + * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which + * the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified + * or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is + * explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the + * permission. + * @param filePermissionKey Key of the permission to be set for the directory/file. Note: Only one of the + * x-ms-file-permission or x-ms-file-permission-key should be specified. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param owner Optional, NFS only. The owner of the file or directory. + * @param group Optional, NFS only. The owning group of the file or directory. + * @param fileMode Optional, NFS only. The file mode of the file or directory. + * @param fileModeCopyMode NFS only. Applicable only when the copy source is a File. Determines the copy behavior of + * the mode bits of the file. source: The mode on the destination file is copied from the source file. override: The + * mode on the destination file is determined via the x-ms-mode header. + * @param fileOwnerCopyMode NFS only. Determines the copy behavior of the owner user identifier (UID) and group + * identifier (GID) of the file. source: The owner user identifier (UID) and group identifier (GID) on the + * destination file is copied from the source file. override: The owner user identifier (UID) and group identifier + * (GID) on the destination file is determined via the x-ms-owner and x-ms-group headers. + * @param copyFileSmbInfo Parameter group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link ResponseBase} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> startCopyWithResponseAsync(String shareName, String fileName, + String copySource, Integer timeout, Map metadata, String filePermission, + FilePermissionFormat filePermissionFormat, String filePermissionKey, String leaseId, String owner, String group, + String fileMode, ModeCopyMode fileModeCopyMode, OwnerCopyMode fileOwnerCopyMode, + CopyFileSmbInfo copyFileSmbInfo) { + return FluxUtil + .withContext(context -> startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, + filePermission, filePermissionFormat, filePermissionKey, leaseId, owner, group, fileMode, + fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Copies a blob or file to a destination file within the storage account. + * + * @param shareName The name of the target share. + * @param fileName The path of the target file. + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another + * file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying + * a file from another storage account, or if you are copying a blob from the same storage account or another + * storage account, then you must authenticate the source file or blob using a shared access signature. If the + * source is a public blob, no authentication is required to perform the copy operation. A file in a share snapshot + * can also be specified as a copy source. + * @param timeout The timeout parameter is expressed in seconds. For more information, see <a + * href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting + * Timeouts for File Service Operations.</a>. + * @param metadata A name-value pair to associate with a file storage object. + * @param filePermission If specified the permission (security descriptor) shall be set for the directory/file. This + * header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default + * value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the + * x-ms-file-permission or x-ms-file-permission-key should be specified. + * @param filePermissionFormat Optional. Available for version 2023-06-01 and later. Specifies the format in which + * the permission is returned. Acceptable values are SDDL or binary. If x-ms-file-permission-format is unspecified + * or explicitly set to SDDL, the permission is returned in SDDL format. If x-ms-file-permission-format is + * explicitly set to binary, the permission is returned as a base64 string representing the binary encoding of the + * permission. + * @param filePermissionKey Key of the permission to be set for the directory/file. Note: Only one of the + * x-ms-file-permission or x-ms-file-permission-key should be specified. * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. * @param owner Optional, NFS only. The owner of the file or directory. * @param group Optional, NFS only. The owning group of the file or directory. @@ -9808,4 +10236,246 @@ public Response createHardLinkNoCustomHeadersWithResponse(String shareName throw ModelHelper.mapToShareStorageException(internalException); } } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRangeListNextSinglePageAsync(String nextLink, String range, String leaseId, + Boolean supportRename) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.getRangeListNext(nextLink, this.client.getUrl(), this.client.getVersion(), + range, leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, + accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRangeListNextSinglePageAsync(String nextLink, String range, String leaseId, + Boolean supportRename, Context context) { + final String accept = "application/xml"; + return service + .getRangeListNext(nextLink, this.client.getUrl(), this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRangeListNextNoCustomHeadersSinglePageAsync(String nextLink, String range, + String leaseId, Boolean supportRename) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.getRangeListNextNoCustomHeaders(nextLink, this.client.getUrl(), + this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRangeListNextNoCustomHeadersSinglePageAsync(String nextLink, String range, + String leaseId, Boolean supportRename, Context context) { + final String accept = "application/xml"; + return service + .getRangeListNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), range, leaseId, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), supportRename, accept, context) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNextSinglePage(String nextLink, String range, String leaseId, + Boolean supportRename) { + try { + final String accept = "application/xml"; + ResponseBase res = service.getRangeListNextSync(nextLink, + this.client.getUrl(), this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNextSinglePage(String nextLink, String range, String leaseId, + Boolean supportRename, Context context) { + try { + final String accept = "application/xml"; + ResponseBase res = service.getRangeListNextSync(nextLink, + this.client.getUrl(), this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNextNoCustomHeadersSinglePage(String nextLink, String range, + String leaseId, Boolean supportRename) { + try { + final String accept = "application/xml"; + Response res = service.getRangeListNextNoCustomHeadersSync(nextLink, + this.client.getUrl(), this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param range Specifies the range of bytes over which to list ranges, inclusively. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param supportRename This header is allowed only when PrevShareSnapshot query parameter is set. Determines + * whether the changed ranges for a file that has been renamed or moved between the target snapshot (or the live + * file) and the previous snapshot should be listed. If the value is true, the valid changed ranges for the file + * will be returned. If the value is false, the operation will result in a failure with 409 (Conflict) response. The + * default value is false. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getRangeListNextNoCustomHeadersSinglePage(String nextLink, String range, + String leaseId, Boolean supportRename, Context context) { + try { + final String accept = "application/xml"; + Response res = service.getRangeListNextNoCustomHeadersSync(nextLink, + this.client.getUrl(), this.client.getVersion(), range, leaseId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), supportRename, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getRanges(), res.getValue().getNextMarker(), null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListNextHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListNextHeaders.java new file mode 100644 index 000000000000..7cfca8e3f003 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesGetRangeListNextHeaders.java @@ -0,0 +1,234 @@ +// 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.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.DateTimeRfc1123; +import java.time.OffsetDateTime; + +/** + * The FilesGetRangeListNextHeaders model. + */ +@Fluent +public final class FilesGetRangeListNextHeaders { + /* + * The Last-Modified property. + */ + @Generated + private DateTimeRfc1123 lastModified; + + /* + * The ETag property. + */ + @Generated + private String eTag; + + /* + * The x-ms-content-length property. + */ + @Generated + private Long xMsContentLength; + + /* + * The x-ms-request-id property. + */ + @Generated + private String xMsRequestId; + + /* + * The x-ms-version property. + */ + @Generated + private String xMsVersion; + + /* + * The Date property. + */ + @Generated + private DateTimeRfc1123 date; + + private static final HttpHeaderName X_MS_CONTENT_LENGTH = HttpHeaderName.fromString("x-ms-content-length"); + + private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of FilesGetRangeListNextHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public FilesGetRangeListNextHeaders(HttpHeaders rawHeaders) { + String lastModified = rawHeaders.getValue(HttpHeaderName.LAST_MODIFIED); + if (lastModified != null) { + this.lastModified = new DateTimeRfc1123(lastModified); + } else { + this.lastModified = null; + } + this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); + String xMsContentLength = rawHeaders.getValue(X_MS_CONTENT_LENGTH); + if (xMsContentLength != null) { + this.xMsContentLength = Long.parseLong(xMsContentLength); + } else { + this.xMsContentLength = null; + } + this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID); + this.xMsVersion = rawHeaders.getValue(X_MS_VERSION); + String date = rawHeaders.getValue(HttpHeaderName.DATE); + if (date != null) { + this.date = new DateTimeRfc1123(date); + } else { + this.date = null; + } + } + + /** + * Get the lastModified property: The Last-Modified property. + * + * @return the lastModified value. + */ + @Generated + public OffsetDateTime getLastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.getDateTime(); + } + + /** + * Set the lastModified property: The Last-Modified property. + * + * @param lastModified the lastModified value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setLastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + @Generated + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the xMsContentLength property: The x-ms-content-length property. + * + * @return the xMsContentLength value. + */ + @Generated + public Long getXMsContentLength() { + return this.xMsContentLength; + } + + /** + * Set the xMsContentLength property: The x-ms-content-length property. + * + * @param xMsContentLength the xMsContentLength value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setXMsContentLength(Long xMsContentLength) { + this.xMsContentLength = xMsContentLength; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + @Generated + public String getXMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsVersion property: The x-ms-version property. + * + * @return the xMsVersion value. + */ + @Generated + public String getXMsVersion() { + return this.xMsVersion; + } + + /** + * Set the xMsVersion property: The x-ms-version property. + * + * @param xMsVersion the xMsVersion value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setXMsVersion(String xMsVersion) { + this.xMsVersion = xMsVersion; + return this; + } + + /** + * Get the date property: The Date property. + * + * @return the date value. + */ + @Generated + public OffsetDateTime getDate() { + if (this.date == null) { + return null; + } + return this.date.getDateTime(); + } + + /** + * Set the date property: The Date property. + * + * @param date the date value to set. + * @return the FilesGetRangeListNextHeaders object itself. + */ + @Generated + public FilesGetRangeListNextHeaders setDate(OffsetDateTime date) { + if (date == null) { + this.date = null; + } else { + this.date = new DateTimeRfc1123(date); + } + 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 index 9f670646d07c..17df7e78798a 100644 --- 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 @@ -32,6 +32,12 @@ public final class ShareFileRangeList implements XmlSerializable clearRanges = new ArrayList<>(); + /* + * The NextMarker property. + */ + @Generated + private String nextMarker; + /** * Creates an instance of ShareFileRangeList class. */ @@ -83,6 +89,28 @@ public ShareFileRangeList setClearRanges(List clearRanges) { return this; } + /** + * Get the nextMarker property: The NextMarker property. + * + * @return the nextMarker value. + */ + @Generated + public String getNextMarker() { + return this.nextMarker; + } + + /** + * Set the nextMarker property: The NextMarker property. + * + * @param nextMarker the nextMarker value to set. + * @return the ShareFileRangeList object itself. + */ + @Generated + public ShareFileRangeList setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + return this; + } + @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -104,6 +132,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeXml(element, "ClearRange"); } } + xmlWriter.writeStringElement("NextMarker", this.nextMarker); return xmlWriter.writeEndElement(); } @@ -142,6 +171,8 @@ public static ShareFileRangeList fromXml(XmlReader xmlReader, String rootElement deserializedShareFileRangeList.ranges.add(FileRange.fromXml(reader, "Range")); } else if ("ClearRange".equals(elementName.getLocalPart())) { deserializedShareFileRangeList.clearRanges.add(ClearRange.fromXml(reader, "ClearRange")); + } else if ("NextMarker".equals(elementName.getLocalPart())) { + deserializedShareFileRangeList.nextMarker = reader.getStringElement(); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 41515fb4e938..5e26f362a99f 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -16,7 +16,7 @@ autorest ### Code generation settings ``` yaml use: '@autorest/java@4.1.63' -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/15d7f54a5389d5906ffb4e56bb2f38fe5525c0d3/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-06-06/file.json +input-file: https://raw.githubusercontent.com/seanmcc-msft/azure-rest-api-specs/f53f87c5060eb66b7c76b7c1123f961c725e5de4/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-10-06/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share @@ -401,6 +401,15 @@ directive: delete $["x-ms-pageable"]; ``` +### Delete File_GetRangeList x-ms-pageable as autorest does not currently support multiple return types for pageable +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{shareName}/{fileName}?comp=rangelist"].get + transform: > + $["x-ms-pageable"].itemName = "Ranges"; +``` + ### Change PutRange response file-last-write-time to ISO8601 ``` yaml directive: