diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java index 4f9c29bc7d9c..119f6293cd42 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java @@ -12,8 +12,10 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; @@ -23,6 +25,7 @@ import com.azure.storage.file.share.implementation.AzureFileStorageImpl; import com.azure.storage.file.share.implementation.models.SharePermission; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.ShareFileHttpHeaders; @@ -367,11 +370,8 @@ Mono> createWithResponse(ShareCreateOptions options, Context String enabledProtocol = options.getProtocols() == null ? null : options.getProtocols().toString(); enabledProtocol = "".equals(enabledProtocol) ? null : enabledProtocol; return azureFileStorageClient.getShares() - .createNoCustomHeadersWithResponseAsync(shareName, null, options.getMetadata(), options.getQuotaInGb(), - options.getAccessTier(), enabledProtocol, options.getRootSquash(), - options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), - options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + .createWithResponseAsync( + RequestOptionsHelper.createShareRequestOptions(shareName, options, enabledProtocol, context)) .map(ModelHelper::mapToShareInfoResponse); } @@ -519,9 +519,12 @@ public Mono> createSnapshotWithResponse(Map> createSnapshotWithResponse(Map metadata, Context context) { - context = context == null ? Context.NONE : context; + Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, metadata); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .createSnapshotWithResponseAsync(shareName, null, metadata, context) + .createSnapshotWithResponseAsync(requestOptions) .map(ModelHelper::mapCreateSnapshotResponse); } @@ -620,11 +623,13 @@ Mono> deleteWithResponse(ShareDeleteOptions options, Context cont options = options == null ? new ShareDeleteOptions() : options; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - context = context == null ? Context.NONE : context; - return azureFileStorageClient.getShares() - .deleteNoCustomHeadersWithResponseAsync(shareName, snapshot, null, - ModelHelper.toDeleteSnapshotsOptionType(options.getDeleteSnapshotsOptions()), - requestConditions.getLeaseId(), context); + Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addDeleteSnapshotsHeader(requestOptions, options.getDeleteSnapshotsOptions()); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + return azureFileStorageClient.getShares().deleteWithResponseAsync(requestOptions); } /** @@ -802,9 +807,13 @@ Mono> getPropertiesWithResponse(ShareGetPropertiesOpti options = options == null ? new ShareGetPropertiesOptions() : options; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - context = context == null ? Context.NONE : context; + Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .getPropertiesWithResponseAsync(shareName, snapshot, null, requestConditions.getLeaseId(), context) + .getPropertiesWithResponseAsync(requestOptions) .map(ModelHelper::mapGetPropertiesResponse); } @@ -936,11 +945,8 @@ Mono> setPropertiesWithResponse(ShareSetPropertiesOptions op = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); context = context == null ? Context.NONE : context; return azureFileStorageClient.getShares() - .setPropertiesNoCustomHeadersWithResponseAsync(shareName, null, options.getQuotaInGb(), - options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), - options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), - options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + .setPropertiesWithResponseAsync(RequestOptionsHelper.setSharePropertiesRequestOptions(shareName, options, + requestConditions.getLeaseId(), context)) .map(ModelHelper::mapToShareInfoResponse); } @@ -1062,10 +1068,13 @@ Mono> setMetadataWithResponse(ShareSetMetadataOptions option options = options == null ? new ShareSetMetadataOptions() : options; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - context = context == null ? Context.NONE : context; + Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, options.getMetadata()); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .setMetadataNoCustomHeadersWithResponseAsync(shareName, null, options.getMetadata(), - requestConditions.getLeaseId(), context) + .setMetadataWithResponseAsync(requestOptions) .map(ModelHelper::mapToShareInfoResponse); } @@ -1127,11 +1136,13 @@ public PagedFlux getAccessPolicy(ShareGetAccessPolicyOpti ? new ShareRequestConditions() : finalOptions.getRequestConditions(); try { + RequestOptions requestOptions = new RequestOptions().setContext(Context.NONE); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); Function>> retriever = marker -> this.azureFileStorageClient.getShares() - .getAccessPolicyWithResponseAsync(shareName, null, requestConditions.getLeaseId(), Context.NONE) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().items(), null, response.getDeserializedHeaders())); + .getAccessPolicyWithResponseAsync(requestOptions) + .map(ModelHelper::mapGetAccessPolicyResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } catch (RuntimeException ex) { @@ -1254,9 +1265,10 @@ Mono> setAccessPolicyWithResponse(ShareSetAccessPolicyOption context = context == null ? Context.NONE : context; + RequestOptions requestOptions = RequestOptionsHelper.setAccessPolicyRequestOptions(shareName, permissions, + requestConditions.getLeaseId(), context); return azureFileStorageClient.getShares() - .setAccessPolicyNoCustomHeadersWithResponseAsync(shareName, null, requestConditions.getLeaseId(), - permissions, context) + .setAccessPolicyWithResponseAsync(requestOptions) .map(ModelHelper::mapToShareInfoResponse); } @@ -1345,9 +1357,12 @@ Mono> getStatisticsWithResponse(ShareGetStatisticsOpti options = options == null ? new ShareGetStatisticsOptions() : options; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - context = context == null ? Context.NONE : context; + Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .getStatisticsNoCustomHeadersWithResponseAsync(shareName, null, requestConditions.getLeaseId(), context) + .getStatisticsWithResponseAsync(requestOptions) .map(ModelHelper::mapGetStatisticsResponse); } @@ -2135,12 +2150,12 @@ public Mono> createPermissionWithResponse(ShareFilePermission f Mono> createPermissionWithResponse(String filePermission, FilePermissionFormat filePermissionFormat, Context context) { // NOTE: Should we check for null or empty? - SharePermission sharePermission - = new SharePermission().setPermission(filePermission).setFormat(filePermissionFormat); + SharePermission sharePermission = new SharePermission(filePermission).setFormat(filePermissionFormat); + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .createPermissionWithResponseAsync(shareName, sharePermission, null, context) - .map(response -> new SimpleResponse<>(response, - response.getDeserializedHeaders().getXMsFilePermissionKey())); + .createPermissionWithResponseAsync(BinaryData.fromObject(sharePermission), requestOptions) + .map(ModelHelper::mapCreatePermissionResponse); } /** @@ -2244,9 +2259,12 @@ public Mono> getPermissionWithResponse(String filePermissionKey Mono> getPermissionWithResponse(String filePermissionKey, FilePermissionFormat filePermissionFormat, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.addFilePermissionFormat(requestOptions, filePermissionFormat); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); return azureFileStorageClient.getShares() - .getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, null, context) - .map(response -> new SimpleResponse<>(response, response.getValue().getPermission())); + .getPermissionWithResponseAsync(filePermissionKey, requestOptions) + .map(ModelHelper::mapGetPermissionResponse); } /** diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java index 5eddfa88edf7..e4fa936b5bf2 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java @@ -13,9 +13,11 @@ 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.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.StorageSharedKeyCredential; @@ -26,11 +28,11 @@ import com.azure.storage.file.share.implementation.models.ShareSignedIdentifierWrapper; import com.azure.storage.file.share.implementation.models.ShareStats; import com.azure.storage.file.share.implementation.models.SharesCreatePermissionHeaders; -import com.azure.storage.file.share.implementation.models.SharesCreateSnapshotHeaders; import com.azure.storage.file.share.implementation.models.SharesGetAccessPolicyHeaders; import com.azure.storage.file.share.implementation.models.SharesGetPermissionHeaders; import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.FilePermissionFormat; import com.azure.storage.file.share.models.ShareDirectoryInfo; @@ -364,12 +366,8 @@ public Response createWithResponse(ShareCreateOptions options, Durati String finalEnabledProtocol = "".equals(enabledProtocol) ? null : enabledProtocol; Callable> operation = () -> azureFileStorageClient.getShares() - .createNoCustomHeadersWithResponse(shareName, null, finalOptions.getMetadata(), finalOptions.getQuotaInGb(), - finalOptions.getAccessTier(), finalEnabledProtocol, finalOptions.getRootSquash(), - finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(), - finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), - finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), null, - finalContext); + .createWithResponse(RequestOptionsHelper.createShareRequestOptions(shareName, finalOptions, + finalEnabledProtocol, finalContext)); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -505,8 +503,11 @@ public ShareSnapshotInfo createSnapshot() { public Response createSnapshotWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> azureFileStorageClient.getShares() - .createSnapshotWithResponse(shareName, null, metadata, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, metadata); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> azureFileStorageClient.getShares().createSnapshotWithResponse(requestOptions); return ModelHelper.mapCreateSnapshotResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -599,10 +600,13 @@ public Response deleteWithResponse(ShareDeleteOptions options, Duration ti ? new ShareRequestConditions() : finalOptions.getRequestConditions(); - Callable> operation = () -> this.azureFileStorageClient.getShares() - .deleteNoCustomHeadersWithResponse(shareName, snapshot, null, - ModelHelper.toDeleteSnapshotsOptionType(finalOptions.getDeleteSnapshotsOptions()), - requestConditions.getLeaseId(), finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addDeleteSnapshotsHeader(requestOptions, finalOptions.getDeleteSnapshotsOptions()); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> this.azureFileStorageClient.getShares().deleteWithResponse(requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -768,8 +772,12 @@ public Response getPropertiesWithResponse(ShareGetPropertiesOpt Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - Callable> operation = () -> azureFileStorageClient.getShares() - .getPropertiesWithResponse(shareName, snapshot, null, requestConditions.getLeaseId(), finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> azureFileStorageClient.getShares().getPropertiesWithResponse(requestOptions); return ModelHelper.mapGetPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -895,11 +903,8 @@ public Response setPropertiesWithResponse(ShareSetPropertiesOptions o Context finalContext = context == null ? Context.NONE : context; Callable> operation = () -> this.azureFileStorageClient.getShares() - .setPropertiesNoCustomHeadersWithResponse(shareName, null, options.getQuotaInGb(), options.getAccessTier(), - requestConditions.getLeaseId(), options.getRootSquash(), - options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), - options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, finalContext); + .setPropertiesWithResponse(RequestOptionsHelper.setSharePropertiesRequestOptions(shareName, options, + requestConditions.getLeaseId(), finalContext)); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1015,9 +1020,12 @@ public Response setMetadataWithResponse(ShareSetMetadataOptions optio = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getShares() - .setMetadataNoCustomHeadersWithResponse(shareName, null, options.getMetadata(), - requestConditions.getLeaseId(), finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, options.getMetadata()); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> this.azureFileStorageClient.getShares().setMetadataWithResponse(requestOptions); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1081,14 +1089,12 @@ public PagedIterable getAccessPolicy(ShareGetAccessPolicy ? new ShareRequestConditions() : finalOptions.getRequestConditions(); - ResponseBase responseBase - = this.azureFileStorageClient.getShares() - .getAccessPolicyWithResponse(shareName, null, requestConditions.getLeaseId(), Context.NONE); + RequestOptions requestOptions = new RequestOptions().setContext(Context.NONE); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); - Supplier> response - = () -> new PagedResponseBase<>(responseBase.getRequest(), responseBase.getStatusCode(), - responseBase.getHeaders(), responseBase.getValue().items(), null, - responseBase.getDeserializedHeaders()); + Supplier> response = () -> ModelHelper.mapGetAccessPolicyResponse( + this.azureFileStorageClient.getShares().getAccessPolicyWithResponse(requestOptions)); return new PagedIterable<>(response); } @@ -1213,9 +1219,10 @@ public Response setAccessPolicyWithResponse(ShareSetAccessPolicyOptio = ModelHelper.truncateAccessPolicyPermissionsToSeconds(options.getPermissions()); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getShares() - .setAccessPolicyNoCustomHeadersWithResponse(shareName, null, requestConditions.getLeaseId(), permissions, - finalContext); + RequestOptions requestOptions = RequestOptionsHelper.setAccessPolicyRequestOptions(shareName, permissions, + requestConditions.getLeaseId(), finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getShares().setAccessPolicyWithResponse(requestOptions); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1307,8 +1314,11 @@ public Response getStatisticsWithResponse(ShareGetStatisticsOpt = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getShares() - .getStatisticsNoCustomHeadersWithResponse(shareName, null, requestConditions.getLeaseId(), finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> this.azureFileStorageClient.getShares().getStatisticsWithResponse(requestOptions); return ModelHelper.mapGetStatisticsResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1977,11 +1987,12 @@ public String createPermission(ShareFilePermission filePermission) { @ServiceMethod(returns = ReturnType.SINGLE) public Response createPermissionWithResponse(String filePermission, Context context) { Context finalContext = context == null ? Context.NONE : context; - SharePermission sharePermission = new SharePermission().setPermission(filePermission); - ResponseBase response = this.azureFileStorageClient.getShares() - .createPermissionWithResponse(shareName, sharePermission, null, finalContext); + SharePermission sharePermission = new SharePermission(filePermission); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsFilePermissionKey()); + return ModelHelper.mapCreatePermissionResponse(this.azureFileStorageClient.getShares() + .createPermissionWithResponse(BinaryData.fromObject(sharePermission), requestOptions)); } /** @@ -2008,17 +2019,15 @@ public Response createPermissionWithResponse(String filePermission, Cont public Response createPermissionWithResponse(ShareFilePermission filePermission, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - SharePermission sharePermission = new SharePermission().setPermission(filePermission.getPermission()) - .setFormat(filePermission.getPermissionFormat()); + SharePermission sharePermission + = new SharePermission(filePermission.getPermission()).setFormat(filePermission.getPermissionFormat()); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); - Callable> operation - = () -> this.azureFileStorageClient.getShares() - .createPermissionWithResponse(shareName, sharePermission, null, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .createPermissionWithResponse(BinaryData.fromObject(sharePermission), requestOptions); - return new SimpleResponse<>(response, response.getDeserializedHeaders().getXMsFilePermissionKey()); + return ModelHelper.mapCreatePermissionResponse(sendRequest(operation, timeout, ShareStorageException.class)); } /** @@ -2085,10 +2094,11 @@ public String getPermission(String filePermissionKey, FilePermissionFormat fileP @ServiceMethod(returns = ReturnType.SINGLE) public Response getPermissionWithResponse(String filePermissionKey, Context context) { Context finalContext = context == null ? Context.NONE : context; - ResponseBase response = this.azureFileStorageClient.getShares() - .getPermissionWithResponse(shareName, filePermissionKey, null, null, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); - return new SimpleResponse<>(response, response.getValue().getPermission()); + return ModelHelper.mapGetPermissionResponse( + this.azureFileStorageClient.getShares().getPermissionWithResponse(filePermissionKey, requestOptions)); } /** @@ -2118,15 +2128,14 @@ public Response getPermissionWithResponse(String filePermissionKey, Cont public Response getPermissionWithResponse(String filePermissionKey, FilePermissionFormat filePermissionFormat, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addFilePermissionFormat(requestOptions, filePermissionFormat); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); - Callable> operation - = () -> this.azureFileStorageClient.getShares() - .getPermissionWithResponse(shareName, filePermissionKey, filePermissionFormat, null, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + Callable> operation = () -> this.azureFileStorageClient.getShares() + .getPermissionWithResponse(filePermissionKey, requestOptions); - return new SimpleResponse<>(response, response.getValue().getPermission()); + return ModelHelper.mapGetPermissionResponse(sendRequest(operation, timeout, ShareStorageException.class)); } /** diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClientBuilder.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClientBuilder.java index 60330e2073e4..82a069d83da5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClientBuilder.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClientBuilder.java @@ -675,7 +675,7 @@ AzureFileStorageImpl buildFileStorageImplClient() { endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - return new AzureFileStorageImpl(pipeline, serviceVersion.getVersion(), shareTokenIntent, endpoint, - allowTrailingDot, allowSourceTrailingDot); + return new AzureFileStorageImpl(pipeline, endpoint, shareTokenIntent, allowTrailingDot, allowSourceTrailingDot, + serviceVersion); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java index 575d1d9f9b91..99f8115e0c55 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java @@ -12,8 +12,10 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.FluxUtil; @@ -28,6 +30,7 @@ import com.azure.storage.file.share.implementation.models.ListFilesIncludeType; import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.CloseHandlesInfo; import com.azure.storage.file.share.models.FilePermissionFormat; @@ -364,11 +367,11 @@ Mono> createWithResponse(FileSmbProperties smbPrope ModelHelper.validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey()); return azureFileStorageClient.getDirectories() - .createWithResponseAsync(shareName, directoryPath, null, metadata, filePermission, filePermissionFormat, - smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), - smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), - smbProperties.getFileChangeTimeString(), posixProperties.getOwner(), posixProperties.getGroup(), - posixProperties.getFileMode(), filePropertySemantics, context) + .createWithResponseAsync(RequestOptionsHelper.createDirectoryRequestOptions(shareName + "/" + directoryPath, + metadata, filePermission, filePermissionFormat, smbProperties.getFilePermissionKey(), + smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), + smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), posixProperties, + filePropertySemantics, context)) .map(ModelHelper::mapShareDirectoryInfo); } @@ -524,8 +527,9 @@ public Mono> deleteWithResponse() { Mono> deleteWithResponse(Context context) { context = context == null ? Context.NONE : context; - return azureFileStorageClient.getDirectories() - .deleteNoCustomHeadersWithResponseAsync(shareName, directoryPath, null, context); + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); + return azureFileStorageClient.getDirectories().deleteWithResponseAsync(requestOptions); } /** @@ -661,8 +665,11 @@ public Mono> getPropertiesWithResponse() { Mono> getPropertiesWithResponse(Context context) { context = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); return azureFileStorageClient.getDirectories() - .getPropertiesWithResponseAsync(shareName, directoryPath, snapshot, null, context) + .getPropertiesWithResponseAsync(requestOptions) .map(ModelHelper::mapShareDirectoryPropertiesResponse); } @@ -778,11 +785,11 @@ Mono> setPropertiesWithResponse(FileSmbProperties s ModelHelper.validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey()); return azureFileStorageClient.getDirectories() - .setPropertiesWithResponseAsync(shareName, directoryPath, null, filePermission, filePermissionFormat, + .setPropertiesWithResponseAsync(RequestOptionsHelper.setDirectoryPropertiesRequestOptions( + shareName + "/" + directoryPath, filePermission, filePermissionFormat, smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), - smbProperties.getFileChangeTimeString(), posixProperties.getOwner(), posixProperties.getGroup(), - posixProperties.getFileMode(), context) + smbProperties.getFileChangeTimeString(), posixProperties, context)) .map(ModelHelper::mapSetPropertiesResponse); } @@ -871,8 +878,11 @@ public Mono> setMetadataWithResponse(Map Mono> setMetadataWithResponse(Map metadata, Context context) { context = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.addMetadata(requestOptions, metadata); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); return azureFileStorageClient.getDirectories() - .setMetadataWithResponseAsync(shareName, directoryPath, null, metadata, context) + .setMetadataWithResponseAsync(requestOptions) .map(ModelHelper::setShareDirectoryMetadataResponse); } @@ -997,17 +1007,13 @@ PagedFlux listFilesAndDirectoriesWithOptionalTimeout(ShareListFil // these options must be absent from request if empty or false final List finalIncludeTypes = includeTypes.isEmpty() ? null : includeTypes; - BiFunction>> retriever - = (marker, pageSize) -> StorageImplUtils - .applyOptionalTimeout(this.azureFileStorageClient.getDirectories() - .listFilesAndDirectoriesSegmentNoCustomHeadersWithResponseAsync(shareName, directoryPath, - modifiedOptions.getPrefix(), snapshot, marker, - pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, null, finalIncludeTypes, - modifiedOptions.includeExtendedInfo(), context), - timeout) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), ModelHelper.convertResponseAndGetNumOfResults(response), - response.getValue().getNextMarker(), null)); + BiFunction>> retriever = (marker, + pageSize) -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getDirectories() + .listFilesAndDirectoriesSegmentWithResponseAsync(RequestOptionsHelper + .listFilesAndDirectoriesRequestOptions(shareName + "/" + directoryPath, modifiedOptions.getPrefix(), + snapshot, marker, pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, + finalIncludeTypes, modifiedOptions.includeExtendedInfo(), context)), + timeout).map(ModelHelper::mapListFilesAndDirectoriesResponse); return new PagedFlux<>(pageSize -> retriever.apply(null, pageSize), retriever); } @@ -1046,14 +1052,14 @@ public PagedFlux listHandles(Integer maxResultPerPage, boolean recur PagedFlux listHandlesWithOptionalTimeout(Integer maxResultPerPage, boolean recursive, Duration timeout, Context context) { - Function>> retriever = marker -> StorageImplUtils - .applyOptionalTimeout(this.azureFileStorageClient.getDirectories() - .listHandlesWithResponseAsync(shareName, directoryPath, marker, maxResultPerPage, null, snapshot, - recursive, context), - timeout) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), ModelHelper.transformHandleItems(response.getValue().getHandleList()), - response.getValue().getNextMarker(), response.getDeserializedHeaders())); + Function>> retriever + = marker -> StorageImplUtils + .applyOptionalTimeout( + this.azureFileStorageClient.getDirectories() + .listHandlesWithResponseAsync(RequestOptionsHelper.listHandlesRequestOptions( + shareName + "/" + directoryPath, marker, maxResultPerPage, snapshot, recursive, context)), + timeout) + .map(ModelHelper::mapDirectoryListHandlesResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } @@ -1119,11 +1125,10 @@ public Mono> forceCloseHandleWithResponse(String hand Mono> forceCloseHandleWithResponse(String handleId, Context context) { return this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponseAsync(shareName, directoryPath, handleId, null, null, snapshot, false, - context) - .map(response -> new SimpleResponse<>(response, - new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed()))); + .forceCloseHandlesWithResponseAsync(handleId, + RequestOptionsHelper.forceCloseHandlesRequestOptions(shareName + "/" + directoryPath, null, snapshot, + false, context)) + .map(ModelHelper::mapDirectoryForceCloseHandlesResponse); } /** @@ -1163,15 +1168,11 @@ public Mono forceCloseAllHandles(boolean recursive) { PagedFlux forceCloseAllHandlesWithTimeout(boolean recursive, Duration timeout, Context context) { Function>> retriever = marker -> StorageImplUtils .applyOptionalTimeout(this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponseAsync(shareName, directoryPath, "*", null, marker, snapshot, recursive, - context), + .forceCloseHandlesWithResponseAsync("*", + RequestOptionsHelper.forceCloseHandlesRequestOptions(shareName + "/" + directoryPath, marker, + snapshot, recursive, context)), timeout) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), - Collections - .singletonList(new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())), - response.getDeserializedHeaders().getXMsMarker(), response.getDeserializedHeaders())); + .map(ModelHelper::mapDirectoryForceCloseHandlesPagedResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } @@ -1282,11 +1283,12 @@ Mono> renameWithResponse(ShareFileRenameOpti renameSource = this.sasToken != null ? renameSource + "?" + this.sasToken.getSignature() : renameSource; return destinationDirectoryClient.azureFileStorageClient.getDirectories() - .renameWithResponseAsync(destinationDirectoryClient.getShareName(), - destinationDirectoryClient.getDirectoryPath(), renameSource, null /* timeout */, - options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), - options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, - destinationConditions, smbInfo, context) + .renameWithResponseAsync(renameSource, + RequestOptionsHelper.renameDirectoryRequestOptions( + destinationDirectoryClient.getShareName() + "/" + destinationDirectoryClient.getDirectoryPath(), + options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), + options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, + destinationConditions, smbInfo, context)) .map(response -> new SimpleResponse<>(response, destinationDirectoryClient)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java index 32c7ceced009..7d5630e90ca6 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java @@ -13,9 +13,11 @@ 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.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -36,6 +38,7 @@ import com.azure.storage.file.share.implementation.models.ListHandlesResponse; import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.CloseHandlesInfo; import com.azure.storage.file.share.models.FilePosixProperties; @@ -354,13 +357,14 @@ public Response createWithResponse(ShareDirectoryCreateOptio ModelHelper.validateFilePermissionAndKey(finalOptions.getFilePermission(), smbProperties.getFilePermissionKey()); - Callable> operation = () -> azureFileStorageClient.getDirectories() - .createWithResponse(shareName, directoryPath, null, finalOptions.getMetadata(), - finalOptions.getFilePermission(), finalOptions.getFilePermissionFormat(), - smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), - smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), - smbProperties.getFileChangeTimeString(), fileposixProperties.getOwner(), fileposixProperties.getGroup(), - fileposixProperties.getFileMode(), finalOptions.getFilePropertySemantics(), finalContext); + RequestOptions requestOptions = RequestOptionsHelper.createDirectoryRequestOptions( + shareName + "/" + directoryPath, finalOptions.getMetadata(), finalOptions.getFilePermission(), + finalOptions.getFilePermissionFormat(), smbProperties.getFilePermissionKey(), + smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), + smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), fileposixProperties, + finalOptions.getFilePropertySemantics(), finalContext); + Callable> operation + = () -> azureFileStorageClient.getDirectories().createWithResponse(requestOptions); return ModelHelper.mapShareDirectoryInfo(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -495,8 +499,10 @@ public void delete() { @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getDirectories() - .deleteNoCustomHeadersWithResponse(shareName, directoryPath, null, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().deleteWithResponse(requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -623,9 +629,11 @@ public ShareDirectoryProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .getPropertiesWithResponse(shareName, directoryPath, snapshot, null, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().getPropertiesWithResponse(requestOptions); return ModelHelper .mapShareDirectoryPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); @@ -738,14 +746,13 @@ public Response setPropertiesWithResponse(ShareDirectorySetP // Checks that file permission and file permission key are valid ModelHelper.validateFilePermissionAndKey(filePermission.getPermission(), smbProperties.getFilePermissionKey()); - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .setPropertiesWithResponse(shareName, directoryPath, null, filePermission.getPermission(), - filePermission.getPermissionFormat(), smbProperties.getFilePermissionKey(), - smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), - smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), - fileposixProperties.getOwner(), fileposixProperties.getGroup(), fileposixProperties.getFileMode(), - finalContext); + RequestOptions requestOptions = RequestOptionsHelper.setDirectoryPropertiesRequestOptions( + shareName + "/" + directoryPath, filePermission.getPermission(), filePermission.getPermissionFormat(), + smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), + smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), + smbProperties.getFileChangeTimeString(), fileposixProperties, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().setPropertiesWithResponse(requestOptions); return ModelHelper.mapSetPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -832,9 +839,11 @@ public ShareDirectorySetMetadataInfo setMetadata(Map metadata) { public Response setMetadataWithResponse(Map metadata, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .setMetadataWithResponse(shareName, directoryPath, null, metadata, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, metadata); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + directoryPath); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().setMetadataWithResponse(requestOptions); return ModelHelper .setShareDirectoryMetadataResponse(sendRequest(operation, timeout, ShareStorageException.class)); @@ -964,18 +973,15 @@ public PagedIterable listFilesAndDirectories(ShareListFilesAndDir final List finalIncludeTypes = includeTypes.isEmpty() ? null : includeTypes; BiFunction> retriever = (marker, pageSize) -> { - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .listFilesAndDirectoriesSegmentNoCustomHeadersWithResponse(shareName, directoryPath, - modifiedOptions.getPrefix(), snapshot, marker, - pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, null, finalIncludeTypes, - modifiedOptions.includeExtendedInfo(), finalContext); - - Response response - = sendRequest(operation, timeout, ShareStorageException.class); - - return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - ModelHelper.convertResponseAndGetNumOfResults(response), response.getValue().getNextMarker(), null); + RequestOptions requestOptions = RequestOptionsHelper.listFilesAndDirectoriesRequestOptions( + shareName + "/" + directoryPath, modifiedOptions.getPrefix(), snapshot, marker, + pageSize == null ? modifiedOptions.getMaxResultsPerPage() : pageSize, finalIncludeTypes, + modifiedOptions.includeExtendedInfo(), finalContext); + Callable> operation = () -> this.azureFileStorageClient.getDirectories() + .listFilesAndDirectoriesSegmentWithResponse(requestOptions); + + return ModelHelper + .mapListFilesAndDirectoriesResponse(sendRequest(operation, timeout, ShareStorageException.class)); }; return new PagedIterable<>(pageSize -> retriever.apply(null, pageSize), retriever); @@ -1018,18 +1024,13 @@ PagedIterable listHandlesWithOptionalTimeout(Integer maxResultPerPag Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; Function> retriever = (marker) -> { - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .listHandlesWithResponse(shareName, directoryPath, marker, maxResultPerPage, null, snapshot, - recursive, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); - - return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - ModelHelper.transformHandleItems(response.getValue().getHandleList()), - response.getValue().getNextMarker(), response.getDeserializedHeaders()); + RequestOptions requestOptions = RequestOptionsHelper.listHandlesRequestOptions( + shareName + "/" + directoryPath, marker, maxResultPerPage, snapshot, recursive, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().listHandlesWithResponse(requestOptions); + return ModelHelper + .mapDirectoryListHandlesResponse(sendRequest(operation, timeout, ShareStorageException.class)); }; return new PagedIterable<>(() -> retriever.apply(null), retriever); } @@ -1094,17 +1095,13 @@ public CloseHandlesInfo forceCloseHandle(String handleId) { public Response forceCloseHandleWithResponse(String handleId, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponse(shareName, directoryPath, handleId, null, null, snapshot, false, - finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + RequestOptions requestOptions = RequestOptionsHelper + .forceCloseHandlesRequestOptions(shareName + "/" + directoryPath, null, snapshot, false, finalContext); + Callable> operation = () -> this.azureFileStorageClient.getDirectories() + .forceCloseHandlesWithResponse(handleId, requestOptions); - return new SimpleResponse<>(response, - new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())); + return ModelHelper + .mapDirectoryForceCloseHandlesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } /** @@ -1138,19 +1135,13 @@ public CloseHandlesInfo forceCloseAllHandles(boolean recursive, Duration timeout Context finalContext = context == null ? Context.NONE : context; Function> retriever = (marker) -> { - Callable> operation - = () -> this.azureFileStorageClient.getDirectories() - .forceCloseHandlesWithResponse(shareName, directoryPath, "*", null, marker, snapshot, recursive, - finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); - - return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - Collections - .singletonList(new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())), - response.getDeserializedHeaders().getXMsMarker(), response.getDeserializedHeaders()); + RequestOptions requestOptions = RequestOptionsHelper.forceCloseHandlesRequestOptions( + shareName + "/" + directoryPath, marker, snapshot, recursive, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getDirectories().forceCloseHandlesWithResponse("*", requestOptions); + + return ModelHelper.mapDirectoryForceCloseHandlesPagedResponse( + sendRequest(operation, timeout, ShareStorageException.class)); }; return new PagedIterable<>(() -> retriever.apply(null), retriever).stream() @@ -1264,11 +1255,12 @@ public Response renameWithResponse(ShareFileRenameOptions : this.getDirectoryUrl(); Callable> operation = () -> destinationDirectoryClient.azureFileStorageClient.getDirectories() - .renameNoCustomHeadersWithResponse(destinationDirectoryClient.getShareName(), - destinationDirectoryClient.getDirectoryPath(), renameSource, null /* timeout */, - options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), - options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, - destinationConditions, smbInfo, finalContext); + .renameWithResponse(renameSource, + RequestOptionsHelper.renameDirectoryRequestOptions( + destinationDirectoryClient.getShareName() + "/" + destinationDirectoryClient.getDirectoryPath(), + options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), + options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, + destinationConditions, smbInfo, finalContext)); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), destinationDirectoryClient); 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 c6e2bde18e29..e59cf22c8ada 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 @@ -13,6 +13,7 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; @@ -43,6 +44,7 @@ import com.azure.storage.file.share.implementation.models.ShareFileRangeWriteType; import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.CloseHandlesInfo; import com.azure.storage.file.share.models.CopyStatusType; @@ -485,13 +487,13 @@ Mono> createWithResponse(long maxSize, ShareFileHttpHead } return contentMD5Mono.flatMap(fluxMD5wrapper -> azureFileStorageClient.getFiles() - .createWithResponseAsync(shareName, filePath, maxSize, null, metadata, filePermission, filePermissionFormat, - smbPropertiesLocal.getFilePermissionKey(), smbPropertiesLocal.getNtfsFileAttributesString(), - smbPropertiesLocal.getFileCreationTimeString(), smbPropertiesLocal.getFileLastWriteTimeString(), - smbPropertiesLocal.getFileChangeTimeString(), requestConditionsLocal.getLeaseId(), - filePosixPropertiesLocal.getOwner(), filePosixPropertiesLocal.getGroup(), - filePosixPropertiesLocal.getFileMode(), filePosixPropertiesLocal.getFileType(), fluxMD5wrapper.getMd5(), - filePropertySemantics, contentLength, null, null, fluxMD5wrapper.getData(), httpHeaders, contextLocal) + .createWithResponseAsync(maxSize, + RequestOptionsHelper.createFileRequestOptions(shareName + "/" + filePath, metadata, filePermission, + filePermissionFormat, smbPropertiesLocal.getFilePermissionKey(), + smbPropertiesLocal.getNtfsFileAttributesString(), smbPropertiesLocal.getFileCreationTimeString(), + smbPropertiesLocal.getFileLastWriteTimeString(), smbPropertiesLocal.getFileChangeTimeString(), + requestConditionsLocal.getLeaseId(), filePosixPropertiesLocal, fluxMD5wrapper.getMd5(), + filePropertySemantics, httpHeaders, binaryData, contextLocal)) .map(ModelHelper::createFileInfoResponse)); } @@ -730,19 +732,20 @@ public PollerFlux beginCopy(String sourceUrl, ShareFile return new PollerFlux<>(interval, (pollingContext) -> { try { return withContext(context -> azureFileStorageClient.getFiles() - .startCopyWithResponseAsync(shareName, filePath, copySource, null, options.getMetadata(), - options.getFilePermission(), options.getFilePermissionFormat(), - tempSmbProperties.getFilePermissionKey(), finalRequestConditions.getLeaseId(), - fileposixProperties.getOwner(), fileposixProperties.getGroup(), - fileposixProperties.getFileMode(), options.getModeCopyMode(), options.getOwnerCopyMode(), - copyFileSmbInfo, context)).map(response -> { - final FilesStartCopyHeaders headers = response.getDeserializedHeaders(); - copyId.set(headers.getXMsCopyId()); - - return new ShareFileCopyInfo(sourceUrl, headers.getXMsCopyId(), headers.getXMsCopyStatus(), - headers.getETag(), headers.getLastModified(), - response.getHeaders().getValue("x-ms-error-code")); - }); + .startCopyWithResponseAsync(copySource, + RequestOptionsHelper.startCopyRequestOptions(shareName + "/" + filePath, options.getMetadata(), + options.getFilePermission(), options.getFilePermissionFormat(), + tempSmbProperties.getFilePermissionKey(), finalRequestConditions.getLeaseId(), + fileposixProperties.getOwner(), fileposixProperties.getGroup(), + fileposixProperties.getFileMode(), options.getModeCopyMode(), options.getOwnerCopyMode(), + copyFileSmbInfo, context))).map(response -> { + final FilesStartCopyHeaders headers = new FilesStartCopyHeaders(response.getHeaders()); + copyId.set(headers.getXMsCopyId()); + + return new ShareFileCopyInfo(sourceUrl, headers.getXMsCopyId(), + headers.getXMsCopyStatus(), headers.getETag(), headers.getLastModified(), + response.getHeaders().getValue("x-ms-error-code")); + }); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -880,8 +883,8 @@ Mono> abortCopyWithResponse(String copyId, ShareRequestConditions Context context) { requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; return azureFileStorageClient.getFiles() - .abortCopyNoCustomHeadersWithResponseAsync(shareName, filePath, copyId, null, - requestConditions.getLeaseId(), context); + .abortCopyWithResponseAsync(copyId, RequestOptionsHelper + .addLeaseIdRequestOptions(shareName + "/" + filePath, requestConditions.getLeaseId(), context)); } /** @@ -1256,8 +1259,10 @@ private Mono>> downloadRange Boolean rangeGetContentMD5, ShareRequestConditions requestConditions, Context context) { String rangeString = range == null ? null : range.toHeaderValue(); return azureFileStorageClient.getFiles() - .downloadWithResponseAsync(shareName, filePath, null, rangeString, rangeGetContentMD5, null, - requestConditions.getLeaseId(), context); + .downloadWithResponseAsync(RequestOptionsHelper.downloadRequestOptions(shareName + "/" + filePath, + rangeString, rangeGetContentMD5, requestConditions.getLeaseId(), context)) + .map(response -> new ResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + response.getValue().toFluxByteBuffer(), new FilesDownloadHeaders(response.getHeaders()))); } /** @@ -1351,7 +1356,8 @@ public Mono> deleteWithResponse(ShareRequestConditions requestCon Mono> deleteWithResponse(ShareRequestConditions requestConditions, Context context) { requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; return azureFileStorageClient.getFiles() - .deleteNoCustomHeadersWithResponseAsync(shareName, filePath, null, requestConditions.getLeaseId(), context); + .deleteWithResponseAsync(RequestOptionsHelper.addLeaseIdRequestOptions(shareName + "/" + filePath, + requestConditions.getLeaseId(), context)); } /** @@ -1530,9 +1536,12 @@ Mono> getPropertiesWithResponse(ShareRequestCondit Context context) { requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; context = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addLeaseId(requestOptions, requestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + filePath); return azureFileStorageClient.getFiles() - .getPropertiesWithResponseAsync(shareName, filePath, snapshot, null, requestConditions.getLeaseId(), - context) + .getPropertiesWithResponseAsync(requestOptions) .map(ModelHelper::getPropertiesResponse); } @@ -1788,11 +1797,12 @@ Mono> setPropertiesWithResponse(long newFileSize, ShareF ModelHelper.validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey()); return azureFileStorageClient.getFiles() - .setHttpHeadersWithResponseAsync(shareName, filePath, null, newFileSize, filePermission, - filePermissionFormat, smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), - smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), - smbProperties.getFileChangeTimeString(), requestConditions.getLeaseId(), fileposixProperties.getOwner(), - fileposixProperties.getGroup(), fileposixProperties.getFileMode(), httpHeaders, context) + .setHttpHeadersWithResponseAsync( + RequestOptionsHelper.setFileHttpHeadersRequestOptions(shareName + "/" + filePath, newFileSize, + filePermission, filePermissionFormat, smbProperties.getFilePermissionKey(), + smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), + smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), + requestConditions.getLeaseId(), fileposixProperties, httpHeaders, context)) .map(ModelHelper::setPropertiesResponse); } @@ -1925,9 +1935,12 @@ Mono> setMetadataWithResponse(Map> uploadRangeWithResponse(ShareFileUploadRange (int) ModelHelper.FILE_DEFAULT_BLOCK_SIZE, true) : options.getDataFlux(); - return azureFileStorageClient.getFiles() - .uploadRangeWithResponseAsync(shareName, filePath, range.toString(), ShareFileRangeWriteType.UPDATE, - options.getLength(), null, null, requestConditions.getLeaseId(), options.getLastWrittenMode(), null, - null, data, context) + final Context finalContext = context; + return BinaryData.fromFlux(data, options.getLength(), false) + .flatMap(binaryData -> azureFileStorageClient.getFiles() + .uploadRangeWithResponseAsync(range.toString(), ShareFileRangeWriteType.UPDATE.toString(), + options.getLength(), + RequestOptionsHelper.uploadRangeRequestOptions(shareName + "/" + filePath, + requestConditions.getLeaseId(), options.getLastWrittenMode(), null, binaryData, finalContext))) .map(ModelHelper::uploadRangeHeadersToShareFileInfo); } @@ -2480,9 +2496,10 @@ public Mono> uploadRangeFromUrlWithRes final String copySource = Utility.encodeUrlPath(options.getSourceUrl()); return azureFileStorageClient.getFiles() - .uploadRangeFromURLWithResponseAsync(shareName, filePath, destinationRange.toString(), copySource, 0, null, - sourceRange.toString(), null, modifiedRequestConditions.getLeaseId(), sourceAuth, - options.getLastWrittenMode(), null, context) + .uploadRangeFromUrlWithResponseAsync(destinationRange.toString(), copySource, "update", 0L, + RequestOptionsHelper.uploadRangeFromUrlRequestOptions(shareName + "/" + filePath, + sourceRange.toString(), modifiedRequestConditions.getLeaseId(), sourceAuth, + options.getLastWrittenMode(), context)) .map(ModelHelper::mapUploadRangeFromUrlResponse); } @@ -2592,8 +2609,9 @@ Mono> clearRangeWithResponse(long length, long off ShareFileRange range = new ShareFileRange(offset, offset + length - 1); context = context == null ? Context.NONE : context; return azureFileStorageClient.getFiles() - .uploadRangeWithResponseAsync(shareName, filePath, range.toString(), ShareFileRangeWriteType.CLEAR, 0L, - null, null, requestConditions.getLeaseId(), null, null, null, (Flux) null, context) + .uploadRangeWithResponseAsync(range.toString(), ShareFileRangeWriteType.CLEAR.toString(), 0L, + RequestOptionsHelper.addLeaseIdRequestOptions(shareName + "/" + filePath, + requestConditions.getLeaseId(), context)) .map(ModelHelper::transformUploadResponse); } @@ -2946,8 +2964,8 @@ PagedFlux listAllRangesInternal(ShareFileRange range, ShareR .applyOptionalTimeout(this.listRangesWithResponse(range, requestConditions, previousSnapshot, supportRename, marker, pageSize, Context.NONE), timeout) .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), toShareFileRangeItems(response.getValue(), includeClearRanges), - response.getValue().getNextMarker(), response.getHeaders())); + response.getHeaders(), toShareFileRangeItems(response.getValue(), includeClearRanges), null, + response.getHeaders())); Function>> firstPageRetriever = pageSize -> nextPageRetriever.apply(null, pageSize); @@ -2965,9 +2983,9 @@ Mono> listRangesWithResponse(ShareFileRange range, context = context == null ? Context.NONE : context; return this.azureFileStorageClient.getFiles() - .getRangeListWithResponseAsync(shareName, filePath, snapshot, previousSnapshot, null, rangeString, - finalRequestConditions.getLeaseId(), supportRename, marker, maxResultsPerPage, context) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .getRangeListWithResponseAsync(RequestOptionsHelper.getRangeListRequestOptions(shareName + "/" + filePath, + snapshot, previousSnapshot, rangeString, finalRequestConditions.getLeaseId(), supportRename, context)) + .map(ModelHelper::mapGetRangeListResponse); } /** @@ -3026,11 +3044,10 @@ public PagedFlux listHandles(Integer maxResultsPerPage) { PagedFlux listHandlesWithOptionalTimeout(Integer maxResultsPerPage, Duration timeout, Context context) { Function>> retriever = marker -> StorageImplUtils .applyOptionalTimeout(this.azureFileStorageClient.getFiles() - .listHandlesWithResponseAsync(shareName, filePath, marker, maxResultsPerPage, null, snapshot, context), + .listHandlesWithResponseAsync(RequestOptionsHelper.listFileHandlesRequestOptions( + shareName + "/" + filePath, marker, maxResultsPerPage, snapshot, context)), timeout) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), ModelHelper.transformHandleItems(response.getValue().getHandleList()), - response.getValue().getNextMarker(), response.getDeserializedHeaders())); + .map(ModelHelper::mapFileListHandlesResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } @@ -3097,10 +3114,10 @@ public Mono> forceCloseHandleWithResponse(String hand Mono> forceCloseHandleWithResponse(String handleId, Context context) { context = context == null ? Context.NONE : context; return azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponseAsync(shareName, filePath, handleId, null, null, snapshot, context) - .map(response -> new SimpleResponse<>(response, - new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed()))); + .forceCloseHandlesWithResponseAsync(handleId, + RequestOptionsHelper.forceCloseFileHandlesRequestOptions(shareName + "/" + filePath, null, snapshot, + context)) + .map(ModelHelper::mapFileForceCloseHandlesResponse); } /** @@ -3136,17 +3153,15 @@ public Mono forceCloseAllHandles() { } PagedFlux forceCloseAllHandlesWithOptionalTimeout(Duration timeout, Context context) { - Function>> retriever = marker -> StorageImplUtils - .applyOptionalTimeout( - this.azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponseAsync(shareName, filePath, "*", null, marker, snapshot, context), - timeout) - .map(response -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), - Collections - .singletonList(new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())), - response.getDeserializedHeaders().getXMsMarker(), response.getDeserializedHeaders())); + Function>> retriever + = marker -> StorageImplUtils + .applyOptionalTimeout( + this.azureFileStorageClient.getFiles() + .forceCloseHandlesWithResponseAsync("*", + RequestOptionsHelper.forceCloseFileHandlesRequestOptions(shareName + "/" + filePath, marker, + snapshot, context)), + timeout) + .map(ModelHelper::mapFileForceCloseHandlesPagedResponse); return new PagedFlux<>(() -> retriever.apply(null), retriever); } @@ -3265,10 +3280,12 @@ Mono> renameWithResponse(ShareFileRenameOptions o renameSource = this.sasToken != null ? renameSource + "?" + this.sasToken.getSignature() : renameSource; return destinationFileClient.azureFileStorageClient.getFiles() - .renameWithResponseAsync(destinationFileClient.getShareName(), destinationFileClient.getFilePath(), - renameSource, null /* timeout */, options.getReplaceIfExists(), options.isIgnoreReadOnly(), - options.getFilePermission(), options.getFilePermissionFormat(), filePermissionKey, - options.getMetadata(), sourceConditions, destinationConditions, smbInfo, headers, context) + .renameWithResponseAsync(renameSource, + RequestOptionsHelper.renameFileRequestOptions( + destinationFileClient.getShareName() + "/" + destinationFileClient.getFilePath(), + options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), + options.getFilePermissionFormat(), filePermissionKey, options.getMetadata(), sourceConditions, + destinationConditions, smbInfo, headers, context)) .map(response -> new SimpleResponse<>(response, destinationFileClient)); } @@ -3493,8 +3510,9 @@ Mono> createHardLinkWithResponse(String targetFile, context = context == null ? Context.NONE : context; requestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; return this.azureFileStorageClient.getFiles() - .createHardLinkWithResponseAsync(shareName, filePath, targetFile, null, null, - requestConditions.getLeaseId(), context) + .createHardLinkWithResponseAsync(targetFile, + RequestOptionsHelper.addLeaseIdRequestOptions(shareName + "/" + filePath, + requestConditions.getLeaseId(), context)) .map(ModelHelper::createHardLinkResponse); } @@ -3550,8 +3568,10 @@ Mono> createSymbolicLinkWithResponse(String linkText, Ma String fileCreationTimeString = FileSmbProperties.parseFileSMBDate(fileCreationTime); String fileLastWriteTimeString = FileSmbProperties.parseFileSMBDate(fileLastWriteTime); return this.azureFileStorageClient.getFiles() - .createSymbolicLinkWithResponseAsync(shareName, filePath, linkText, null, metadata, fileCreationTimeString, - fileLastWriteTimeString, null, requestConditions.getLeaseId(), owner, group, context) + .createSymbolicLinkWithResponseAsync(linkText, + RequestOptionsHelper.createSymbolicLinkRequestOptions(shareName + "/" + filePath, metadata, + fileCreationTimeString, fileLastWriteTimeString, requestConditions.getLeaseId(), owner, group, + context)) .map(ModelHelper::createSymbolicLinkResponse); } @@ -3598,7 +3618,8 @@ public Mono> getSymbolicLinkWithResponse() { Mono> getSymbolicLinkWithResponse(Context context) { context = context == null ? Context.NONE : context; return this.azureFileStorageClient.getFiles() - .getSymbolicLinkWithResponseAsync(shareName, filePath, null, snapshot, null, context) + .getSymbolicLinkWithResponseAsync( + RequestOptionsHelper.snapshotRequestOptions(shareName + "/" + filePath, snapshot, context)) .map(ModelHelper::getSymbolicLinkResponse); } 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 81febcdf9130..93ed51f60f07 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 @@ -13,9 +13,11 @@ 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.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.FluxUtil; @@ -52,6 +54,7 @@ import com.azure.storage.file.share.implementation.models.ShareFileRangeWriteType; import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.implementation.util.ShareSasImplUtil; import com.azure.storage.file.share.models.CloseHandlesInfo; import com.azure.storage.file.share.models.CopyStatusType; @@ -554,15 +557,15 @@ public Response createWithResponse(ShareFileCreateOptions options contentMD5 = null; } - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .createWithResponse(shareName, filePath, options.getSize(), null, options.getMetadata(), - options.getFilePermission(), options.getFilePermissionFormat(), smbProperties.getFilePermissionKey(), - smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), - smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), - requestConditions.getLeaseId(), fileposixProperties.getOwner(), fileposixProperties.getGroup(), - fileposixProperties.getFileMode(), fileposixProperties.getFileType(), contentMD5, - options.getFilePropertySemantics(), contentLength, null, null, options.getData(), - options.getShareFileHttpHeaders(), finalContext); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .createWithResponse(options.getSize(), + RequestOptionsHelper.createFileRequestOptions(shareName + "/" + filePath, options.getMetadata(), + options.getFilePermission(), options.getFilePermissionFormat(), + smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), + smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), + smbProperties.getFileChangeTimeString(), requestConditions.getLeaseId(), fileposixProperties, + contentMD5, options.getFilePropertySemantics(), options.getShareFileHttpHeaders(), + options.getData(), finalContext)); return ModelHelper.createFileInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -785,15 +788,16 @@ public SyncPoller beginCopy(String sourceUrl, ShareFile Function, PollResponse> syncActivationOperation = (pollingContext) -> { - ResponseBase response = azureFileStorageClient.getFiles() - .startCopyWithResponse(shareName, filePath, copySource, null, options.getMetadata(), - options.getFilePermission(), options.getFilePermissionFormat(), - tempSmbProperties.getFilePermissionKey(), finalRequestConditions.getLeaseId(), - fileposixProperties.getOwner(), fileposixProperties.getGroup(), - fileposixProperties.getFileMode(), options.getModeCopyMode(), options.getOwnerCopyMode(), - copyFileSmbInfo, null); - - FilesStartCopyHeaders headers = response.getDeserializedHeaders(); + Response response = azureFileStorageClient.getFiles() + .startCopyWithResponse(copySource, + RequestOptionsHelper.startCopyRequestOptions(shareName + "/" + filePath, options.getMetadata(), + options.getFilePermission(), options.getFilePermissionFormat(), + tempSmbProperties.getFilePermissionKey(), finalRequestConditions.getLeaseId(), + fileposixProperties.getOwner(), fileposixProperties.getGroup(), + fileposixProperties.getFileMode(), options.getModeCopyMode(), options.getOwnerCopyMode(), + copyFileSmbInfo, Context.NONE)); + + FilesStartCopyHeaders headers = new FilesStartCopyHeaders(response.getHeaders()); copyId.set(headers.getXMsCopyId()); return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, @@ -939,9 +943,11 @@ public Response abortCopyWithResponse(String copyId, ShareRequestCondition Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .abortCopyNoCustomHeadersWithResponse(shareName, filePath, copyId, null, - finalRequestConditions.getLeaseId(), finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addLeaseId(requestOptions, finalRequestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + filePath); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().abortCopyWithResponse(copyId, requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -1313,9 +1319,11 @@ public Response deleteWithResponse(ShareRequestConditions requestCondition Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .deleteNoCustomHeadersWithResponse(shareName, filePath, null, finalRequestConditions.getLeaseId(), - finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addLeaseId(requestOptions, finalRequestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + filePath); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().deleteWithResponse(requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -1480,9 +1488,12 @@ public Response getPropertiesWithResponse(ShareRequestCondi Context finalContext = context == null ? Context.NONE : context; ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .getPropertiesWithResponse(shareName, filePath, snapshot, null, finalRequestConditions.getLeaseId(), - finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addLeaseId(requestOptions, finalRequestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + filePath); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().getPropertiesWithResponse(requestOptions); return ModelHelper.getPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1731,14 +1742,13 @@ public Response setPropertiesWithResponse(ShareFileSetPropertiesO // Checks that file permission and file permission key are valid ModelHelper.validateFilePermissionAndKey(filePermission.getPermission(), smbProperties.getFilePermissionKey()); - Callable> operation = () -> azureFileStorageClient.getFiles() - .setHttpHeadersWithResponse(shareName, filePath, null, options.getSizeInBytes(), - filePermission.getPermission(), filePermission.getPermissionFormat(), - smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(), - smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(), - smbProperties.getFileChangeTimeString(), finalRequestConditions.getLeaseId(), - fileposixProperties.getOwner(), fileposixProperties.getGroup(), fileposixProperties.getFileMode(), - options.getHttpHeaders(), finalContext); + Callable> operation = () -> azureFileStorageClient.getFiles() + .setHttpHeadersWithResponse(RequestOptionsHelper.setFileHttpHeadersRequestOptions( + shareName + "/" + filePath, options.getSizeInBytes(), filePermission.getPermission(), + filePermission.getPermissionFormat(), smbProperties.getFilePermissionKey(), + smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), + smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), + finalRequestConditions.getLeaseId(), fileposixProperties, options.getHttpHeaders(), finalContext)); return ModelHelper.setPropertiesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -1872,9 +1882,12 @@ public Response setMetadataWithResponse(Map> operation = () -> this.azureFileStorageClient.getFiles() - .setMetadataWithResponse(shareName, filePath, null, metadata, finalRequestConditions.getLeaseId(), - finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addMetadata(requestOptions, metadata); + RequestOptionsHelper.addLeaseId(requestOptions, finalRequestConditions.getLeaseId()); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName + "/" + filePath); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().setMetadataWithResponse(requestOptions); return ModelHelper.setMetadataResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2289,10 +2302,11 @@ public Response uploadRangeFromUrlWithResponse( = options.getSourceAuthorization() == null ? null : options.getSourceAuthorization().toString(); String copySource = Utility.encodeUrlPath(options.getSourceUrl()); - Callable> operation = () -> azureFileStorageClient.getFiles() - .uploadRangeFromURLWithResponse(shareName, filePath, destinationRange.toString(), copySource, 0, null, - sourceRange.toString(), null, finalRequestConditions.getLeaseId(), sourceAuth, - options.getLastWrittenMode(), null, finalContext); + Callable> operation = () -> azureFileStorageClient.getFiles() + .uploadRangeFromUrlWithResponse(destinationRange.toString(), copySource, "update", 0L, + RequestOptionsHelper.uploadRangeFromUrlRequestOptions(shareName + "/" + filePath, + sourceRange.toString(), finalRequestConditions.getLeaseId(), sourceAuth, + options.getLastWrittenMode(), finalContext)); return ModelHelper.mapUploadRangeFromUrlResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2394,9 +2408,10 @@ public Response clearRangeWithResponse(long length, long of = requestConditions == null ? new ShareRequestConditions() : requestConditions; ShareFileRange range = new ShareFileRange(offset, offset + length - 1); Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .uploadRangeWithResponse(shareName, filePath, range.toString(), ShareFileRangeWriteType.CLEAR, 0L, null, - null, finalRequestConditions.getLeaseId(), null, null, null, null, finalContext); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .uploadRangeWithResponse(range.toString(), ShareFileRangeWriteType.CLEAR.toString(), 0L, + RequestOptionsHelper.addLeaseIdRequestOptions(shareName + "/" + filePath, + finalRequestConditions.getLeaseId(), finalContext)); return ModelHelper.transformUploadResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -2551,13 +2566,13 @@ public PagedIterable listRanges(ShareFileRange range, ShareReque = requestConditions == null ? new ShareRequestConditions() : requestConditions; String rangeString = range == null ? null : range.toString(); try { - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .getRangeListWithResponse(shareName, filePath, snapshot, null, null, rangeString, - finalRequestConditions.getLeaseId(), null, null, null, finalContext); + Callable> operation + = () -> ModelHelper.mapGetRangeListResponse(this.azureFileStorageClient.getFiles() + .getRangeListWithResponse( + RequestOptionsHelper.getRangeListRequestOptions(shareName + "/" + filePath, snapshot, null, + rangeString, finalRequestConditions.getLeaseId(), null, finalContext))); - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + Response response = sendRequest(operation, timeout, ShareStorageException.class); List shareFileRangeList = response.getValue() .getRanges() @@ -2568,7 +2583,7 @@ public PagedIterable listRanges(ShareFileRange range, ShareReque Supplier> finalResponse = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - shareFileRangeList, null, response.getDeserializedHeaders()); + shareFileRangeList, null, new FilesGetRangeListHeaders(response.getHeaders())); return new PagedIterable<>(finalResponse); @@ -2654,12 +2669,12 @@ private PagedIterable listAllRangesInternal(ShareFileRange r = requestConditions == null ? new ShareRequestConditions() : requestConditions; BiFunction> nextPageRetriever = (marker, pageSize) -> { - ResponseBase response = listRangesWithResponse(range, - finalRequestConditions, previousSnapshot, supportRename, marker, pageSize, timeout, finalContext); + Response response = listRangesWithResponse(range, finalRequestConditions, + previousSnapshot, supportRename, marker, pageSize, timeout, finalContext); return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - toShareFileRangeItems(response.getValue(), includeClearRanges), response.getValue().getNextMarker(), - response.getDeserializedHeaders()); + toShareFileRangeItems(response.getValue(), includeClearRanges), null, + new FilesGetRangeListHeaders(response.getHeaders())); }; Function> firstPageRetriever = pageSize -> nextPageRetriever.apply(null, pageSize); @@ -2739,9 +2754,11 @@ public Response listRangesDiffWithResponse(ShareFileListRang ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); String rangeString = options.getRange() == null ? null : options.getRange().toString(); - Callable> operation = () -> this.azureFileStorageClient.getFiles() - .getRangeListNoCustomHeadersWithResponse(shareName, filePath, snapshot, options.getPreviousSnapshot(), null, - rangeString, requestConditions.getLeaseId(), options.isRenameIncluded(), null, null, finalContext); + Callable> operation + = () -> ModelHelper.mapGetRangeListResponse(this.azureFileStorageClient.getFiles() + .getRangeListWithResponse(RequestOptionsHelper.getRangeListRequestOptions(shareName + "/" + filePath, + snapshot, options.getPreviousSnapshot(), rangeString, requestConditions.getLeaseId(), + options.isRenameIncluded(), finalContext))); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -2800,18 +2817,15 @@ public PagedIterable listHandles() { public PagedIterable listHandles(Integer maxResultsPerPage, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .listHandlesWithResponse(shareName, filePath, null, maxResultsPerPage, null, snapshot, - finalContext); + RequestOptions requestOptions = RequestOptionsHelper.listFileHandlesRequestOptions( + shareName + "/" + filePath, null, maxResultsPerPage, snapshot, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().listHandlesWithResponse(requestOptions); - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + PagedResponse response + = ModelHelper.mapFileListHandlesResponse(sendRequest(operation, timeout, ShareStorageException.class)); - Supplier> finalResponse - = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - ModelHelper.transformHandleItems(response.getValue().getHandleList()), null, - response.getDeserializedHeaders()); + Supplier> finalResponse = () -> response; return new PagedIterable<>(finalResponse); @@ -2877,15 +2891,13 @@ public CloseHandlesInfo forceCloseHandle(String handleId) { @ServiceMethod(returns = ReturnType.SINGLE) public Response forceCloseHandleWithResponse(String handleId, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponse(shareName, filePath, handleId, null, null, snapshot, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + RequestOptions requestOptions = RequestOptionsHelper + .forceCloseFileHandlesRequestOptions(shareName + "/" + filePath, null, snapshot, finalContext); + Callable> operation + = () -> azureFileStorageClient.getFiles().forceCloseHandlesWithResponse(handleId, requestOptions); - return new SimpleResponse<>(response, - new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())); + return ModelHelper + .mapFileForceCloseHandlesResponse(sendRequest(operation, timeout, ShareStorageException.class)); } /** @@ -2915,19 +2927,15 @@ public Response forceCloseHandleWithResponse(String handleId, public CloseHandlesInfo forceCloseAllHandles(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; try { - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .forceCloseHandlesWithResponse(shareName, filePath, "*", null, null, snapshot, finalContext); + RequestOptions requestOptions = RequestOptionsHelper + .forceCloseFileHandlesRequestOptions(shareName + "/" + filePath, null, snapshot, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getFiles().forceCloseHandlesWithResponse("*", requestOptions); - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); + PagedResponse response = ModelHelper + .mapFileForceCloseHandlesPagedResponse(sendRequest(operation, timeout, ShareStorageException.class)); - Supplier> finalResponse - = () -> new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - Collections.singletonList( - new CloseHandlesInfo(response.getDeserializedHeaders().getXMsNumberOfHandlesClosed(), - response.getDeserializedHeaders().getXMsNumberOfHandlesFailed())), - response.getDeserializedHeaders().getXMsMarker(), response.getDeserializedHeaders()); + Supplier> finalResponse = () -> response; return new PagedIterable<>(finalResponse).stream() .reduce(new CloseHandlesInfo(0, 0), @@ -3047,11 +3055,12 @@ public Response renameWithResponse(ShareFileRenameOptions optio = this.sasToken != null ? renameSource + "?" + this.sasToken.getSignature() : renameSource; Callable> operation = () -> destinationFileClient.azureFileStorageClient.getFiles() - .renameNoCustomHeadersWithResponse(destinationFileClient.getShareName(), - destinationFileClient.getFilePath(), finalRenameSource, null, options.getReplaceIfExists(), - options.isIgnoreReadOnly(), options.getFilePermission(), options.getFilePermissionFormat(), - finalFilePermissionKey, options.getMetadata(), sourceConditions, destinationConditions, finalSmbInfo, - headers, finalContext); + .renameWithResponse(finalRenameSource, + RequestOptionsHelper.renameFileRequestOptions( + destinationFileClient.getShareName() + "/" + destinationFileClient.getFilePath(), + options.getReplaceIfExists(), options.isIgnoreReadOnly(), options.getFilePermission(), + options.getFilePermissionFormat(), finalFilePermissionKey, options.getMetadata(), sourceConditions, + destinationConditions, finalSmbInfo, headers, finalContext)); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), destinationFileClient); @@ -3272,10 +3281,9 @@ public Response createHardLinkWithResponse(ShareFileCreateHardLin ShareRequestConditions requestConditions = options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions(); - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .createHardLinkWithResponse(shareName, filePath, options.getTargetFile(), null, null, - requestConditions.getLeaseId(), finalContext); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .createHardLinkWithResponse(options.getTargetFile(), RequestOptionsHelper + .addLeaseIdRequestOptions(shareName + "/" + filePath, requestConditions.getLeaseId(), finalContext)); return ModelHelper.createHardLinkResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -3325,11 +3333,11 @@ public Response createSymbolicLinkWithResponse(ShareFileCreateSym String fileCreationTimeString = FileSmbProperties.parseFileSMBDate(options.getFileCreationTime()); String fileLastWriteTimeString = FileSmbProperties.parseFileSMBDate(options.getFileLastWriteTime()); - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .createSymbolicLinkWithResponse(shareName, filePath, options.getLinkText(), null, options.getMetadata(), - fileCreationTimeString, fileLastWriteTimeString, null, requestConditions.getLeaseId(), - options.getOwner(), options.getGroup(), finalContext); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .createSymbolicLinkWithResponse(options.getLinkText(), + RequestOptionsHelper.createSymbolicLinkRequestOptions(shareName + "/" + filePath, options.getMetadata(), + fileCreationTimeString, fileLastWriteTimeString, requestConditions.getLeaseId(), options.getOwner(), + options.getGroup(), finalContext)); return ModelHelper.createSymbolicLinkResponse(sendRequest(operation, timeout, ShareStorageException.class)); @@ -3370,9 +3378,9 @@ public ShareFileSymbolicLinkInfo getSymbolicLink() { public Response getSymbolicLinkWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .getSymbolicLinkWithResponse(shareName, filePath, null, snapshot, null, finalContext); + Callable> operation = () -> this.azureFileStorageClient.getFiles() + .getSymbolicLinkWithResponse( + RequestOptionsHelper.snapshotRequestOptions(shareName + "/" + filePath, snapshot, finalContext)); return ModelHelper.getSymbolicLinkResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -3409,17 +3417,19 @@ public String generateUserDelegationSas(ShareServiceSasSignatureValues shareServ .generateUserDelegationSas(userDelegationKey, accountName, stringToSignHandler, context); } - ResponseBase listRangesWithResponse(ShareFileRange range, - ShareRequestConditions requestConditions, String previousSnapshot, Boolean supportRename, String marker, - Integer maxResultsPerPage, Duration timeout, Context context) { + Response listRangesWithResponse(ShareFileRange range, ShareRequestConditions requestConditions, + String previousSnapshot, Boolean supportRename, String marker, Integer maxResultsPerPage, Duration timeout, + Context context) { ShareRequestConditions finalRequestConditions = requestConditions == null ? new ShareRequestConditions() : requestConditions; String rangeString = range == null ? null : range.toString(); - Callable> operation - = () -> this.azureFileStorageClient.getFiles() - .getRangeListWithResponse(shareName, filePath, snapshot, previousSnapshot, null, rangeString, - finalRequestConditions.getLeaseId(), supportRename, marker, maxResultsPerPage, context); + Callable> operation + = () -> ModelHelper + .mapGetRangeListResponse(this.azureFileStorageClient.getFiles() + .getRangeListWithResponse(RequestOptionsHelper.getRangeListRequestOptions( + shareName + "/" + filePath, snapshot, previousSnapshot, rangeString, + finalRequestConditions.getLeaseId(), supportRename, context))); return sendRequest(operation, timeout, ShareStorageException.class); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClientBuilder.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClientBuilder.java index fe1fbc329ade..3570830ee7cf 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClientBuilder.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClientBuilder.java @@ -208,8 +208,8 @@ private AzureFileStorageImpl constructImpl() { endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - return new AzureFileStorageImpl(pipeline, getServiceVersion().getVersion(), shareTokenIntent, endpoint, - allowTrailingDot, allowSourceTrailingDot); + return new AzureFileStorageImpl(pipeline, endpoint, shareTokenIntent, allowTrailingDot, allowSourceTrailingDot, + getServiceVersion()); } /** diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java index 5902a63579dc..b6515ad9d460 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java @@ -12,6 +12,7 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -29,6 +30,7 @@ import com.azure.storage.file.share.implementation.models.KeyInfo; import com.azure.storage.file.share.implementation.models.ListSharesIncludeType; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.models.ListSharesOptions; import com.azure.storage.file.share.models.ShareCorsRule; import com.azure.storage.file.share.models.ShareItem; @@ -257,17 +259,9 @@ PagedFlux listSharesWithOptionalTimeout(String marker, ListSharesOpti BiFunction>> retriever = (nextMarker, pageSize) -> StorageImplUtils.applyOptionalTimeout(this.azureFileStorageClient.getServices() - .listSharesSegmentSinglePageAsync(prefix, nextMarker, pageSize == null ? maxResultsPerPage : pageSize, - include, null, context) - .map(response -> { - List value = response.getValue() == null - ? Collections.emptyList() - : response.getValue().stream().map(ModelHelper::populateShareItem).collect(Collectors.toList()); - - return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), value, response.getContinuationToken(), - ModelHelper.transformListSharesHeaders(response.getHeaders())); - }), timeout); + .listSharesSegmentWithResponseAsync(RequestOptionsHelper.listSharesRequestOptions(prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include, context)) + .map(ModelHelper::mapListSharesResponse), timeout); return new PagedFlux<>(pageSize -> retriever.apply(marker, pageSize), retriever); } @@ -334,9 +328,10 @@ public Mono> getPropertiesWithResponse() { Mono> getPropertiesWithResponse(Context context) { context = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(context); return azureFileStorageClient.getServices() - .getPropertiesWithResponseAsync(null, context) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .getPropertiesWithResponseAsync(requestOptions) + .map(ModelHelper::mapGetServicePropertiesResponse); } /** @@ -456,8 +451,9 @@ public Mono> setPropertiesWithResponse(ShareServiceProperties pro Mono> setPropertiesWithResponse(ShareServiceProperties properties, Context context) { context = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(context); return azureFileStorageClient.getServices() - .setPropertiesNoCustomHeadersWithResponseAsync(properties, null, context); + .setPropertiesWithResponseAsync(RequestOptionsHelper.serializeToXml(properties), requestOptions); } /** @@ -657,8 +653,11 @@ Mono> deleteShareWithResponse(String shareName, String snapshot, deleteSnapshots = DeleteSnapshotsOptionType.INCLUDE; } context = context == null ? Context.NONE : context; - return azureFileStorageClient.getShares() - .deleteNoCustomHeadersWithResponseAsync(shareName, snapshot, null, deleteSnapshots, null, context); + RequestOptions requestOptions = new RequestOptions().setContext(context); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addDeleteSnapshotsHeader(requestOptions, deleteSnapshots); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + return azureFileStorageClient.getShares().deleteWithResponseAsync(requestOptions); } /** @@ -853,8 +852,11 @@ public Mono> undeleteShareWithResponse(String deleted Mono> undeleteShareWithResponse(String deletedShareName, String deletedShareVersion, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context == null ? Context.NONE : context); + RequestOptionsHelper.addUndeleteShareHeaders(requestOptions, deletedShareName, deletedShareVersion); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, deletedShareName); return this.azureFileStorageClient.getShares() - .restoreWithResponseAsync(deletedShareName, null, null, deletedShareName, deletedShareVersion, context) + .restoreWithResponseAsync(requestOptions) .map(response -> new SimpleResponse<>(response, getShareAsyncClient(deletedShareName))); } @@ -930,12 +932,12 @@ Mono> getUserDelegationKeyWithResponse(OffsetDateTim new IllegalArgumentException("`start` must be null or a datetime before `expiry`.")); } + KeyInfo keyInfo = new KeyInfo(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)) + .setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start)) + .setDelegatedUserTenantId(delegatedUserTenantId); + RequestOptions requestOptions = new RequestOptions().setContext(context); return this.azureFileStorageClient.getServices() - .getUserDelegationKeyWithResponseAsync( - new KeyInfo().setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start)) - .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)) - .setDelegatedUserTenantId(delegatedUserTenantId), - null, null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getValue())); + .getUserDelegationKeyWithResponseAsync(RequestOptionsHelper.serializeToXml(keyInfo), requestOptions) + .map(ModelHelper::mapGetUserDelegationKeyResponse); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java index 70ac71c922a2..a3ddc9386ad2 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClient.java @@ -12,9 +12,11 @@ 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.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -31,6 +33,7 @@ import com.azure.storage.file.share.implementation.models.ServicesGetUserDelegationKeyHeaders; import com.azure.storage.file.share.implementation.models.ShareItemInternal; import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.models.ListSharesOptions; import com.azure.storage.file.share.models.ShareCorsRule; import com.azure.storage.file.share.models.ShareItem; @@ -226,18 +229,13 @@ public PagedIterable listShares(ListSharesOptions options, Duration t } BiFunction> retriever = (nextMarker, pageSize) -> { - Callable> operation = () -> this.azureFileStorageClient.getServices() - .listSharesSegmentNoCustomHeadersSinglePage(prefix, nextMarker, - pageSize == null ? maxResultsPerPage : pageSize, include, null, finalContext); + RequestOptions requestOptions = RequestOptionsHelper.listSharesRequestOptions(prefix, nextMarker, + pageSize == null ? maxResultsPerPage : pageSize, include, finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getServices().listSharesSegmentWithResponse(requestOptions); - PagedResponse response = sendRequest(operation, timeout, ShareStorageException.class); - - List value = response.getValue() == null - ? Collections.emptyList() - : response.getValue().stream().map(ModelHelper::populateShareItem).collect(Collectors.toList()); - - return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), - value, response.getContinuationToken(), ModelHelper.transformListSharesHeaders(response.getHeaders())); + Response response = sendRequest(operation, timeout, ShareStorageException.class); + return ModelHelper.mapListSharesResponse(response); }; return new PagedIterable<>(pageSize -> retriever.apply(null, pageSize), retriever); @@ -301,11 +299,12 @@ public ShareServiceProperties getProperties() { @ServiceMethod(returns = ReturnType.SINGLE) public Response getPropertiesWithResponse(Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getServices() - .getPropertiesNoCustomHeadersWithResponse(null, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + Callable> operation + = () -> this.azureFileStorageClient.getServices().getPropertiesWithResponse(requestOptions); - Response response = sendRequest(operation, timeout, ShareStorageException.class); - return new SimpleResponse<>(response, response.getValue()); + Response response = sendRequest(operation, timeout, ShareStorageException.class); + return ModelHelper.mapGetServicePropertiesResponse(response); } /** @@ -433,8 +432,9 @@ public void setProperties(ShareServiceProperties properties) { public Response setPropertiesWithResponse(ShareServiceProperties properties, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); Callable> operation = () -> this.azureFileStorageClient.getServices() - .setPropertiesNoCustomHeadersWithResponse(properties, null, finalContext); + .setPropertiesWithResponse(RequestOptionsHelper.serializeToXml(properties), requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -601,8 +601,12 @@ public Response deleteShareWithResponse(String shareName, String snapshot, Context finalContext = context == null ? Context.NONE : context; DeleteSnapshotsOptionType deleteSnapshots = CoreUtils.isNullOrEmpty(snapshot) ? DeleteSnapshotsOptionType.INCLUDE : null; - Callable> operation = () -> this.azureFileStorageClient.getShares() - .deleteNoCustomHeadersWithResponse(shareName, snapshot, null, deleteSnapshots, null, finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addSnapshot(requestOptions, snapshot); + RequestOptionsHelper.addDeleteSnapshotsHeader(requestOptions, deleteSnapshots); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, shareName); + Callable> operation + = () -> this.azureFileStorageClient.getShares().deleteWithResponse(requestOptions); return sendRequest(operation, timeout, ShareStorageException.class); } @@ -793,9 +797,11 @@ public ShareClient undeleteShare(String deletedShareName, String deletedShareVer public Response undeleteShareWithResponse(String deletedShareName, String deletedShareVersion, Duration timeout, Context context) { Context finalContext = context == null ? Context.NONE : context; - Callable> operation = () -> this.azureFileStorageClient.getShares() - .restoreNoCustomHeadersWithResponse(deletedShareName, null, null, deletedShareName, deletedShareVersion, - finalContext); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + RequestOptionsHelper.addUndeleteShareHeaders(requestOptions, deletedShareName, deletedShareVersion); + RequestOptionsHelper.scopeRequestToResourcePath(requestOptions, deletedShareName); + Callable> operation + = () -> this.azureFileStorageClient.getShares().restoreWithResponse(requestOptions); return new SimpleResponse<>(sendRequest(operation, timeout, ShareStorageException.class), getShareClient(deletedShareName)); @@ -851,17 +857,18 @@ public Response getUserDelegationKeyWithResponse(ShareGetUser new IllegalArgumentException("`start` must be null or a datetime before `expiry`.")); } - Callable> operation - = () -> this.azureFileStorageClient.getServices() - .getUserDelegationKeyWithResponse(new KeyInfo() - .setStart(options.getStartsOn() == null - ? "" - : Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getStartsOn())) - .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getExpiresOn())) - .setDelegatedUserTenantId(options.getDelegatedUserTenantId()), null, null, finalContext); - - ResponseBase response - = sendRequest(operation, timeout, ShareStorageException.class); - return new SimpleResponse<>(response, response.getValue()); + Callable> operation = () -> { + KeyInfo keyInfo = new KeyInfo(Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getExpiresOn())) + .setStart(options.getStartsOn() == null + ? "" + : Constants.ISO_8601_UTC_DATE_FORMATTER.format(options.getStartsOn())) + .setDelegatedUserTenantId(options.getDelegatedUserTenantId()); + RequestOptions requestOptions = new RequestOptions().setContext(finalContext); + return this.azureFileStorageClient.getServices() + .getUserDelegationKeyWithResponse(RequestOptionsHelper.serializeToXml(keyInfo), requestOptions); + }; + + Response response = sendRequest(operation, timeout, ShareStorageException.class); + return ModelHelper.mapGetUserDelegationKeyResponse(response); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClientBuilder.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClientBuilder.java index dddee6529049..0a4edf5d4633 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClientBuilder.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceClientBuilder.java @@ -617,7 +617,7 @@ AzureFileStorageImpl buildFileStorageImplClient() { endpoint, retryOptions, coreRetryOptions, logOptions, clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER); - return new AzureFileStorageImpl(pipeline, serviceVersion.getVersion(), shareTokenIntent, endpoint, - allowTrailingDot, allowSourceTrailingDot); + return new AzureFileStorageImpl(pipeline, endpoint, shareTokenIntent, allowTrailingDot, allowSourceTrailingDot, + serviceVersion); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceVersion.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceVersion.java index edf9c237d29c..a31427b5a053 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceVersion.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceVersion.java @@ -1,166 +1,167 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share; import com.azure.core.util.ServiceVersion; /** - * The versions of Azure Storage File supported by this client library. + * Service version of FileClient. */ public enum ShareServiceVersion implements ServiceVersion { /** - * Service version {@code 2019-02-02}. + * Enum value 2019-02-02. */ V2019_02_02("2019-02-02"), /** - * Service version {@code 2019-07-07}. + * Enum value 2019-07-07. */ V2019_07_07("2019-07-07"), /** - * Service version {@code 2019-12-12}. + * Enum value 2019-12-12. */ V2019_12_12("2019-12-12"), /** - * Service version {@code 2020-02-10}. + * Enum value 2020-02-10. */ V2020_02_10("2020-02-10"), /** - * Service version {@code 2020-04-08}. + * Enum value 2020-04-08. */ V2020_04_08("2020-04-08"), /** - * Service version {@code 2020-06-12}. + * Enum value 2020-06-12. */ V2020_06_12("2020-06-12"), /** - * Service version {@code 2020-08-04}. + * Enum value 2020-08-04. */ V2020_08_04("2020-08-04"), /** - * Service version {@code 2020-10-02}. + * Enum value 2020-10-02. */ V2020_10_02("2020-10-02"), /** - * Service version {@code 2020-12-06}. + * Enum value 2020-12-06. */ V2020_12_06("2020-12-06"), /** - * Service version {@code 2021-02-12}. + * Enum value 2021-02-12. */ V2021_02_12("2021-02-12"), /** - * Service version {@code 2021-04-10}. + * Enum value 2021-04-10. */ V2021_04_10("2021-04-10"), /** - * Service version {@code 2021-06-08}. + * Enum value 2021-06-08. */ V2021_06_08("2021-06-08"), /** - * Service version {@code 2021-08-06}. + * Enum value 2021-08-06. */ V2021_08_06("2021-08-06"), /** - * Service version {@code 2021-10-04}. + * Enum value 2021-10-04. */ V2021_10_04("2021-10-04"), /** - * Service version {@code 2021-12-02}. + * Enum value 2021-12-02. */ V2021_12_02("2021-12-02"), /** - * Service version {@code 2022-11-02}. + * Enum value 2022-11-02. */ V2022_11_02("2022-11-02"), /** - * Service version {@code 2023-01-03}. + * Enum value 2023-01-03. */ V2023_01_03("2023-01-03"), /** - * Service version {@code 2023-05-03}. + * Enum value 2023-05-03. */ V2023_05_03("2023-05-03"), /** - * Service version {@code 2023-08-03}. + * Enum value 2023-08-03. */ V2023_08_03("2023-08-03"), /** - * Service version {@code 2023-11-03}. + * Enum value 2023-11-03. */ V2023_11_03("2023-11-03"), /** - * Service version {@code 2024-02-04}. + * Enum value 2024-02-04. */ V2024_02_04("2024-02-04"), /** - * Service version {@code 2024-05-04}. + * Enum value 2024-05-04. */ V2024_05_04("2024-05-04"), /** - * Service version {@code 2024-08-04}. + * Enum value 2024-08-04. */ V2024_08_04("2024-08-04"), /** - * Service version {@code 2024-11-04}. + * Enum value 2024-11-04. */ V2024_11_04("2024-11-04"), /** - * Service version {@code 2025-01-05}. + * Enum value 2025-01-05. */ V2025_01_05("2025-01-05"), /** - * Service version {@code 2025-05-05}. + * Enum value 2025-05-05. */ V2025_05_05("2025-05-05"), /** - * Service version {@code 2025-07-05}. + * Enum value 2025-07-05. */ V2025_07_05("2025-07-05"), /** - * Service version {@code 2025-11-05}. + * Enum value 2025-11-05. */ V2025_11_05("2025-11-05"), /** - * Service version {@code 2026-02-06}. + * Enum value 2026-02-06. */ V2026_02_06("2026-02-06"), /** - * Service version {@code 2026-04-06}. + * Enum value 2026-04-06. */ V2026_04_06("2026-04-06"), /** - * Service version {@code 2026-06-06}. + * Enum value 2026-06-06. */ V2026_06_06("2026-06-06"), @@ -184,9 +185,9 @@ public String getVersion() { } /** - * Gets the latest service version supported by this client library + * Gets the latest service version supported by this client library. * - * @return the latest {@link ShareServiceVersion} + * @return The latest {@link ShareServiceVersion}. */ public static ShareServiceVersion getLatest() { return V2026_10_06; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/AzureFileStorageImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/AzureFileStorageImpl.java index b46ccad58938..076c00869967 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/AzureFileStorageImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/AzureFileStorageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation; @@ -10,6 +10,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.models.ShareTokenIntent; /** @@ -17,26 +18,26 @@ */ public final class AzureFileStorageImpl { /** - * Specifies the version of the operation to use for this request. + * The URL of the service account, share, directory or file that is the target of the desired operation. */ - private final String version; + private final String url; /** - * Gets Specifies the version of the operation to use for this request. + * Gets The URL of the service account, share, directory or file that is the target of the desired operation. * - * @return the version value. + * @return the url value. */ - public String getVersion() { - return this.version; + public String getUrl() { + return this.url; } /** - * Valid value is backup. + * Valid values are 'backup'. */ private final ShareTokenIntent fileRequestIntent; /** - * Gets Valid value is backup. + * Gets Valid values are 'backup'. * * @return the fileRequestIntent value. */ @@ -45,26 +46,12 @@ public ShareTokenIntent getFileRequestIntent() { } /** - * The URL of the service account, share, directory or file that is the target of the desired operation. - */ - private final String url; - - /** - * Gets The URL of the service account, share, directory or file that is the target of the desired operation. - * - * @return the url value. - */ - public String getUrl() { - return this.url; - } - - /** - * If true, the trailing dot will not be trimmed from the target URI. + * If true, the trailing dot will not be trimmed from the target file/directory path. */ private final boolean allowTrailingDot; /** - * Gets If true, the trailing dot will not be trimmed from the target URI. + * Gets If true, the trailing dot will not be trimmed from the target file/directory path. * * @return the allowTrailingDot value. */ @@ -86,6 +73,20 @@ public boolean isAllowSourceTrailingDot() { return this.allowSourceTrailingDot; } + /** + * Service version. + */ + private final ShareServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ShareServiceVersion getServiceVersion() { + return this.serviceVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -115,91 +116,91 @@ public SerializerAdapter getSerializerAdapter() { } /** - * The ServicesImpl object to access its operations. + * The DirectoriesImpl object to access its operations. */ - private final ServicesImpl services; + private final DirectoriesImpl directories; /** - * Gets the ServicesImpl object to access its operations. + * Gets the DirectoriesImpl object to access its operations. * - * @return the ServicesImpl object. + * @return the DirectoriesImpl object. */ - public ServicesImpl getServices() { - return this.services; + public DirectoriesImpl getDirectories() { + return this.directories; } /** - * The SharesImpl object to access its operations. + * The FilesImpl object to access its operations. */ - private final SharesImpl shares; + private final FilesImpl files; /** - * Gets the SharesImpl object to access its operations. + * Gets the FilesImpl object to access its operations. * - * @return the SharesImpl object. + * @return the FilesImpl object. */ - public SharesImpl getShares() { - return this.shares; + public FilesImpl getFiles() { + return this.files; } /** - * The DirectoriesImpl object to access its operations. + * The ServicesImpl object to access its operations. */ - private final DirectoriesImpl directories; + private final ServicesImpl services; /** - * Gets the DirectoriesImpl object to access its operations. + * Gets the ServicesImpl object to access its operations. * - * @return the DirectoriesImpl object. + * @return the ServicesImpl object. */ - public DirectoriesImpl getDirectories() { - return this.directories; + public ServicesImpl getServices() { + return this.services; } /** - * The FilesImpl object to access its operations. + * The SharesImpl object to access its operations. */ - private final FilesImpl files; + private final SharesImpl shares; /** - * Gets the FilesImpl object to access its operations. + * Gets the SharesImpl object to access its operations. * - * @return the FilesImpl object. + * @return the SharesImpl object. */ - public FilesImpl getFiles() { - return this.files; + public SharesImpl getShares() { + return this.shares; } /** * Initializes an instance of AzureFileStorage client. * - * @param version Specifies the version of the operation to use for this request. - * @param fileRequestIntent Valid value is backup. * @param url The URL of the service account, share, directory or file that is the target of the desired operation. - * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target URI. + * @param fileRequestIntent Valid values are 'backup'. + * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target file/directory path. * @param allowSourceTrailingDot If true, the trailing dot will not be trimmed from the source URI. + * @param serviceVersion Service version. */ - public AzureFileStorageImpl(String version, ShareTokenIntent fileRequestIntent, String url, - boolean allowTrailingDot, boolean allowSourceTrailingDot) { + public AzureFileStorageImpl(String url, ShareTokenIntent fileRequestIntent, boolean allowTrailingDot, + boolean allowSourceTrailingDot, ShareServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), version, fileRequestIntent, url, allowTrailingDot, - allowSourceTrailingDot); + JacksonAdapter.createDefaultSerializerAdapter(), url, fileRequestIntent, allowTrailingDot, + allowSourceTrailingDot, serviceVersion); } /** * Initializes an instance of AzureFileStorage client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param version Specifies the version of the operation to use for this request. - * @param fileRequestIntent Valid value is backup. * @param url The URL of the service account, share, directory or file that is the target of the desired operation. - * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target URI. + * @param fileRequestIntent Valid values are 'backup'. + * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target file/directory path. * @param allowSourceTrailingDot If true, the trailing dot will not be trimmed from the source URI. + * @param serviceVersion Service version. */ - public AzureFileStorageImpl(HttpPipeline httpPipeline, String version, ShareTokenIntent fileRequestIntent, - String url, boolean allowTrailingDot, boolean allowSourceTrailingDot) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), version, fileRequestIntent, url, - allowTrailingDot, allowSourceTrailingDot); + public AzureFileStorageImpl(HttpPipeline httpPipeline, String url, ShareTokenIntent fileRequestIntent, + boolean allowTrailingDot, boolean allowSourceTrailingDot, ShareServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), url, fileRequestIntent, allowTrailingDot, + allowSourceTrailingDot, serviceVersion); } /** @@ -207,24 +208,25 @@ public AzureFileStorageImpl(HttpPipeline httpPipeline, String version, ShareToke * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param version Specifies the version of the operation to use for this request. - * @param fileRequestIntent Valid value is backup. * @param url The URL of the service account, share, directory or file that is the target of the desired operation. - * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target URI. + * @param fileRequestIntent Valid values are 'backup'. + * @param allowTrailingDot If true, the trailing dot will not be trimmed from the target file/directory path. * @param allowSourceTrailingDot If true, the trailing dot will not be trimmed from the source URI. + * @param serviceVersion Service version. */ - public AzureFileStorageImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String version, - ShareTokenIntent fileRequestIntent, String url, boolean allowTrailingDot, boolean allowSourceTrailingDot) { + public AzureFileStorageImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String url, + ShareTokenIntent fileRequestIntent, boolean allowTrailingDot, boolean allowSourceTrailingDot, + ShareServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; - this.version = version; - this.fileRequestIntent = fileRequestIntent; this.url = url; + this.fileRequestIntent = fileRequestIntent; this.allowTrailingDot = allowTrailingDot; this.allowSourceTrailingDot = allowSourceTrailingDot; - this.services = new ServicesImpl(this); - this.shares = new SharesImpl(this); + this.serviceVersion = serviceVersion; this.directories = new DirectoriesImpl(this); this.files = new FilesImpl(this); + this.services = new ServicesImpl(this); + this.shares = new SharesImpl(this); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java index f166775a06c6..f5d9f6707815 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation; import com.azure.core.annotation.Delete; @@ -9,41 +9,31 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +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.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.file.share.implementation.models.CopyFileSmbInfo; -import com.azure.storage.file.share.implementation.models.DestinationLeaseAccessConditions; -import com.azure.storage.file.share.implementation.models.DirectoriesCreateHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesDeleteHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesForceCloseHandlesHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesGetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesListFilesAndDirectoriesSegmentHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesListHandlesHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesRenameHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesSetMetadataHeaders; -import com.azure.storage.file.share.implementation.models.DirectoriesSetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.ListFilesAndDirectoriesSegmentResponse; -import com.azure.storage.file.share.implementation.models.ListFilesIncludeType; -import com.azure.storage.file.share.implementation.models.ListHandlesResponse; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; -import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; -import com.azure.storage.file.share.models.FilePermissionFormat; -import com.azure.storage.file.share.models.FilePropertySemantics; import com.azure.storage.file.share.models.ShareTokenIntent; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Mono; @@ -73,6 +63,19 @@ public final class DirectoriesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ShareServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + /** * The interface defining all the services for AzureFileStorageDirectories to be used by the proxy service to * perform REST calls. @@ -81,3690 +84,1389 @@ public final class DirectoriesImpl { @ServiceInterface(name = "AzureFileStorageDirectories") public interface DirectoriesService { - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> create(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") + @Put("?restype=directory") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{directory}") + @Put("?restype=directory") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getProperties(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Get("?restype=directory") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Get("?restype=directory") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}/{directory}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> delete(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Delete("/{shareName}/{directory}") + @Delete("?restype=directory") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> deleteNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Delete("/{shareName}/{directory}") + @Delete("?restype=directory") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}/{directory}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setProperties(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setPropertiesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadata(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> - listFilesAndDirectoriesSegment(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @QueryParam("include") String include, - @HeaderParam("x-ms-file-extended-info") Boolean includeExtendedInfo, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listFilesAndDirectoriesSegmentNoCustomHeaders( - @HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @QueryParam("include") String include, - @HeaderParam("x-ms-file-extended-info") Boolean includeExtendedInfo, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase - listFilesAndDirectoriesSegmentSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @QueryParam("include") String include, - @HeaderParam("x-ms-file-extended-info") Boolean includeExtendedInfo, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Put("?restype=directory&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response listFilesAndDirectoriesSegmentNoCustomHeadersSync( - @HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @QueryParam("include") String include, - @HeaderParam("x-ms-file-extended-info") Boolean includeExtendedInfo, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Put("?restype=directory&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listHandles(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Put("?restype=directory&comp=metadata") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listHandlesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setMetadata(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Put("?restype=directory&comp=metadata") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase listHandlesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setMetadataSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{directory}") + @Get("?restype=directory&comp=list") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response listHandlesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listFilesAndDirectoriesSegment(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{directory}") + @Get("?restype=directory&comp=list") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> forceCloseHandles(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listFilesAndDirectoriesSegmentSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{directory}") + @Get("?comp=listhandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> forceCloseHandlesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listHandles(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{directory}") + @Get("?comp=listhandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase forceCloseHandlesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listHandlesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{directory}") + @Put("?comp=forceclosehandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response forceCloseHandlesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-recursive") Boolean recursive, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> forceCloseHandles(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{directory}") + @Put("?comp=forceclosehandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> rename(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response forceCloseHandlesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{directory}") + @Put("?restype=directory&comp=rename") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> renameNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> rename(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{directory}") + @Put("?restype=directory&comp=rename") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase renameSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("directory") String directory, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response renameSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{directory}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response renameNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("directory") String directory, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); } /** * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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}. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-property-semanticsStringNoSMB only. Default value is New. Allowed + * values: "New", "Restore".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String shareName, - String directory, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, String group, - String fileMode, FilePropertySemantics filePropertySemantics) { + public Mono> createWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, directory, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, owner, group, fileMode, filePropertySemantics, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String shareName, - String directory, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, String group, - String fileMode, FilePropertySemantics filePropertySemantics, Context context) { - final String restype = "directory"; - final String accept = "application/xml"; - return service - .create(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), timeout, - metadata, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.getFileRequestIntent(), - owner, group, fileMode, filePropertySemantics, accept, context) + .withContext(context -> service.create(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String directory, Integer timeout, Map metadata, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode, FilePropertySemantics filePropertySemantics) { - return createWithResponseAsync(shareName, directory, timeout, metadata, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode, filePropertySemantics) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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 A {@link Mono} that completes when a successful response is received. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-property-semanticsStringNoSMB only. Default value is New. Allowed + * values: "New", "Restore".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String directory, Integer timeout, Map metadata, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode, FilePropertySemantics filePropertySemantics, Context context) { - return createWithResponseAsync(shareName, directory, timeout, metadata, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode, filePropertySemantics, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + public Response createWithResponse(RequestOptions requestOptions) { + try { + return service.createSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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. + * Returns all system properties for the specified directory, and can also be used to check the existence of a + * directory. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, - FilePropertySemantics filePropertySemantics) { + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, directory, timeout, metadata, - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, owner, group, fileMode, filePropertySemantics, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, FilePropertySemantics filePropertySemantics, - Context context) { - final String restype = "directory"; - final String accept = "application/xml"; - return service - .createNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), owner, group, fileMode, filePropertySemantics, - accept, context) + .withContext( + context -> service.getProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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 {@link ResponseBase}. + * Returns all system properties for the specified directory, and can also be used to check the existence of a + * directory. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String shareName, String directory, - Integer timeout, Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, FilePropertySemantics filePropertySemantics, - Context context) { + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String restype = "directory"; - final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), owner, group, fileMode, filePropertySemantics, - accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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. + * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String shareName, String directory, Integer timeout, Map metadata, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode, FilePropertySemantics filePropertySemantics) { - createWithResponse(shareName, directory, timeout, metadata, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode, filePropertySemantics, Context.NONE); + public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a new directory under the specified share or parent directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @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. + * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String shareName, String directory, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, FilePropertySemantics filePropertySemantics, - Context context) { + public Response deleteWithResponse(RequestOptions requestOptions) { try { - final String restype = "directory"; - final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, metadata, this.client.getVersion(), filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, this.client.getFileRequestIntent(), owner, group, fileMode, filePropertySemantics, - accept, context); + return service.deleteSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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>. - * @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}. + * Sets properties for the specified directory. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String shareName, - String directory, String sharesnapshot, Integer timeout) { + public Mono> setPropertiesWithResponseAsync(RequestOptions requestOptions) { return FluxUtil .withContext( - context -> getPropertiesWithResponseAsync(shareName, directory, sharesnapshot, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String shareName, - String directory, String sharesnapshot, Integer timeout, Context context) { - final String restype = "directory"; - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), - sharesnapshot, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + context -> service.setProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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>. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String directory, String sharesnapshot, Integer timeout) { - return getPropertiesWithResponseAsync(shareName, directory, sharesnapshot, timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 A {@link Mono} that completes when a successful response is received. + * Sets properties for the specified directory. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String directory, String sharesnapshot, Integer timeout, - Context context) { - return getPropertiesWithResponseAsync(shareName, directory, sharesnapshot, timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + public Response setPropertiesWithResponse(RequestOptions requestOptions) { + try { + return service.setPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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>. - * @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. + * Sets one or more user-defined name-value pairs for the specified directory. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String directory, - String sharesnapshot, Integer timeout) { + public Mono> setMetadataWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> getPropertiesNoCustomHeadersWithResponseAsync(shareName, directory, sharesnapshot, - timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String directory, - String sharesnapshot, Integer timeout, Context context) { - final String restype = "directory"; - final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) + .withContext( + context -> service.setMetadata(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 {@link ResponseBase}. + * Sets one or more user-defined name-value pairs for the specified directory. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String shareName, - String directory, String sharesnapshot, Integer timeout, Context context) { + public Response setMetadataWithResponse(RequestOptions requestOptions) { try { - final String restype = "directory"; - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + return service.setMetadataSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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>. - * @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. + * Returns a list of files and directories under the specified share or directory. It lists the contents only for a + * single level of the directory hierarchy. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-extended-infoBooleanNoInclude extended information.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ServiceEndpoint: String (Required)
+     *     ShareName: String (Required)
+     *     ShareSnapshot: String (Optional)
+     *     Encoded: Boolean (Optional)
+     *     DirectoryPath: String (Required)
+     *     Prefix (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     Marker: String (Optional)
+     *     MaxResults: Integer (Optional)
+     *     Entries (Required): {
+     *         Directory (Required): [
+     *              (Required){
+     *                 Name (Required): (recursive schema, see Name above)
+     *                 FileId: String (Optional)
+     *                 Properties (Optional): {
+     *                     Content-Length: long (Required)
+     *                     CreationTime: OffsetDateTime (Optional)
+     *                     LastAccessTime: OffsetDateTime (Optional)
+     *                     LastWriteTime: OffsetDateTime (Optional)
+     *                     ChangeTime: OffsetDateTime (Optional)
+     *                     Last-Modified: DateTimeRfc1123 (Optional)
+     *                     Etag: String (Optional)
+     *                 }
+     *                 Attributes: String (Optional)
+     *                 PermissionKey: String (Optional)
+     *             }
+     *         ]
+     *         File (Required): [
+     *              (Required){
+     *                 Name (Required): (recursive schema, see Name above)
+     *                 FileId: String (Optional)
+     *                 Properties (Required): (recursive schema, see Properties above)
+     *                 Attributes: String (Optional)
+     *                 PermissionKey: String (Optional)
+     *             }
+     *         ]
+     *     }
+     *     NextMarker: String (Required)
+     *     DirectoryId: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of directories and files along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String shareName, String directory, String sharesnapshot, Integer timeout) { - getPropertiesWithResponse(shareName, directory, sharesnapshot, timeout, Context.NONE); + public Mono> listFilesAndDirectoriesSegmentWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.listFilesAndDirectoriesSegment(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Returns all system properties for the specified directory, and can also be used to check the existence of a - * directory. The data returned does not include the files in the directory or any subdirectories. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 {@link Response}. + * Returns a list of files and directories under the specified share or directory. It lists the contents only for a + * single level of the directory hierarchy. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-extended-infoBooleanNoInclude extended information.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ServiceEndpoint: String (Required)
+     *     ShareName: String (Required)
+     *     ShareSnapshot: String (Optional)
+     *     Encoded: Boolean (Optional)
+     *     DirectoryPath: String (Required)
+     *     Prefix (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     Marker: String (Optional)
+     *     MaxResults: Integer (Optional)
+     *     Entries (Required): {
+     *         Directory (Required): [
+     *              (Required){
+     *                 Name (Required): (recursive schema, see Name above)
+     *                 FileId: String (Optional)
+     *                 Properties (Optional): {
+     *                     Content-Length: long (Required)
+     *                     CreationTime: OffsetDateTime (Optional)
+     *                     LastAccessTime: OffsetDateTime (Optional)
+     *                     LastWriteTime: OffsetDateTime (Optional)
+     *                     ChangeTime: OffsetDateTime (Optional)
+     *                     Last-Modified: DateTimeRfc1123 (Optional)
+     *                     Etag: String (Optional)
+     *                 }
+     *                 Attributes: String (Optional)
+     *                 PermissionKey: String (Optional)
+     *             }
+     *         ]
+     *         File (Required): [
+     *              (Required){
+     *                 Name (Required): (recursive schema, see Name above)
+     *                 FileId: String (Optional)
+     *                 Properties (Required): (recursive schema, see Properties above)
+     *                 Attributes: String (Optional)
+     *                 PermissionKey: String (Optional)
+     *             }
+     *         ]
+     *     }
+     *     NextMarker: String (Required)
+     *     DirectoryId: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of directories and files along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String shareName, String directory, - String sharesnapshot, Integer timeout, Context context) { + public Response listFilesAndDirectoriesSegmentWithResponse(RequestOptions requestOptions) { try { - final String restype = "directory"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); + return service.listFilesAndDirectoriesSegmentSync(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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>. - * @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> deleteWithResponseAsync(String shareName, - String directory, Integer timeout) { - return FluxUtil.withContext(context -> deleteWithResponseAsync(shareName, directory, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String shareName, - String directory, Integer timeout, Context context) { - final String restype = "directory"; + * Lists handles for directory. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHandlesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .delete(this.client.getUrl(), shareName, directory, restype, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + return FluxUtil + .withContext(context -> service.listHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.implementation.models.HandleItem.fromXml(reader, "Handle"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Entries", "Handle"), null, null)); } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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>. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String directory, Integer timeout) { - return deleteWithResponseAsync(shareName, directory, timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + * Lists handles for directory. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listHandlesAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listHandlesSinglePageAsync(requestOptions)); } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String directory, Integer timeout, Context context) { - return deleteWithResponseAsync(shareName, directory, timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + * Lists handles for directory. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listHandlesSinglePage(RequestOptions requestOptions) { + try { + final String accept = "application/xml"; + Response res = service.listHandlesSync(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.implementation.models.HandleItem.fromXml(reader, "Handle"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Entries", "Handle"), null, null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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>. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout) { - return FluxUtil - .withContext(context -> deleteNoCustomHeadersWithResponseAsync(shareName, directory, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + * Lists handles for directory. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listHandles(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listHandlesSinglePage(requestOptions)); } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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. + * Closes all handles open for given directory. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk ('*') is a wildcard + * that specifies all handles. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, Context context) { - final String restype = "directory"; - final String accept = "application/xml"; - return service - .deleteNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context) + public Mono> forceCloseHandlesWithResponseAsync(String handleId, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.forceCloseHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), handleId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link ResponseBase}. + * Closes all handles open for given directory. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-recursiveBooleanNoSpecifies operation should apply to the directory + * specified in the URI, its files, its subdirectories and their files.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk ('*') is a wildcard + * that specifies all handles. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String shareName, String directory, - Integer timeout, Context context) { + public Response forceCloseHandlesWithResponse(String handleId, RequestOptions requestOptions) { try { - final String restype = "directory"; - final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context); + return service.forceCloseHandlesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + handleId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. + * Renames a directory. By default, the destination is overwritten and if the destination already exists and has a + * read-only attribute set, the operation will fail. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-rename-replace-if-existsBooleanNoBoolean. Default value is false. + * Set to true to indicate that the destination should be overwritten.
x-ms-file-rename-ignore-readonlyBooleanNoBoolean. Default value is false. Set + * to true to overwrite the destination even if it has the read-only attribute set.
x-ms-source-lease-idStringNoRequired if the source file has an active + * lease.
x-ms-destination-lease-idStringNoRequired if the destination has an active + * lease.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the directory.
x-ms-file-last-write-timeStringNoLast write time for the directory.
x-ms-file-change-timeStringNoChange time for the directory.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * directory.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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>. - * @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. + * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String shareName, String directory, Integer timeout) { - deleteWithResponse(shareName, directory, timeout, Context.NONE); + public Mono> renameWithResponseAsync(String renameSource, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.rename(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + renameSource, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Removes the specified empty directory. Note that the directory must be empty before it can be deleted. + * Renames a directory. By default, the destination is overwritten and if the destination already exists and has a + * read-only attribute set, the operation will fail. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-rename-replace-if-existsBooleanNoBoolean. Default value is false. + * Set to true to indicate that the destination should be overwritten.
x-ms-file-rename-ignore-readonlyBooleanNoBoolean. Default value is false. Set + * to true to overwrite the destination even if it has the read-only attribute set.
x-ms-source-lease-idStringNoRequired if the source file has an active + * lease.
x-ms-destination-lease-idStringNoRequired if the destination has an active + * lease.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the directory.
x-ms-file-last-write-timeStringNoLast write time for the directory.
x-ms-file-change-timeStringNoChange time for the directory.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * directory.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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. + * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String shareName, String directory, Integer timeout, - Context context) { + public Response renameWithResponse(String renameSource, RequestOptions requestOptions) { try { - final String restype = "directory"; - final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context); + return service.renameSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), renameSource, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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. - * @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> setPropertiesWithResponseAsync(String shareName, - String directory, Integer timeout, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode) { - return FluxUtil - .withContext(context -> setPropertiesWithResponseAsync(shareName, directory, timeout, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, owner, group, fileMode, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesWithResponseAsync(String shareName, - String directory, Integer timeout, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, Context context) { - final String restype = "directory"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setProperties(this.client.getUrl(), shareName, directory, restype, comp, timeout, this.client.getVersion(), - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - owner, group, fileMode, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(String shareName, String directory, Integer timeout, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, String group, - String fileMode) { - return setPropertiesWithResponseAsync(shareName, directory, timeout, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(String shareName, String directory, Integer timeout, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, String group, - String fileMode, Context context) { - return setPropertiesWithResponseAsync(shareName, directory, timeout, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode, context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode) { - return FluxUtil - .withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, directory, timeout, - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, owner, group, fileMode, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode, Context context) { - final String restype = "directory"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setPropertiesWithResponse(String shareName, - String directory, Integer timeout, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String owner, String group, String fileMode, Context context) { - try { - final String restype = "directory"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setProperties(String shareName, String directory, Integer timeout, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, String group, - String fileMode) { - setPropertiesWithResponse(shareName, directory, timeout, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, owner, group, - fileMode, Context.NONE); - } - - /** - * Sets properties on the directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setPropertiesNoCustomHeadersWithResponse(String shareName, String directory, Integer timeout, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String owner, - String group, String fileMode, Context context) { + private List getValues(BinaryData binaryData, String... path) { try { - final String restype = "directory"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, - timeout, this.client.getVersion(), filePermission, filePermissionFormat, filePermissionKey, - fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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. - * @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> setMetadataWithResponseAsync(String shareName, - String directory, Integer timeout, Map metadata) { - return FluxUtil - .withContext(context -> setMetadataWithResponseAsync(shareName, directory, timeout, metadata, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataWithResponseAsync(String shareName, - String directory, Integer timeout, Map metadata, Context context) { - final String restype = "directory"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadata(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, String directory, Integer timeout, - Map metadata) { - return setMetadataWithResponseAsync(shareName, directory, timeout, metadata) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, String directory, Integer timeout, - Map metadata, Context context) { - return setMetadataWithResponseAsync(shareName, directory, timeout, metadata, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, Map metadata) { - return FluxUtil.withContext( - context -> setMetadataNoCustomHeadersWithResponseAsync(shareName, directory, timeout, metadata, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, String directory, - Integer timeout, Map metadata, Context context) { - final String restype = "directory"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String shareName, String directory, - Integer timeout, Map metadata, Context context) { - try { - final String restype = "directory"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context); + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + List values = (List) value; + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String shareName, String directory, Integer timeout, Map metadata) { - setMetadataWithResponse(shareName, directory, timeout, metadata, Context.NONE); - } - - /** - * Updates user defined metadata for the specified directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String shareName, String directory, Integer timeout, - Map metadata, Context context) { + private String getNextLink(BinaryData binaryData, String... path) { try { - final String restype = "directory"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, - timeout, metadata, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listFilesAndDirectoriesSegmentWithResponseAsync(String shareName, String directory, String prefix, - String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo) { - return FluxUtil - .withContext(context -> listFilesAndDirectoriesSegmentWithResponseAsync(shareName, directory, prefix, - sharesnapshot, marker, maxresults, timeout, include, includeExtendedInfo, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listFilesAndDirectoriesSegmentWithResponseAsync(String shareName, String directory, String prefix, - String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo, Context context) { - final String restype = "directory"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegment(this.client.getUrl(), shareName, directory, restype, comp, prefix, - sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, includeExtendedInfo, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFilesAndDirectoriesSegmentAsync(String shareName, - String directory, String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo) { - return listFilesAndDirectoriesSegmentWithResponseAsync(shareName, directory, prefix, sharesnapshot, marker, - maxresults, timeout, include, includeExtendedInfo) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listFilesAndDirectoriesSegmentAsync(String shareName, - String directory, String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo, Context context) { - return listFilesAndDirectoriesSegmentWithResponseAsync(shareName, directory, prefix, sharesnapshot, marker, - maxresults, timeout, include, includeExtendedInfo, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listFilesAndDirectoriesSegmentNoCustomHeadersWithResponseAsync(String shareName, String directory, - String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo) { - return FluxUtil - .withContext(context -> listFilesAndDirectoriesSegmentNoCustomHeadersWithResponseAsync(shareName, directory, - prefix, sharesnapshot, marker, maxresults, timeout, include, includeExtendedInfo, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listFilesAndDirectoriesSegmentNoCustomHeadersWithResponseAsync(String shareName, String directory, - String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo, Context context) { - final String restype = "directory"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listFilesAndDirectoriesSegmentNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, - prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, - includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - listFilesAndDirectoriesSegmentWithResponse(String shareName, String directory, String prefix, - String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo, Context context) { - try { - final String restype = "directory"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegmentSync(this.client.getUrl(), shareName, directory, restype, comp, - prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), includeConverted, - includeExtendedInfo, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context); + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + return (String) value; + } catch (RuntimeException e) { + return null; + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListFilesAndDirectoriesSegmentResponse listFilesAndDirectoriesSegment(String shareName, String directory, - String prefix, String sharesnapshot, String marker, Integer maxresults, Integer timeout, - List include, Boolean includeExtendedInfo) { - try { - return listFilesAndDirectoriesSegmentWithResponse(shareName, directory, prefix, sharesnapshot, marker, - maxresults, timeout, include, includeExtendedInfo, Context.NONE).getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } + private static final com.azure.core.util.serializer.ObjectSerializer XML_SERIALIZER + = XmlSerializerProviders.createInstance(); - /** - * Returns a list of files or directories under the specified share or directory. It lists the contents only for a - * single level of the directory hierarchy. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 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 include Include this parameter to specify one or more datasets to include in the response. - * @param includeExtendedInfo Include extended information. - * @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 an enumeration of directories and files along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listFilesAndDirectoriesSegmentNoCustomHeadersWithResponse( - String shareName, String directory, String prefix, String sharesnapshot, String marker, Integer maxresults, - Integer timeout, List include, Boolean includeExtendedInfo, Context context) { + private List getXmlValues(BinaryData binaryData, + java.util.function.Function valueReader, String... path) { try { - final String restype = "directory"; - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.listFilesAndDirectoriesSegmentNoCustomHeadersSync(this.client.getUrl(), shareName, directory, - restype, comp, prefix, sharesnapshot, marker, maxresults, timeout, this.client.getVersion(), - includeConverted, includeExtendedInfo, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesWithResponseAsync( - String shareName, String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, - Boolean recursive) { - return FluxUtil - .withContext(context -> listHandlesWithResponseAsync(shareName, directory, marker, maxresults, timeout, - sharesnapshot, recursive, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesWithResponseAsync( - String shareName, String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, - Boolean recursive, Context context) { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service - .listHandles(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, sharesnapshot, - recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHandlesAsync(String shareName, String directory, String marker, - Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive) { - return listHandlesWithResponseAsync(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHandlesAsync(String shareName, String directory, String marker, - Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, Context context) { - return listHandlesWithResponseAsync(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesNoCustomHeadersWithResponseAsync(String shareName, - String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive) { - return FluxUtil - .withContext(context -> listHandlesNoCustomHeadersWithResponseAsync(shareName, directory, marker, - maxresults, timeout, sharesnapshot, recursive, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesNoCustomHeadersWithResponseAsync(String shareName, - String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, - Context context) { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service - .listHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, marker, maxresults, timeout, - sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase listHandlesWithResponse(String shareName, - String directory, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, - Context context) { - try { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service.listHandlesSync(this.client.getUrl(), shareName, directory, comp, marker, maxresults, - timeout, sharesnapshot, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlValues(reader, valueReader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ListHandlesResponse listHandles(String shareName, String directory, String marker, Integer maxresults, - Integer timeout, String sharesnapshot, Boolean recursive) { + private List getXmlValues(com.azure.xml.XmlReader reader, + java.util.function.Function valueReader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { try { - return listHandlesWithResponse(shareName, directory, marker, maxresults, timeout, sharesnapshot, recursive, - Context.NONE).getValue(); + List values = new java.util.ArrayList<>(); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + values.add(valueReader.apply(reader)); + } else { + values.addAll(getXmlValues(reader, valueReader, path, pathIndex + 1)); + } + } + return values; } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Lists handles for directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 an enumeration of handles along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHandlesNoCustomHeadersWithResponse(String shareName, String directory, - String marker, Integer maxresults, Integer timeout, String sharesnapshot, Boolean recursive, Context context) { + private String getXmlNextLink(BinaryData binaryData, String... path) { try { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, marker, - maxresults, timeout, sharesnapshot, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlNextLink(reader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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> forceCloseHandlesWithResponseAsync( - String shareName, String directory, String handleId, Integer timeout, String marker, String sharesnapshot, - Boolean recursive) { - return FluxUtil - .withContext(context -> forceCloseHandlesWithResponseAsync(shareName, directory, handleId, timeout, marker, - sharesnapshot, recursive, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesWithResponseAsync( - String shareName, String directory, String handleId, Integer timeout, String marker, String sharesnapshot, - Boolean recursive, Context context) { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service - .forceCloseHandles(this.client.getUrl(), shareName, directory, comp, timeout, marker, sharesnapshot, - handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono forceCloseHandlesAsync(String shareName, String directory, String handleId, Integer timeout, - String marker, String sharesnapshot, Boolean recursive) { - return forceCloseHandlesWithResponseAsync(shareName, directory, handleId, timeout, marker, sharesnapshot, - recursive).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono forceCloseHandlesAsync(String shareName, String directory, String handleId, Integer timeout, - String marker, String sharesnapshot, Boolean recursive, Context context) { - return forceCloseHandlesWithResponseAsync(shareName, directory, handleId, timeout, marker, sharesnapshot, - recursive, context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(String shareName, String directory, - String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive) { - return FluxUtil - .withContext(context -> forceCloseHandlesNoCustomHeadersWithResponseAsync(shareName, directory, handleId, - timeout, marker, sharesnapshot, recursive, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(String shareName, String directory, - String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, Context context) { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service - .forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, directory, comp, timeout, marker, - sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase forceCloseHandlesWithResponse(String shareName, - String directory, String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, - Context context) { + private String getXmlNextLink(com.azure.xml.XmlReader reader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { try { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service.forceCloseHandlesSync(this.client.getUrl(), shareName, directory, comp, timeout, marker, - sharesnapshot, handleId, recursive, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + return reader.getStringElement(); + } else { + return getXmlNextLink(reader, path, pathIndex + 1); + } + } + return null; } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void forceCloseHandles(String shareName, String directory, String handleId, Integer timeout, String marker, - String sharesnapshot, Boolean recursive) { - forceCloseHandlesWithResponse(shareName, directory, handleId, timeout, marker, sharesnapshot, recursive, - Context.NONE); - } - - /** - * Closes all handles open for given directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param recursive Specifies operation should apply to the directory specified in the URI, its files, its - * subdirectories and their files. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response forceCloseHandlesNoCustomHeadersWithResponse(String shareName, String directory, - String handleId, Integer timeout, String marker, String sharesnapshot, Boolean recursive, Context context) { + public Response listHandlesWithResponse(RequestOptions requestOptions) { try { - final String comp = "forceclosehandles"; final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, directory, comp, - timeout, marker, sharesnapshot, handleId, recursive, this.client.getVersion(), - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service.listHandlesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @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> renameWithResponseAsync(String shareName, - String directory, String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - Map metadata, SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo) { - return FluxUtil - .withContext(context -> renameWithResponseAsync(shareName, directory, renameSource, timeout, - replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, - sourceLeaseAccessConditions, destinationLeaseAccessConditions, copyFileSmbInfo, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameWithResponseAsync(String shareName, - String directory, String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - Map metadata, SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - Context context) { - final String restype = "directory"; - final String comp = "rename"; + public Mono> listHandlesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - return service - .rename(this.client.getUrl(), shareName, directory, restype, comp, timeout, this.client.getVersion(), - renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renameAsync(String shareName, String directory, String renameSource, Integer timeout, - Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo) { - return renameWithResponseAsync(shareName, directory, renameSource, timeout, replaceIfExists, ignoreReadOnly, - filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renameAsync(String shareName, String directory, String renameSource, Integer timeout, - Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - Context context) { - return renameWithResponseAsync(shareName, directory, renameSource, timeout, replaceIfExists, ignoreReadOnly, - filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameNoCustomHeadersWithResponseAsync(String shareName, String directory, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo) { return FluxUtil - .withContext(context -> renameNoCustomHeadersWithResponseAsync(shareName, directory, renameSource, timeout, - replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, - sourceLeaseAccessConditions, destinationLeaseAccessConditions, copyFileSmbInfo, context)) + .withContext(context -> service.listHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameNoCustomHeadersWithResponseAsync(String shareName, String directory, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - Context context) { - final String restype = "directory"; - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - return service - .renameNoCustomHeaders(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renameWithResponse(String shareName, String directory, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - Context context) { - try { - final String restype = "directory"; - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - return service.renameSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rename(String shareName, String directory, String renameSource, Integer timeout, - Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo) { - renameWithResponse(shareName, directory, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, - filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, Context.NONE); - } - - /** - * Renames a directory. - * - * @param shareName The name of the target share. - * @param directory The path of the target directory. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renameNoCustomHeadersWithResponse(String shareName, String directory, String renameSource, - Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - Context context) { - try { - final String restype = "directory"; - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, directory, restype, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); - } 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/FilesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java index e2391f3e7923..98e6e42204b0 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 @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -11,64 +10,34 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +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.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; -import com.azure.core.http.rest.StreamResponse; -import com.azure.core.util.Base64Util; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.file.share.implementation.models.CopyFileSmbInfo; -import com.azure.storage.file.share.implementation.models.DestinationLeaseAccessConditions; -import com.azure.storage.file.share.implementation.models.FilesAbortCopyHeaders; -import com.azure.storage.file.share.implementation.models.FilesAcquireLeaseHeaders; -import com.azure.storage.file.share.implementation.models.FilesBreakLeaseHeaders; -import com.azure.storage.file.share.implementation.models.FilesChangeLeaseHeaders; -import com.azure.storage.file.share.implementation.models.FilesCreateHardLinkHeaders; -import com.azure.storage.file.share.implementation.models.FilesCreateHeaders; -import com.azure.storage.file.share.implementation.models.FilesCreateSymbolicLinkHeaders; -import com.azure.storage.file.share.implementation.models.FilesDeleteHeaders; -import com.azure.storage.file.share.implementation.models.FilesDownloadHeaders; -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.FilesGetSymbolicLinkHeaders; -import com.azure.storage.file.share.implementation.models.FilesListHandlesHeaders; -import com.azure.storage.file.share.implementation.models.FilesReleaseLeaseHeaders; -import com.azure.storage.file.share.implementation.models.FilesRenameHeaders; -import com.azure.storage.file.share.implementation.models.FilesSetHttpHeadersHeaders; -import com.azure.storage.file.share.implementation.models.FilesSetMetadataHeaders; -import com.azure.storage.file.share.implementation.models.FilesStartCopyHeaders; -import com.azure.storage.file.share.implementation.models.FilesUploadRangeFromURLHeaders; -import com.azure.storage.file.share.implementation.models.FilesUploadRangeHeaders; -import com.azure.storage.file.share.implementation.models.ListHandlesResponse; -import com.azure.storage.file.share.implementation.models.ShareFileRangeWriteType; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; -import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; import com.azure.storage.file.share.implementation.util.ModelHelper; -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.ModeCopyMode; -import com.azure.storage.file.share.models.NfsFileType; -import com.azure.storage.file.share.models.OwnerCopyMode; -import com.azure.storage.file.share.models.PermissionCopyModeType; -import com.azure.storage.file.share.models.ShareFileHttpHeaders; -import com.azure.storage.file.share.models.ShareFileRangeList; import com.azure.storage.file.share.models.ShareTokenIntent; -import com.azure.storage.file.share.models.SourceModifiedAccessConditions; -import java.io.InputStream; -import java.nio.ByteBuffer; +import java.util.List; import java.util.Map; -import reactor.core.publisher.Flux; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** @@ -96,6 +65,19 @@ public final class FilesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ShareServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + /** * The interface defining all the services for AzureFileStorageFiles to be used by the proxy service to perform REST * calls. @@ -104,9765 +86,3027 @@ public final class FilesImpl { @ServiceInterface(name = "AzureFileStorageFiles") public interface FilesService { - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> create(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") Flux optionalbody, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") Flux optionalbody, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> create(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{shareName}/{fileName}") + @Put("/") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-content-length") long fileContentLength, @HeaderParam("x-ms-type") String fileType, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Put("/") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("fileName") String fileName, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-content-length") long fileContentLength, - @HeaderParam("x-ms-type") String fileTypeConstant, @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("x-ms-file-file-type") NfsFileType nfsFileType, - @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-file-property-semantics") FilePropertySemantics filePropertySemantics, - @HeaderParam("Content-Length") Long contentLength, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-content-length") long fileContentLength, @HeaderParam("x-ms-type") String fileType, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono>> download(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") + @Get("/") @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono downloadNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase downloadSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200, 206 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response downloadNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Head("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getProperties(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> download(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Head("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, + @Get("/") + @ExpectedResponses({ 200, 206 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response downloadSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Head("/{shareName}/{fileName}") + @Head("/") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Head("/{shareName}/{fileName}") + @Head("/") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> delete(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> deleteNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Delete("/{shareName}/{fileName}") + @Delete("/") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("fileName") String fileName, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setHttpHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") Long fileContentLength, - @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @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-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setHttpHeadersNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") Long fileContentLength, - @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setHttpHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") Long fileContentLength, - @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @HeaderParam("x-ms-lease-id") String leaseId, + @Delete("/") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setHttpHeadersNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-length") Long fileContentLength, - @HeaderParam("x-ms-content-type") String contentType, - @HeaderParam("x-ms-content-encoding") String contentEncoding, - @HeaderParam("x-ms-content-language") String contentLanguage, - @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-md5") String contentMd5, - @HeaderParam("x-ms-content-disposition") String contentDisposition, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, @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-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRange(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setHttpHeaders(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") Flux optionalbody, @HeaderParam("Accept") String accept, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRangeNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @Put("?comp=properties") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setHttpHeadersSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") Flux optionalbody, @HeaderParam("Accept") String accept, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRange(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @Put("?comp=metadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setMetadata(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRangeNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, + @Put("?comp=metadata") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setMetadataSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase uploadRangeSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> acquireLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response uploadRangeNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-write") ShareFileRangeWriteType fileRangeWrite, - @HeaderParam("Content-Length") long contentLength, @HeaderParam("Content-MD5") String contentMD5, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-structured-body") String structuredBodyType, - @HeaderParam("x-ms-structured-content-length") Long structuredContentLength, - @BodyParam("application/octet-stream") BinaryData optionalbody, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response acquireLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadata(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> acquireLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase acquireLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> releaseLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase releaseLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response releaseLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> changeLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> releaseLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response releaseLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase changeLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> changeLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response changeLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> breakLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response changeLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase breakLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> breakLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=lease") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response breakLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response breakLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, + @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=range") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRangeFromURL(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-source-content-crc64") String sourceContentCrc64, - @HeaderParam("x-ms-source-if-match-crc64") String sourceIfMatchCrc64, - @HeaderParam("x-ms-source-if-none-match-crc64") String sourceIfNoneMatchCrc64, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadRange(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Range") String range, @HeaderParam("x-ms-write") String fileRangeWrite, + @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=range") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> uploadRangeFromURLNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-source-content-crc64") String sourceContentCrc64, - @HeaderParam("x-ms-source-if-match-crc64") String sourceIfMatchCrc64, - @HeaderParam("x-ms-source-if-none-match-crc64") String sourceIfNoneMatchCrc64, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadRangeSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Range") String range, @HeaderParam("x-ms-write") String fileRangeWrite, + @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=range") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase uploadRangeFromURLSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-source-content-crc64") String sourceContentCrc64, - @HeaderParam("x-ms-source-if-match-crc64") String sourceIfMatchCrc64, - @HeaderParam("x-ms-source-if-none-match-crc64") String sourceIfNoneMatchCrc64, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> uploadRangeFromUrl(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Range") String range, + @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, + @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=range") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response uploadRangeFromURLNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-range") String range, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-source-range") String sourceRange, - @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, @HeaderParam("Content-Length") long contentLength, - @HeaderParam("x-ms-source-content-crc64") String sourceContentCrc64, - @HeaderParam("x-ms-source-if-match-crc64") String sourceIfMatchCrc64, - @HeaderParam("x-ms-source-if-none-match-crc64") String sourceIfNoneMatchCrc64, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-file-last-write-time") FileLastWrittenMode fileLastWrittenMode, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadRangeFromUrlSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Range") String range, + @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-write") String fileRangeWriteFromUrl, + @HeaderParam("Content-Length") long contentLength, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{fileName}") + @Get("?comp=rangelist") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getRangeList(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("sharesnapshot") String sharesnapshot, - @QueryParam("prevsharesnapshot") String prevsharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getRangeList(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}/{fileName}") + @Get("?comp=rangelist") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getRangeListNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("sharesnapshot") String sharesnapshot, - @QueryParam("prevsharesnapshot") String prevsharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getRangeListSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}/{fileName}") + @Get("?comp=rangelist") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getRangeListSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("sharesnapshot") String sharesnapshot, - @QueryParam("prevsharesnapshot") String prevsharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listAllRanges(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-file-support-rename") Boolean supportRename, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}/{fileName}") + @Get("?comp=rangelist") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getRangeListNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("sharesnapshot") String sharesnapshot, - @QueryParam("prevsharesnapshot") String prevsharesnapshot, @QueryParam("timeout") Integer timeout, - @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, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> startCopy(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-copy-mode") PermissionCopyModeType filePermissionCopyMode, - @HeaderParam("x-ms-file-copy-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-copy-set-archive") Boolean setArchiveAttribute, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-mode-copy-mode") ModeCopyMode fileModeCopyMode, - @HeaderParam("x-ms-file-owner-copy-mode") OwnerCopyMode fileOwnerCopyMode, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> startCopyNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-copy-mode") PermissionCopyModeType filePermissionCopyMode, - @HeaderParam("x-ms-file-copy-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-copy-set-archive") Boolean setArchiveAttribute, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listAllRangesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-mode-copy-mode") ModeCopyMode fileModeCopyMode, - @HeaderParam("x-ms-file-owner-copy-mode") OwnerCopyMode fileOwnerCopyMode, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Put("/") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase startCopySync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-copy-mode") PermissionCopyModeType filePermissionCopyMode, - @HeaderParam("x-ms-file-copy-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-copy-set-archive") Boolean setArchiveAttribute, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> startCopy(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-mode-copy-mode") ModeCopyMode fileModeCopyMode, - @HeaderParam("x-ms-file-owner-copy-mode") OwnerCopyMode fileOwnerCopyMode, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("/") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response startCopyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-copy-source") String copySource, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-copy-mode") PermissionCopyModeType filePermissionCopyMode, - @HeaderParam("x-ms-file-copy-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-copy-set-archive") Boolean setArchiveAttribute, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response startCopySync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-mode") String fileMode, - @HeaderParam("x-ms-file-mode-copy-mode") ModeCopyMode fileModeCopyMode, - @HeaderParam("x-ms-file-owner-copy-mode") OwnerCopyMode fileOwnerCopyMode, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> abortCopy(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("copyid") String copyId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> abortCopyNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("copyid") String copyId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=copy") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase abortCopySync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("copyid") String copyId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> abortCopy(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, @QueryParam("copyid") String copyid, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=copy") @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response abortCopyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("copyid") String copyId, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listHandles(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listHandlesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase listHandlesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response listHandlesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> forceCloseHandles(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> forceCloseHandlesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response abortCopySync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-copy-action") String copyActionAbortConstant, @QueryParam("copyid") String copyid, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Get("?comp=listhandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase forceCloseHandlesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listHandles(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Get("?comp=listhandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response forceCloseHandlesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @QueryParam("marker") String marker, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listHandlesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=forceclosehandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> rename(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-content-type") String contentType, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> forceCloseHandles(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=forceclosehandles") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> renameNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-content-type") String contentType, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response forceCloseHandlesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-handle-id") String handleId, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, - @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=rename") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase renameSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-content-type") String contentType, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> rename(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-rename-source") String renameSource, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?comp=rename") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response renameNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @PathParam("fileName") String fileName, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response renameSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-rename-source") String renameSource, - @HeaderParam("x-ms-file-rename-replace-if-exists") Boolean replaceIfExists, - @HeaderParam("x-ms-file-rename-ignore-readonly") Boolean ignoreReadOnly, - @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, - @HeaderParam("x-ms-destination-lease-id") String destinationLeaseId, - @HeaderParam("x-ms-file-attributes") String fileAttributes, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-file-change-time") String fileChangeTime, - @HeaderParam("x-ms-file-permission") String filePermission, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-allow-trailing-dot") Boolean allowTrailingDot, @HeaderParam("x-ms-source-allow-trailing-dot") Boolean allowSourceTrailingDot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createSymbolicLink(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-link-text") String linkText, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createSymbolicLinkNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-link-text") String linkText, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?restype=symboliclink") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createSymbolicLinkSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-link-text") String linkText, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createSymbolicLink(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-link-text") String linkText, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?restype=symboliclink") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createSymbolicLinkNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-file-creation-time") String fileCreationTime, - @HeaderParam("x-ms-file-last-write-time") String fileLastWriteTime, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, - @HeaderParam("x-ms-link-text") String linkText, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getSymbolicLink(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}/{fileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getSymbolicLinkNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSymbolicLinkSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-link-text") String linkText, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{fileName}") + @Get("?restype=symboliclink") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getSymbolicLinkSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSymbolicLink(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}/{fileName}") + @Get("?restype=symboliclink") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getSymbolicLinkNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSymbolicLinkSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?restype=hardlink") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createHardLink(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-type") String fileTypeConstant, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createHardLink(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-type") String fileType, @HeaderParam("x-ms-file-target-file") String targetFile, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}/{fileName}") + @Put("?restype=hardlink") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createHardLinkNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-type") String fileTypeConstant, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-target-file") String targetFile, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createHardLinkSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-type") String fileTypeConstant, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-target-file") String targetFile, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}/{fileName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createHardLinkNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @PathParam("fileName") String fileName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-type") String fileTypeConstant, - @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-target-file") String targetFile, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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> createWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, - filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, optionalbody, - shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .create(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, group, fileMode, nfsFileType, - contentMD5Converted, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String fileName, long fileContentLength, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, filePropertySemantics, - contentLength, structuredBodyType, structuredContentLength, optionalbody, shareFileHttpHeaders) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String fileName, long fileContentLength, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - return createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, filePropertySemantics, - contentLength, structuredBodyType, structuredContentLength, optionalbody, shareFileHttpHeaders, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, fileName, fileContentLength, - timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, - contentMD5, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .createNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, group, fileMode, nfsFileType, - contentMD5Converted, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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> createWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, - filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, optionalbody, - shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .create(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, group, fileMode, nfsFileType, - contentMD5Converted, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String fileName, long fileContentLength, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, filePropertySemantics, - contentLength, structuredBodyType, structuredContentLength, optionalbody, shareFileHttpHeaders) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, String fileName, long fileContentLength, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - return createWithResponseAsync(shareName, fileName, fileContentLength, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, filePropertySemantics, - contentLength, structuredBodyType, structuredContentLength, optionalbody, shareFileHttpHeaders, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, fileName, fileContentLength, - timeout, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, - contentMD5, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .createNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, group, fileMode, nfsFileType, - contentMD5Converted, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String shareName, String fileName, - long fileContentLength, Integer timeout, Map metadata, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, NfsFileType nfsFileType, byte[] contentMD5, - FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - try { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.createSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), fileContentLength, fileTypeConstant, contentType, contentEncoding, - contentLanguage, cacheControl, contentMd5Converted, contentDisposition, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, group, fileMode, nfsFileType, - contentMD5Converted, filePropertySemantics, contentLength, structuredBodyType, structuredContentLength, - optionalbody, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String shareName, String fileName, long fileContentLength, Integer timeout, - Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders) { - createWithResponse(shareName, fileName, fileContentLength, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, nfsFileType, contentMD5, filePropertySemantics, - contentLength, structuredBodyType, structuredContentLength, optionalbody, shareFileHttpHeaders, - Context.NONE); - } - - /** - * Creates a new file or replaces a file. Can also initialize the file with content. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 nfsFileType Optional, NFS only. Type of the file or directory. - * @param contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param filePropertySemantics SMB only, default value is New. New will forcefully add the ARCHIVE attribute flag - * and alter the permissions specified in x-ms-file-permission to inherit missing permissions from the parent. - * Restore will apply changes without further modification. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String shareName, String fileName, long fileContentLength, - Integer timeout, Map metadata, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, NfsFileType nfsFileType, - byte[] contentMD5, FilePropertySemantics filePropertySemantics, Long contentLength, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, ShareFileHttpHeaders shareFileHttpHeaders, - Context context) { - try { - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), fileContentLength, - fileTypeConstant, contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, - contentDisposition, metadata, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, this.client.getFileRequestIntent(), owner, - group, fileMode, nfsFileType, contentMD5Converted, filePropertySemantics, contentLength, - structuredBodyType, structuredContentLength, optionalbody, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> downloadWithResponseAsync(String shareName, - String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String structuredBodyType, - String leaseId) { - return FluxUtil - .withContext(context -> downloadWithResponseAsync(shareName, fileName, timeout, range, rangeGetContentMD5, - structuredBodyType, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> downloadWithResponseAsync(String shareName, - String fileName, Integer timeout, String range, Boolean rangeGetContentMD5, String structuredBodyType, - String leaseId, Context context) { - final String accept = "application/xml"; - return service - .download(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), range, rangeGetContentMD5, structuredBodyType, leaseId, - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux downloadAsync(String shareName, String fileName, Integer timeout, String range, - Boolean rangeGetContentMD5, String structuredBodyType, String leaseId) { - return downloadWithResponseAsync(shareName, fileName, timeout, range, rangeGetContentMD5, structuredBodyType, - leaseId).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Flux downloadAsync(String shareName, String fileName, Integer timeout, String range, - Boolean rangeGetContentMD5, String structuredBodyType, String leaseId, Context context) { - return downloadWithResponseAsync(shareName, fileName, timeout, range, rangeGetContentMD5, structuredBodyType, - leaseId, context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue()); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String range, Boolean rangeGetContentMD5, String structuredBodyType, String leaseId) { - return FluxUtil - .withContext(context -> downloadNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, range, - rangeGetContentMD5, structuredBodyType, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String range, Boolean rangeGetContentMD5, String structuredBodyType, String leaseId, - Context context) { - final String accept = "application/xml"; - return service - .downloadNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), range, rangeGetContentMD5, structuredBodyType, leaseId, - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase downloadWithResponse(String shareName, String fileName, - Integer timeout, String range, Boolean rangeGetContentMD5, String structuredBodyType, String leaseId, - Context context) { - try { - final String accept = "application/xml"; - return service.downloadSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), range, rangeGetContentMD5, structuredBodyType, leaseId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InputStream download(String shareName, String fileName, Integer timeout, String range, - Boolean rangeGetContentMD5, String structuredBodyType, String leaseId) { - try { - return downloadWithResponse(shareName, fileName, timeout, range, rangeGetContentMD5, structuredBodyType, - leaseId, Context.NONE).getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Reads or downloads a file from the system, including its metadata and properties. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 Return file data only from the specified byte range. - * @param rangeGetContentMD5 When this header is set to true and specified together with the Range header, the - * service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. - * @param structuredBodyType Specifies the response content should be returned as a structured message and specifies - * the message schema version and properties. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - String range, Boolean rangeGetContentMD5, String structuredBodyType, String leaseId, Context context) { - try { - final String accept = "application/xml"; - return service.downloadNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), range, rangeGetContentMD5, - structuredBodyType, leaseId, this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> getPropertiesWithResponseAsync(String shareName, - String fileName, String sharesnapshot, Integer timeout, String leaseId) { - return FluxUtil.withContext( - context -> getPropertiesWithResponseAsync(shareName, fileName, sharesnapshot, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String shareName, - String fileName, String sharesnapshot, Integer timeout, String leaseId, Context context) { - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), sharesnapshot, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, - String leaseId) { - return getPropertiesWithResponseAsync(shareName, fileName, sharesnapshot, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String fileName, String sharesnapshot, Integer timeout, - String leaseId, Context context) { - return getPropertiesWithResponseAsync(shareName, fileName, sharesnapshot, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String sharesnapshot, Integer timeout, String leaseId) { - return FluxUtil - .withContext(context -> getPropertiesNoCustomHeadersWithResponseAsync(shareName, fileName, sharesnapshot, - timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String sharesnapshot, Integer timeout, String leaseId, Context context) { - final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - sharesnapshot, timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String shareName, String fileName, - String sharesnapshot, Integer timeout, String leaseId, Context context) { - try { - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String shareName, String fileName, String sharesnapshot, Integer timeout, - String leaseId) { - getPropertiesWithResponse(shareName, fileName, sharesnapshot, timeout, leaseId, Context.NONE); - } - - /** - * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not - * return the content of the 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 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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String shareName, String fileName, - String sharesnapshot, Integer timeout, String leaseId, Context context) { - try { - final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), sharesnapshot, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> deleteWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId) { - return FluxUtil.withContext(context -> deleteWithResponseAsync(shareName, fileName, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId, Context context) { - final String accept = "application/xml"; - return service - .delete(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String fileName, Integer timeout, String leaseId) { - return deleteWithResponseAsync(shareName, fileName, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String fileName, Integer timeout, String leaseId, Context context) { - return deleteWithResponseAsync(shareName, fileName, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId) { - return FluxUtil - .withContext( - context -> deleteNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId, Context context) { - final String accept = "application/xml"; - return service - .deleteNoCustomHeaders(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String shareName, String fileName, Integer timeout, - String leaseId, Context context) { - try { - final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, fileName, this.client.isAllowTrailingDot(), - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String shareName, String fileName, Integer timeout, String leaseId) { - deleteWithResponse(shareName, fileName, timeout, leaseId, Context.NONE); - } - - /** - * removes the file from the storage account. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - String leaseId, Context context) { - try { - final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, - this.client.isAllowTrailingDot(), timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders 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> setHttpHeadersWithResponseAsync(String shareName, - String fileName, Integer timeout, Long fileContentLength, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> setHttpHeadersWithResponseAsync(shareName, fileName, timeout, fileContentLength, - filePermission, filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setHttpHeadersWithResponseAsync(String shareName, - String fileName, Integer timeout, Long fileContentLength, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, String fileAttributes, - String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, String owner, - String group, String fileMode, ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service - .setHttpHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), - fileContentLength, contentType, contentEncoding, contentLanguage, cacheControl, contentMd5Converted, - contentDisposition, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setHttpHeadersAsync(String shareName, String fileName, Integer timeout, Long fileContentLength, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, - String owner, String group, String fileMode, ShareFileHttpHeaders shareFileHttpHeaders) { - return setHttpHeadersWithResponseAsync(shareName, fileName, timeout, fileContentLength, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, shareFileHttpHeaders) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setHttpHeadersAsync(String shareName, String fileName, Integer timeout, Long fileContentLength, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, - String owner, String group, String fileMode, ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - return setHttpHeadersWithResponseAsync(shareName, fileName, timeout, fileContentLength, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, shareFileHttpHeaders, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Long fileContentLength, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, - ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil - .withContext(context -> setHttpHeadersNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, - fileContentLength, filePermission, filePermissionFormat, filePermissionKey, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, owner, group, fileMode, - shareFileHttpHeaders, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders Parameter group. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setHttpHeadersNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Long fileContentLength, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - final String comp = "properties"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service - .setHttpHeadersNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, - cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), owner, group, fileMode, accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setHttpHeadersWithResponse(String shareName, String fileName, - Integer timeout, Long fileContentLength, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - try { - final String comp = "properties"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, - cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), owner, group, fileMode, accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setHttpHeaders(String shareName, String fileName, Integer timeout, Long fileContentLength, - String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, - String fileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, String leaseId, - String owner, String group, String fileMode, ShareFileHttpHeaders shareFileHttpHeaders) { - setHttpHeadersWithResponse(shareName, fileName, timeout, fileContentLength, filePermission, - filePermissionFormat, filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, leaseId, owner, group, fileMode, shareFileHttpHeaders, Context.NONE); - } - - /** - * Sets HTTP headers on the file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 fileContentLength Resizes a file to the specified size. If the specified byte value is less than the - * current size of the file, then all ranges above the specified byte value are cleared. - * @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 fileAttributes If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file - * and ‘Directory’ for directory. ‘None’ can also be specified as default. - * @param fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param fileChangeTime Change time for the file/directory. Default value: Now. - * @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 shareFileHttpHeaders Parameter group. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setHttpHeadersNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - Long fileContentLength, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, String fileAttributes, String fileCreationTime, String fileLastWriteTime, - String fileChangeTime, String leaseId, String owner, String group, String fileMode, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - try { - final String comp = "properties"; - final String accept = "application/xml"; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - String contentEncodingInternal = null; - if (shareFileHttpHeaders != null) { - contentEncodingInternal = shareFileHttpHeaders.getContentEncoding(); - } - String contentEncoding = contentEncodingInternal; - String contentLanguageInternal = null; - if (shareFileHttpHeaders != null) { - contentLanguageInternal = shareFileHttpHeaders.getContentLanguage(); - } - String contentLanguage = contentLanguageInternal; - String cacheControlInternal = null; - if (shareFileHttpHeaders != null) { - cacheControlInternal = shareFileHttpHeaders.getCacheControl(); - } - String cacheControl = cacheControlInternal; - byte[] contentMd5Internal = null; - if (shareFileHttpHeaders != null) { - contentMd5Internal = shareFileHttpHeaders.getContentMd5(); - } - byte[] contentMd5 = contentMd5Internal; - String contentDispositionInternal = null; - if (shareFileHttpHeaders != null) { - contentDispositionInternal = shareFileHttpHeaders.getContentDisposition(); - } - String contentDisposition = contentDispositionInternal; - String contentMd5Converted = Base64Util.encodeToString(contentMd5); - return service.setHttpHeadersNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), fileContentLength, contentType, contentEncoding, contentLanguage, - cacheControl, contentMd5Converted, contentDisposition, filePermission, filePermissionFormat, - filePermissionKey, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, leaseId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), owner, group, fileMode, accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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> uploadRangeWithResponseAsync(String shareName, - String fileName, String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, - byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, Flux optionalbody) { - return FluxUtil - .withContext(context -> uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, - contentLength, timeout, contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, - structuredContentLength, optionalbody, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeWithResponseAsync(String shareName, - String fileName, String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, - byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, Context context) { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, contentLength, - contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), structuredBodyType, - structuredContentLength, optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeAsync(String shareName, String fileName, String range, - ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, - FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, Long structuredContentLength, - Flux optionalbody) { - return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeAsync(String shareName, String fileName, String range, - ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, - FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, Long structuredContentLength, - Flux optionalbody, Context context) { - return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, - String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, Flux optionalbody) { - return FluxUtil - .withContext(context -> uploadRangeNoCustomHeadersWithResponseAsync(shareName, fileName, range, - fileRangeWrite, contentLength, timeout, contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, - structuredContentLength, optionalbody, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, - String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, Flux optionalbody, Context context) { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, - contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), structuredBodyType, - structuredContentLength, optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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> uploadRangeWithResponseAsync(String shareName, - String fileName, String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, - byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody) { - return FluxUtil - .withContext(context -> uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, - contentLength, timeout, contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, - structuredContentLength, optionalbody, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeWithResponseAsync(String shareName, - String fileName, String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, - byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, Context context) { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .uploadRange(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, contentLength, - contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), structuredBodyType, - structuredContentLength, optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeAsync(String shareName, String fileName, String range, - ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, - FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, Long structuredContentLength, - BinaryData optionalbody) { - return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeAsync(String shareName, String fileName, String range, - ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, - FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, Long structuredContentLength, - BinaryData optionalbody, Context context) { - return uploadRangeWithResponseAsync(shareName, fileName, range, fileRangeWrite, contentLength, timeout, - contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, - String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody) { - return FluxUtil - .withContext(context -> uploadRangeNoCustomHeadersWithResponseAsync(shareName, fileName, range, - fileRangeWrite, contentLength, timeout, contentMD5, leaseId, fileLastWrittenMode, structuredBodyType, - structuredContentLength, optionalbody, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, - String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, Context context) { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service - .uploadRangeNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, fileRangeWrite, - contentLength, contentMD5Converted, this.client.getVersion(), leaseId, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), structuredBodyType, - structuredContentLength, optionalbody, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase uploadRangeWithResponse(String shareName, String fileName, - String range, ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, - String leaseId, FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, - Long structuredContentLength, BinaryData optionalbody, Context context) { - try { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, - fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, - fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - structuredBodyType, structuredContentLength, optionalbody, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadRange(String shareName, String fileName, String range, ShareFileRangeWriteType fileRangeWrite, - long contentLength, Integer timeout, byte[] contentMD5, String leaseId, FileLastWrittenMode fileLastWrittenMode, - String structuredBodyType, Long structuredContentLength, BinaryData optionalbody) { - uploadRangeWithResponse(shareName, fileName, range, fileRangeWrite, contentLength, timeout, contentMD5, leaseId, - fileLastWrittenMode, structuredBodyType, structuredContentLength, optionalbody, Context.NONE); - } - - /** - * Upload a range of bytes to a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. - * For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the - * value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' - * headers, and the byte range must be specified in the following format: bytes=startByte-endByte. - * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request - * body into the specified range. The Range and Content-Length headers must match to perform the update. - Clear: - * Clears the specified range and releases the space used in storage for that range. To clear a range, set the - * Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to - * maximum file size. - * @param contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 contentMD5 An MD5 hash of the content. This hash is used to verify the integrity of the data during - * transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has - * arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error - * code 400 (Bad Request). - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param structuredBodyType Required if the request body is a structured message. Specifies the message schema - * version and properties. - * @param structuredContentLength Required if the request body is a structured message. Specifies the length of the - * blob/file content inside the message body. Will always be smaller than Content-Length. - * @param optionalbody Initial data. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadRangeNoCustomHeadersWithResponse(String shareName, String fileName, String range, - ShareFileRangeWriteType fileRangeWrite, long contentLength, Integer timeout, byte[] contentMD5, String leaseId, - FileLastWrittenMode fileLastWrittenMode, String structuredBodyType, Long structuredContentLength, - BinaryData optionalbody, Context context) { - try { - final String comp = "range"; - final String accept = "application/xml"; - String contentMD5Converted = Base64Util.encodeToString(contentMD5); - return service.uploadRangeNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - range, fileRangeWrite, contentLength, contentMD5Converted, this.client.getVersion(), leaseId, - fileLastWrittenMode, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - structuredBodyType, structuredContentLength, optionalbody, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> setMetadataWithResponseAsync(String shareName, - String fileName, Integer timeout, Map metadata, String leaseId) { - return FluxUtil - .withContext( - context -> setMetadataWithResponseAsync(shareName, fileName, timeout, metadata, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataWithResponseAsync(String shareName, - String fileName, Integer timeout, Map metadata, String leaseId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadata(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, this.client.getVersion(), - leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, String fileName, Integer timeout, Map metadata, - String leaseId) { - return setMetadataWithResponseAsync(shareName, fileName, timeout, metadata, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, String fileName, Integer timeout, Map metadata, - String leaseId, Context context) { - return setMetadataWithResponseAsync(shareName, fileName, timeout, metadata, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Map metadata, String leaseId) { - return FluxUtil - .withContext(context -> setMetadataNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, metadata, - leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Map metadata, String leaseId, Context context) { - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String shareName, String fileName, - Integer timeout, Map metadata, String leaseId, Context context) { - try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, fileName, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String shareName, String fileName, Integer timeout, Map metadata, - String leaseId) { - setMetadataWithResponse(shareName, fileName, timeout, metadata, leaseId, Context.NONE); - } - - /** - * Updates user-defined metadata for the specified file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - Map metadata, String leaseId, Context context) { - try { - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - metadata, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> acquireLeaseWithResponseAsync(String shareName, - String fileName, Integer timeout, Integer duration, String proposedLeaseId, String requestId) { - return FluxUtil - .withContext(context -> acquireLeaseWithResponseAsync(shareName, fileName, timeout, duration, - proposedLeaseId, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseWithResponseAsync(String shareName, - String fileName, Integer timeout, Integer duration, String proposedLeaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - return service - .acquireLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, proposedLeaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String shareName, String fileName, Integer timeout, Integer duration, - String proposedLeaseId, String requestId) { - return acquireLeaseWithResponseAsync(shareName, fileName, timeout, duration, proposedLeaseId, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String shareName, String fileName, Integer timeout, Integer duration, - String proposedLeaseId, String requestId, Context context) { - return acquireLeaseWithResponseAsync(shareName, fileName, timeout, duration, proposedLeaseId, requestId, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Integer duration, String proposedLeaseId, String requestId) { - return FluxUtil - .withContext(context -> acquireLeaseNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, duration, - proposedLeaseId, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, Integer duration, String proposedLeaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - return service - .acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase acquireLeaseWithResponse(String shareName, String fileName, - Integer timeout, Integer duration, String proposedLeaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - return service.acquireLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, duration, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void acquireLease(String shareName, String fileName, Integer timeout, Integer duration, - String proposedLeaseId, String requestId) { - acquireLeaseWithResponse(shareName, fileName, timeout, duration, proposedLeaseId, requestId, Context.NONE); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response acquireLeaseNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - Integer duration, String proposedLeaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "acquire"; - final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, - timeout, duration, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> releaseLeaseWithResponseAsync(String shareName, - String fileName, String leaseId, Integer timeout, String requestId) { - return FluxUtil - .withContext( - context -> releaseLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String shareName, - String fileName, String leaseId, Integer timeout, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - return service - .releaseLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, - String requestId) { - return releaseLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, - String requestId, Context context) { - return releaseLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String leaseId, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> releaseLeaseNoCustomHeadersWithResponseAsync(shareName, fileName, leaseId, timeout, - requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String leaseId, Integer timeout, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - return service - .releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase releaseLeaseWithResponse(String shareName, String fileName, - String leaseId, Integer timeout, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - return service.releaseLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void releaseLease(String shareName, String fileName, String leaseId, Integer timeout, String requestId) { - releaseLeaseWithResponse(shareName, fileName, leaseId, timeout, requestId, Context.NONE); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response releaseLeaseNoCustomHeadersWithResponse(String shareName, String fileName, String leaseId, - Integer timeout, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "release"; - final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, - timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> changeLeaseWithResponseAsync(String shareName, - String fileName, String leaseId, Integer timeout, String proposedLeaseId, String requestId) { - return FluxUtil - .withContext(context -> changeLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, proposedLeaseId, - requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseWithResponseAsync(String shareName, - String fileName, String leaseId, Integer timeout, String proposedLeaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - return service - .changeLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, proposedLeaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, - String proposedLeaseId, String requestId) { - return changeLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, proposedLeaseId, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String shareName, String fileName, String leaseId, Integer timeout, - String proposedLeaseId, String requestId, Context context) { - return changeLeaseWithResponseAsync(shareName, fileName, leaseId, timeout, proposedLeaseId, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String leaseId, Integer timeout, String proposedLeaseId, String requestId) { - return FluxUtil - .withContext(context -> changeLeaseNoCustomHeadersWithResponseAsync(shareName, fileName, leaseId, timeout, - proposedLeaseId, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String leaseId, Integer timeout, String proposedLeaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - return service - .changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase changeLeaseWithResponse(String shareName, String fileName, - String leaseId, Integer timeout, String proposedLeaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - return service.changeLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void changeLease(String shareName, String fileName, String leaseId, Integer timeout, String proposedLeaseId, - String requestId) { - changeLeaseWithResponse(shareName, fileName, leaseId, timeout, proposedLeaseId, requestId, Context.NONE); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response changeLeaseNoCustomHeadersWithResponse(String shareName, String fileName, String leaseId, - Integer timeout, String proposedLeaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "change"; - final String accept = "application/xml"; - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, - timeout, leaseId, proposedLeaseId, this.client.getVersion(), requestId, - this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> breakLeaseWithResponseAsync(String shareName, - String fileName, Integer timeout, String leaseId, String requestId) { - return FluxUtil - .withContext( - context -> breakLeaseWithResponseAsync(shareName, fileName, timeout, leaseId, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String shareName, - String fileName, Integer timeout, String leaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - return service - .breakLease(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String shareName, String fileName, Integer timeout, String leaseId, - String requestId) { - return breakLeaseWithResponseAsync(shareName, fileName, timeout, leaseId, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String shareName, String fileName, Integer timeout, String leaseId, - String requestId, Context context) { - return breakLeaseWithResponseAsync(shareName, fileName, timeout, leaseId, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId, String requestId) { - return FluxUtil - .withContext(context -> breakLeaseNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, leaseId, - requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String leaseId, String requestId, Context context) { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - return service - .breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase breakLeaseWithResponse(String shareName, String fileName, - Integer timeout, String leaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - return service.breakLeaseSync(this.client.getUrl(), shareName, fileName, comp, action, timeout, leaseId, - this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void breakLease(String shareName, String fileName, Integer timeout, String leaseId, String requestId) { - breakLeaseWithResponse(shareName, fileName, timeout, leaseId, requestId, Context.NONE); - } - - /** - * [Update] The Lease File operation establishes and manages a lock on a file for write and delete operations. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response breakLeaseNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - String leaseId, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "break"; - final String accept = "application/xml"; - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, action, - timeout, leaseId, this.client.getVersion(), requestId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions 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> uploadRangeFromURLWithResponseAsync( - String shareName, String fileName, String range, String copySource, long contentLength, Integer timeout, - String sourceRange, byte[] sourceContentCrc64, String leaseId, String copySourceAuthorization, - FileLastWrittenMode fileLastWrittenMode, SourceModifiedAccessConditions sourceModifiedAccessConditions) { - return FluxUtil - .withContext(context -> uploadRangeFromURLWithResponseAsync(shareName, fileName, range, copySource, - contentLength, timeout, sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, - fileLastWrittenMode, sourceModifiedAccessConditions, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeFromURLWithResponseAsync( - String shareName, String fileName, String range, String copySource, long contentLength, Integer timeout, - String sourceRange, byte[] sourceContentCrc64, String leaseId, String copySourceAuthorization, - FileLastWrittenMode fileLastWrittenMode, SourceModifiedAccessConditions sourceModifiedAccessConditions, - Context context) { - final String comp = "range"; - final String fileRangeWriteFromUrl = "update"; - final String accept = "application/xml"; - byte[] sourceIfMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfMatchCrc64(); - } - byte[] sourceIfMatchCrc64 = sourceIfMatchCrc64Internal; - byte[] sourceIfNoneMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfNoneMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfNoneMatchCrc64(); - } - byte[] sourceIfNoneMatchCrc64 = sourceIfNoneMatchCrc64Internal; - String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); - String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); - String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service - .uploadRangeFromURL(this.client.getUrl(), shareName, fileName, comp, timeout, range, copySource, - sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeFromURLAsync(String shareName, String fileName, String range, String copySource, - long contentLength, Integer timeout, String sourceRange, byte[] sourceContentCrc64, String leaseId, - String copySourceAuthorization, FileLastWrittenMode fileLastWrittenMode, - SourceModifiedAccessConditions sourceModifiedAccessConditions) { - return uploadRangeFromURLWithResponseAsync(shareName, fileName, range, copySource, contentLength, timeout, - sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, fileLastWrittenMode, - sourceModifiedAccessConditions) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadRangeFromURLAsync(String shareName, String fileName, String range, String copySource, - long contentLength, Integer timeout, String sourceRange, byte[] sourceContentCrc64, String leaseId, - String copySourceAuthorization, FileLastWrittenMode fileLastWrittenMode, - SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { - return uploadRangeFromURLWithResponseAsync(shareName, fileName, range, copySource, contentLength, timeout, - sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, fileLastWrittenMode, - sourceModifiedAccessConditions, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeFromURLNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, String copySource, long contentLength, Integer timeout, String sourceRange, - byte[] sourceContentCrc64, String leaseId, String copySourceAuthorization, - FileLastWrittenMode fileLastWrittenMode, SourceModifiedAccessConditions sourceModifiedAccessConditions) { - return FluxUtil - .withContext(context -> uploadRangeFromURLNoCustomHeadersWithResponseAsync(shareName, fileName, range, - copySource, contentLength, timeout, sourceRange, sourceContentCrc64, leaseId, copySourceAuthorization, - fileLastWrittenMode, sourceModifiedAccessConditions, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions Parameter group. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadRangeFromURLNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String range, String copySource, long contentLength, Integer timeout, String sourceRange, - byte[] sourceContentCrc64, String leaseId, String copySourceAuthorization, - FileLastWrittenMode fileLastWrittenMode, SourceModifiedAccessConditions sourceModifiedAccessConditions, - Context context) { - final String comp = "range"; - final String fileRangeWriteFromUrl = "update"; - final String accept = "application/xml"; - byte[] sourceIfMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfMatchCrc64(); - } - byte[] sourceIfMatchCrc64 = sourceIfMatchCrc64Internal; - byte[] sourceIfNoneMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfNoneMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfNoneMatchCrc64(); - } - byte[] sourceIfNoneMatchCrc64 = sourceIfNoneMatchCrc64Internal; - String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); - String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); - String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service - .uploadRangeFromURLNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, range, - copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions Parameter group. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase uploadRangeFromURLWithResponse(String shareName, - String fileName, String range, String copySource, long contentLength, Integer timeout, String sourceRange, - byte[] sourceContentCrc64, String leaseId, String copySourceAuthorization, - FileLastWrittenMode fileLastWrittenMode, SourceModifiedAccessConditions sourceModifiedAccessConditions, - Context context) { - try { - final String comp = "range"; - final String fileRangeWriteFromUrl = "update"; - final String accept = "application/xml"; - byte[] sourceIfMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfMatchCrc64(); - } - byte[] sourceIfMatchCrc64 = sourceIfMatchCrc64Internal; - byte[] sourceIfNoneMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfNoneMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfNoneMatchCrc64(); - } - byte[] sourceIfNoneMatchCrc64 = sourceIfNoneMatchCrc64Internal; - String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); - String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); - String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURLSync(this.client.getUrl(), shareName, fileName, comp, timeout, range, - copySource, sourceRange, fileRangeWriteFromUrl, contentLength, sourceContentCrc64Converted, - sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, this.client.getVersion(), leaseId, - copySourceAuthorization, fileLastWrittenMode, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void uploadRangeFromURL(String shareName, String fileName, String range, String copySource, - long contentLength, Integer timeout, String sourceRange, byte[] sourceContentCrc64, String leaseId, - String copySourceAuthorization, FileLastWrittenMode fileLastWrittenMode, - SourceModifiedAccessConditions sourceModifiedAccessConditions) { - uploadRangeFromURLWithResponse(shareName, fileName, range, copySource, contentLength, timeout, sourceRange, - sourceContentCrc64, leaseId, copySourceAuthorization, fileLastWrittenMode, sourceModifiedAccessConditions, - Context.NONE); - } - - /** - * Upload a range of bytes to a file where the contents are read from a URL. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param range Writes data to the specified byte range in the 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 contentLength Specifies the number of bytes being transmitted in the request body. When the x-ms-write - * header is set to clear, the value of this header must be set to zero. - * @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 sourceRange Bytes of source data in the specified range. - * @param sourceContentCrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy - * source. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to - * copy source. - * @param fileLastWrittenMode If the file last write time should be preserved or overwritten. - * @param sourceModifiedAccessConditions Parameter group. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadRangeFromURLNoCustomHeadersWithResponse(String shareName, String fileName, String range, - String copySource, long contentLength, Integer timeout, String sourceRange, byte[] sourceContentCrc64, - String leaseId, String copySourceAuthorization, FileLastWrittenMode fileLastWrittenMode, - SourceModifiedAccessConditions sourceModifiedAccessConditions, Context context) { - try { - final String comp = "range"; - final String fileRangeWriteFromUrl = "update"; - final String accept = "application/xml"; - byte[] sourceIfMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfMatchCrc64(); - } - byte[] sourceIfMatchCrc64 = sourceIfMatchCrc64Internal; - byte[] sourceIfNoneMatchCrc64Internal = null; - if (sourceModifiedAccessConditions != null) { - sourceIfNoneMatchCrc64Internal = sourceModifiedAccessConditions.getSourceIfNoneMatchCrc64(); - } - byte[] sourceIfNoneMatchCrc64 = sourceIfNoneMatchCrc64Internal; - String sourceContentCrc64Converted = Base64Util.encodeToString(sourceContentCrc64); - String sourceIfMatchCrc64Converted = Base64Util.encodeToString(sourceIfMatchCrc64); - String sourceIfNoneMatchCrc64Converted = Base64Util.encodeToString(sourceIfNoneMatchCrc64); - return service.uploadRangeFromURLNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, - timeout, range, copySource, sourceRange, fileRangeWriteFromUrl, contentLength, - sourceContentCrc64Converted, sourceIfMatchCrc64Converted, sourceIfNoneMatchCrc64Converted, - this.client.getVersion(), leaseId, copySourceAuthorization, fileLastWrittenMode, - this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } 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 along with {@link ResponseBase} 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, String marker, Integer maxresults) { - return FluxUtil - .withContext(context -> getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, - timeout, range, leaseId, supportRename, marker, maxresults, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * 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 ResponseBase} 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, 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, marker, maxresults, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRangeListAsync(String shareName, String fileName, String sharesnapshot, - String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, - Integer maxresults) { - return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename, marker, maxresults) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getRangeListAsync(String shareName, String fileName, String sharesnapshot, - String prevsharesnapshot, Integer timeout, String range, String leaseId, Boolean supportRename, String marker, - Integer maxresults, Context context) { - return getRangeListWithResponseAsync(shareName, fileName, sharesnapshot, prevsharesnapshot, timeout, range, - leaseId, supportRename, marker, maxresults, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 Response} 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, String marker, Integer maxresults) { - return FluxUtil - .withContext(context -> getRangeListNoCustomHeadersWithResponseAsync(shareName, fileName, sharesnapshot, - prevsharesnapshot, timeout, range, leaseId, supportRename, marker, maxresults, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * 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 Response} 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, 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, marker, maxresults, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * 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 ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getRangeListWithResponse(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.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); - } 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ShareFileRangeList getRangeList(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, marker, maxresults, Context.NONE).getValue(); - } 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 Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getRangeListNoCustomHeadersWithResponse(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, marker, maxresults, - accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * 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. - * @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 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 {@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, Context context) { - final String accept = "application/xml"; - PermissionCopyModeType filePermissionCopyModeInternal = null; - if (copyFileSmbInfo != null) { - filePermissionCopyModeInternal = copyFileSmbInfo.getFilePermissionCopyMode(); - } - PermissionCopyModeType filePermissionCopyMode = filePermissionCopyModeInternal; - Boolean ignoreReadOnlyInternal = null; - if (copyFileSmbInfo != null) { - ignoreReadOnlyInternal = copyFileSmbInfo.isIgnoreReadOnly(); - } - Boolean ignoreReadOnly = ignoreReadOnlyInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - Boolean setArchiveAttributeInternal = null; - if (copyFileSmbInfo != null) { - setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); - } - Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service - .startCopy(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), metadata, - copySource, filePermission, filePermissionFormat, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, accept, - 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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyAsync(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 startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, leaseId, owner, group, fileMode, fileModeCopyMode, - fileOwnerCopyMode, copyFileSmbInfo) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * 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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono startCopyAsync(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, - Context context) { - return startCopyWithResponseAsync(shareName, fileName, copySource, timeout, metadata, filePermission, - filePermissionFormat, filePermissionKey, leaseId, owner, group, fileMode, fileModeCopyMode, - fileOwnerCopyMode, copyFileSmbInfo, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyNoCustomHeadersWithResponseAsync(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 -> startCopyNoCustomHeadersWithResponseAsync(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. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startCopyNoCustomHeadersWithResponseAsync(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, Context context) { - final String accept = "application/xml"; - PermissionCopyModeType filePermissionCopyModeInternal = null; - if (copyFileSmbInfo != null) { - filePermissionCopyModeInternal = copyFileSmbInfo.getFilePermissionCopyMode(); - } - PermissionCopyModeType filePermissionCopyMode = filePermissionCopyModeInternal; - Boolean ignoreReadOnlyInternal = null; - if (copyFileSmbInfo != null) { - ignoreReadOnlyInternal = copyFileSmbInfo.isIgnoreReadOnly(); - } - Boolean ignoreReadOnly = ignoreReadOnlyInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - Boolean setArchiveAttributeInternal = null; - if (copyFileSmbInfo != null) { - setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); - } - Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service - .startCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), - metadata, copySource, filePermission, filePermissionFormat, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, accept, - 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. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase startCopyWithResponse(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, Context context) { - try { - final String accept = "application/xml"; - PermissionCopyModeType filePermissionCopyModeInternal = null; - if (copyFileSmbInfo != null) { - filePermissionCopyModeInternal = copyFileSmbInfo.getFilePermissionCopyMode(); - } - PermissionCopyModeType filePermissionCopyMode = filePermissionCopyModeInternal; - Boolean ignoreReadOnlyInternal = null; - if (copyFileSmbInfo != null) { - ignoreReadOnlyInternal = copyFileSmbInfo.isIgnoreReadOnly(); - } - Boolean ignoreReadOnly = ignoreReadOnlyInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - Boolean setArchiveAttributeInternal = null; - if (copyFileSmbInfo != null) { - setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); - } - Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopySync(this.client.getUrl(), shareName, fileName, timeout, this.client.getVersion(), - metadata, copySource, filePermission, filePermissionFormat, filePermissionKey, filePermissionCopyMode, - ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, - setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void startCopy(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) { - startCopyWithResponse(shareName, fileName, copySource, timeout, metadata, filePermission, filePermissionFormat, - filePermissionKey, leaseId, owner, group, fileMode, fileModeCopyMode, fileOwnerCopyMode, copyFileSmbInfo, - Context.NONE); - } - - /** - * 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. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startCopyNoCustomHeadersWithResponse(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, - Context context) { - try { - final String accept = "application/xml"; - PermissionCopyModeType filePermissionCopyModeInternal = null; - if (copyFileSmbInfo != null) { - filePermissionCopyModeInternal = copyFileSmbInfo.getFilePermissionCopyMode(); - } - PermissionCopyModeType filePermissionCopyMode = filePermissionCopyModeInternal; - Boolean ignoreReadOnlyInternal = null; - if (copyFileSmbInfo != null) { - ignoreReadOnlyInternal = copyFileSmbInfo.isIgnoreReadOnly(); - } - Boolean ignoreReadOnly = ignoreReadOnlyInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - Boolean setArchiveAttributeInternal = null; - if (copyFileSmbInfo != null) { - setArchiveAttributeInternal = copyFileSmbInfo.isSetArchiveAttribute(); - } - Boolean setArchiveAttribute = setArchiveAttributeInternal; - return service.startCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, timeout, - this.client.getVersion(), metadata, copySource, filePermission, filePermissionFormat, filePermissionKey, - filePermissionCopyMode, ignoreReadOnly, fileAttributes, fileCreationTime, fileLastWriteTime, - fileChangeTime, setArchiveAttribute, leaseId, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), owner, group, fileMode, - fileModeCopyMode, fileOwnerCopyMode, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> abortCopyWithResponseAsync(String shareName, String fileName, - String copyId, Integer timeout, String leaseId) { - return FluxUtil - .withContext(context -> abortCopyWithResponseAsync(shareName, fileName, copyId, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> abortCopyWithResponseAsync(String shareName, String fileName, - String copyId, Integer timeout, String leaseId, Context context) { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - return service - .abortCopy(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, copyActionAbortConstant, - this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), - accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono abortCopyAsync(String shareName, String fileName, String copyId, Integer timeout, - String leaseId) { - return abortCopyWithResponseAsync(shareName, fileName, copyId, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono abortCopyAsync(String shareName, String fileName, String copyId, Integer timeout, String leaseId, - Context context) { - return abortCopyWithResponseAsync(shareName, fileName, copyId, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> abortCopyNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String copyId, Integer timeout, String leaseId) { - return FluxUtil - .withContext(context -> abortCopyNoCustomHeadersWithResponseAsync(shareName, fileName, copyId, timeout, - leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createHardLinkSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-type") String fileType, @HeaderParam("x-ms-file-target-file") String targetFile, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); } /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. + * Creates a new file or replaces a file. Note it only initializes the file with no content. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/octet-stream".
x-ms-content-typeStringNoSets the MIME content type of the file. The default + * type is 'application/octet-stream'.
x-ms-content-encodingStringNoSpecifies which content encodings have been + * applied to the file.
x-ms-content-languageStringNoSpecifies the natural languages used by this + * resource.
x-ms-cache-controlStringNoSets the file's cache control. The File service + * stores this value but does not use or modify it.
x-ms-content-md5byte[]NoAn MD5 hash of the file content. This hash is used to + * verify the integrity of the file during transport.
x-ms-content-dispositionStringNoSets the file's Content-Disposition + * header.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-file-typeStringNoOptional, NFS only. Type of the file or directory. + * Allowed values: "Regular", "Directory", "SymLink".
Content-MD5byte[]NoAn MD5 hash of the content. This hash is used to verify the + * integrity of the data during transport.
x-ms-file-property-semanticsStringNoSMB only. Default value is New. Allowed + * values: "New", "Restore".
Content-LengthLongNoSpecifies the number of bytes being transmitted in the + * request body. When the x-ms-write header is set to clear, the value of this header must be set to + * zero."
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
x-ms-structured-content-lengthLongNoRequired if the request body is a + * structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller + * than Content-Length.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
* - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> abortCopyNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String copyId, Integer timeout, String leaseId, Context context) { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - return service - .abortCopyNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase abortCopyWithResponse(String shareName, String fileName, - String copyId, Integer timeout, String leaseId, Context context) { - try { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - return service.abortCopySync(this.client.getUrl(), shareName, fileName, comp, copyId, timeout, - copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void abortCopy(String shareName, String fileName, String copyId, Integer timeout, String leaseId) { - abortCopyWithResponse(shareName, fileName, copyId, timeout, leaseId, Context.NONE); - } - - /** - * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. + public Mono> createWithResponseAsync(long fileContentLength, RequestOptions requestOptions) { + final String fileType = "file"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/octet-stream"); + } + }); + return FluxUtil + .withContext(context -> service.create(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + fileContentLength, fileType, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + requestOptionsLocal, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Creates a new file or replaces a file. Note it only initializes the file with no content. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/octet-stream".
x-ms-content-typeStringNoSets the MIME content type of the file. The default + * type is 'application/octet-stream'.
x-ms-content-encodingStringNoSpecifies which content encodings have been + * applied to the file.
x-ms-content-languageStringNoSpecifies the natural languages used by this + * resource.
x-ms-cache-controlStringNoSets the file's cache control. The File service + * stores this value but does not use or modify it.
x-ms-content-md5byte[]NoAn MD5 hash of the file content. This hash is used to + * verify the integrity of the file during transport.
x-ms-content-dispositionStringNoSets the file's Content-Disposition + * header.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-file-typeStringNoOptional, NFS only. Type of the file or directory. + * Allowed values: "Regular", "Directory", "SymLink".
Content-MD5byte[]NoAn MD5 hash of the content. This hash is used to verify the + * integrity of the data during transport.
x-ms-file-property-semanticsStringNoSMB only. Default value is New. Allowed + * values: "New", "Restore".
Content-LengthLongNoSpecifies the number of bytes being transmitted in the + * request body. When the x-ms-write header is set to clear, the value of this header must be set to + * zero."
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
x-ms-structured-content-lengthLongNoRequired if the request body is a + * structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller + * than Content-Length.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
* - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * @param fileContentLength Specifies the maximum size for the file, up to 4 TB. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response abortCopyNoCustomHeadersWithResponse(String shareName, String fileName, String copyId, - Integer timeout, String leaseId, Context context) { + public Response createWithResponse(long fileContentLength, RequestOptions requestOptions) { try { - final String comp = "copy"; - final String copyActionAbortConstant = "abort"; - final String accept = "application/xml"; - return service.abortCopyNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, copyId, - timeout, copyActionAbortConstant, this.client.getVersion(), leaseId, this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + final String fileType = "file"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/octet-stream"); + } + }); + return service.createSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + fileContentLength, fileType, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + requestOptionsLocal, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesWithResponseAsync( - String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { - return FluxUtil - .withContext(context -> listHandlesWithResponseAsync(shareName, fileName, marker, maxresults, timeout, - sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesWithResponseAsync( - String shareName, String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, - Context context) { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service - .listHandles(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, sharesnapshot, - this.client.getVersion(), this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHandlesAsync(String shareName, String fileName, String marker, - Integer maxresults, Integer timeout, String sharesnapshot) { - return listHandlesWithResponseAsync(shareName, fileName, marker, maxresults, timeout, sharesnapshot) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listHandlesAsync(String shareName, String fileName, String marker, - Integer maxresults, Integer timeout, String sharesnapshot, Context context) { - return listHandlesWithResponseAsync(shareName, fileName, marker, maxresults, timeout, sharesnapshot, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesNoCustomHeadersWithResponseAsync(String shareName, - String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot) { + * Reads or downloads a file from the system, including its metadata and properties. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-range-get-content-md5BooleanNoWhen this header is set to true and + * specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is + * less than or equal to 4 MB in size.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/octet-stream"; return FluxUtil - .withContext(context -> listHandlesNoCustomHeadersWithResponseAsync(shareName, fileName, marker, maxresults, - timeout, sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHandlesNoCustomHeadersWithResponseAsync(String shareName, - String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service - .listHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, - sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) + .withContext(context -> service.download(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link ResponseBase}. + * Reads or downloads a file from the system, including its metadata and properties. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-range-get-content-md5BooleanNoWhen this header is set to true and + * specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is + * less than or equal to 4 MB in size.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase listHandlesWithResponse(String shareName, - String fileName, String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { + public Response downloadWithResponse(RequestOptions requestOptions) { try { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service.listHandlesSync(this.client.getUrl(), shareName, fileName, comp, marker, maxresults, timeout, - sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + final String accept = "application/octet-stream"; + return service.downloadSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles. + * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ListHandlesResponse listHandles(String shareName, String fileName, String marker, Integer maxresults, - Integer timeout, String sharesnapshot) { - try { - return listHandlesWithResponse(shareName, fileName, marker, maxresults, timeout, sharesnapshot, - Context.NONE).getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Lists handles for file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 an enumeration of handles along with {@link Response}. + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.getProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listHandlesNoCustomHeadersWithResponse(String shareName, String fileName, - String marker, Integer maxresults, Integer timeout, String sharesnapshot, Context context) { + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String comp = "listhandles"; - final String accept = "application/xml"; - return service.listHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, marker, - maxresults, timeout, sharesnapshot, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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> forceCloseHandlesWithResponseAsync(String shareName, - String fileName, String handleId, Integer timeout, String marker, String sharesnapshot) { - return FluxUtil - .withContext(context -> forceCloseHandlesWithResponseAsync(shareName, fileName, handleId, timeout, marker, - sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesWithResponseAsync(String shareName, - String fileName, String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service - .forceCloseHandles(this.client.getUrl(), shareName, fileName, comp, timeout, marker, sharesnapshot, - handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono forceCloseHandlesAsync(String shareName, String fileName, String handleId, Integer timeout, - String marker, String sharesnapshot) { - return forceCloseHandlesWithResponseAsync(shareName, fileName, handleId, timeout, marker, sharesnapshot) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono forceCloseHandlesAsync(String shareName, String fileName, String handleId, Integer timeout, - String marker, String sharesnapshot, Context context) { - return forceCloseHandlesWithResponseAsync(shareName, fileName, handleId, timeout, marker, sharesnapshot, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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. + * Removes the file from the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String handleId, Integer timeout, String marker, String sharesnapshot) { + public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> forceCloseHandlesNoCustomHeadersWithResponseAsync(shareName, fileName, handleId, - timeout, marker, sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> forceCloseHandlesNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service - .forceCloseHandlesNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, marker, - sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link ResponseBase}. + .withContext(context -> service.delete(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Removes the file from the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase forceCloseHandlesWithResponse(String shareName, - String fileName, String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { + public Response deleteWithResponse(RequestOptions requestOptions) { try { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service.forceCloseHandlesSync(this.client.getUrl(), shareName, fileName, comp, timeout, marker, - sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service.deleteSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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. + * Sets HTTP headers on a file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-content-lengthLongNoSpecifies the number of bytes being + * transmitted.
x-ms-content-typeStringNoSets the MIME content type of the file. The default + * type is 'application/octet-stream'.
x-ms-content-encodingStringNoSpecifies which content encodings have been + * applied to the file.
x-ms-content-languageStringNoSpecifies the natural languages used by this + * resource.
x-ms-cache-controlStringNoSets the file's cache control. The File service + * stores this value but does not use or modify it.
x-ms-content-md5byte[]NoAn MD5 hash of the file content. This hash is used to + * verify the integrity of the file during transport.
x-ms-content-dispositionStringNoSets the file's Content-Disposition + * header.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void forceCloseHandles(String shareName, String fileName, String handleId, Integer timeout, String marker, - String sharesnapshot) { - forceCloseHandlesWithResponse(shareName, fileName, handleId, timeout, marker, sharesnapshot, Context.NONE); - } - - /** - * Closes all handles open for given file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk (‘*’) is a wildcard - * that specifies all handles. - * @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 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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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. + public Mono> setHttpHeadersWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.setHttpHeaders(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Sets HTTP headers on a file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-content-lengthLongNoSpecifies the number of bytes being + * transmitted.
x-ms-content-typeStringNoSets the MIME content type of the file. The default + * type is 'application/octet-stream'.
x-ms-content-encodingStringNoSpecifies which content encodings have been + * applied to the file.
x-ms-content-languageStringNoSpecifies the natural languages used by this + * resource.
x-ms-cache-controlStringNoSets the file's cache control. The File service + * stores this value but does not use or modify it.
x-ms-content-md5byte[]NoAn MD5 hash of the file content. This hash is used to + * verify the integrity of the file during transport.
x-ms-content-dispositionStringNoSets the file's Content-Disposition + * header.
x-ms-file-permissionStringNoIf 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.
x-ms-file-permission-keyStringNoKey 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.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set. Default value: 'Archive' for file and 'Directory' for directory. 'None' can also be specified as + * default.
x-ms-file-creation-timeStringNoCreation time for the file/directory. Default + * value: Now.
x-ms-file-last-write-timeStringNoLast write time for the file/directory. + * Default value: Now.
x-ms-file-change-timeStringNoChange time for the file/directory. Default + * value: Now.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response forceCloseHandlesNoCustomHeadersWithResponse(String shareName, String fileName, - String handleId, Integer timeout, String marker, String sharesnapshot, Context context) { + public Response setHttpHeadersWithResponse(RequestOptions requestOptions) { try { - final String comp = "forceclosehandles"; - final String accept = "application/xml"; - return service.forceCloseHandlesNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, - timeout, marker, sharesnapshot, handleId, this.client.getVersion(), this.client.isAllowTrailingDot(), - this.client.getFileRequestIntent(), accept, context); + return service.setHttpHeadersSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders 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> renameWithResponseAsync(String shareName, String fileName, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil.withContext(context -> renameWithResponseAsync(shareName, fileName, renameSource, timeout, - replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, - sourceLeaseAccessConditions, destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders, - context)).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameWithResponseAsync(String shareName, String fileName, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - return service - .rename(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), renameSource, - replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, fileCreationTime, - fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, filePermissionKey, metadata, - contentType, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renameAsync(String shareName, String fileName, String renameSource, Integer timeout, - Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders) { - return renameWithResponseAsync(shareName, fileName, renameSource, timeout, replaceIfExists, ignoreReadOnly, - filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders Parameter group. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renameAsync(String shareName, String fileName, String renameSource, Integer timeout, - Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - return renameWithResponseAsync(shareName, fileName, renameSource, timeout, replaceIfExists, ignoreReadOnly, - filePermission, filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders) { - return FluxUtil.withContext(context -> renameNoCustomHeadersWithResponseAsync(shareName, fileName, renameSource, - timeout, replaceIfExists, ignoreReadOnly, filePermission, filePermissionFormat, filePermissionKey, metadata, - sourceLeaseAccessConditions, destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders, - context)).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders Parameter group. - * @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. + * Sets one or more user-defined name-value pairs for the specified file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renameNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - return service - .renameNoCustomHeaders(this.client.getUrl(), shareName, fileName, comp, timeout, this.client.getVersion(), - renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, destinationLeaseId, fileAttributes, - fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, filePermissionFormat, - filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders Parameter group. - * @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 {@link ResponseBase}. + public Mono> setMetadataWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.setMetadata(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Sets one or more user-defined name-value pairs for the specified file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renameWithResponse(String shareName, String fileName, - String renameSource, Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { + public Response setMetadataWithResponse(RequestOptions requestOptions) { try { - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - return service.renameSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + return service.setMetadataSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void rename(String shareName, String fileName, String renameSource, Integer timeout, Boolean replaceIfExists, - Boolean ignoreReadOnly, String filePermission, FilePermissionFormat filePermissionFormat, - String filePermissionKey, Map metadata, SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders) { - renameWithResponse(shareName, fileName, renameSource, timeout, replaceIfExists, ignoreReadOnly, filePermission, - filePermissionFormat, filePermissionKey, metadata, sourceLeaseAccessConditions, - destinationLeaseAccessConditions, copyFileSmbInfo, shareFileHttpHeaders, Context.NONE); + } } /** - * Renames a file. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. - * @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 replaceIfExists Optional. A boolean value for if the destination file already exists, whether this request - * will overwrite the file or not. If true, the rename will succeed and will overwrite the destination file. If not - * provided or if false and the destination file does exist, the request will not overwrite the destination file. If - * provided and the destination file doesn’t exist, the rename will succeed. Note: This value does not override the - * x-ms-file-copy-ignore-read-only header value. - * @param ignoreReadOnly Optional. A boolean value that specifies whether the ReadOnly attribute on a preexisting - * destination file should be respected. If true, the rename will succeed, otherwise, a previous file at the - * destination with the ReadOnly attribute set will cause the rename to fail. - * @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 metadata A name-value pair to associate with a file storage object. - * @param sourceLeaseAccessConditions Parameter group. - * @param destinationLeaseAccessConditions Parameter group. - * @param copyFileSmbInfo Parameter group. - * @param shareFileHttpHeaders Parameter group. - * @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. + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-durationIntegerNoSpecifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A + * lease duration cannot be changed using renew or change.
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> acquireLeaseWithResponseAsync(RequestOptions requestOptions) { + final String action = "acquire"; + return FluxUtil + .withContext(context -> service.acquireLease(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), action, this.client.getFileRequestIntent(), + this.client.isAllowTrailingDot(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-durationIntegerNoSpecifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A + * lease duration cannot be changed using renew or change.
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response renameNoCustomHeadersWithResponse(String shareName, String fileName, String renameSource, - Integer timeout, Boolean replaceIfExists, Boolean ignoreReadOnly, String filePermission, - FilePermissionFormat filePermissionFormat, String filePermissionKey, Map metadata, - SourceLeaseAccessConditions sourceLeaseAccessConditions, - DestinationLeaseAccessConditions destinationLeaseAccessConditions, CopyFileSmbInfo copyFileSmbInfo, - ShareFileHttpHeaders shareFileHttpHeaders, Context context) { + public Response acquireLeaseWithResponse(RequestOptions requestOptions) { try { - final String comp = "rename"; - final String accept = "application/xml"; - String sourceLeaseIdInternal = null; - if (sourceLeaseAccessConditions != null) { - sourceLeaseIdInternal = sourceLeaseAccessConditions.getSourceLeaseId(); - } - String sourceLeaseId = sourceLeaseIdInternal; - String destinationLeaseIdInternal = null; - if (destinationLeaseAccessConditions != null) { - destinationLeaseIdInternal = destinationLeaseAccessConditions.getDestinationLeaseId(); - } - String destinationLeaseId = destinationLeaseIdInternal; - String fileAttributesInternal = null; - if (copyFileSmbInfo != null) { - fileAttributesInternal = copyFileSmbInfo.getFileAttributes(); - } - String fileAttributes = fileAttributesInternal; - String fileCreationTimeInternal = null; - if (copyFileSmbInfo != null) { - fileCreationTimeInternal = copyFileSmbInfo.getFileCreationTime(); - } - String fileCreationTime = fileCreationTimeInternal; - String fileLastWriteTimeInternal = null; - if (copyFileSmbInfo != null) { - fileLastWriteTimeInternal = copyFileSmbInfo.getFileLastWriteTime(); - } - String fileLastWriteTime = fileLastWriteTimeInternal; - String fileChangeTimeInternal = null; - if (copyFileSmbInfo != null) { - fileChangeTimeInternal = copyFileSmbInfo.getFileChangeTime(); - } - String fileChangeTime = fileChangeTimeInternal; - String contentTypeInternal = null; - if (shareFileHttpHeaders != null) { - contentTypeInternal = shareFileHttpHeaders.getContentType(); - } - String contentType = contentTypeInternal; - return service.renameNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, comp, timeout, - this.client.getVersion(), renameSource, replaceIfExists, ignoreReadOnly, sourceLeaseId, - destinationLeaseId, fileAttributes, fileCreationTime, fileLastWriteTime, fileChangeTime, filePermission, - filePermissionFormat, filePermissionKey, metadata, contentType, this.client.isAllowTrailingDot(), - this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), accept, context); + final String action = "acquire"; + return service.acquireLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), action, + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Creates a symbolic link. + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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. - * @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}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSymbolicLinkWithResponseAsync( - String shareName, String fileName, String linkText, Integer timeout, Map metadata, - String fileCreationTime, String fileLastWriteTime, String requestId, String leaseId, String owner, - String group) { + public Mono> releaseLeaseWithResponseAsync(String leaseId, RequestOptions requestOptions) { + final String action = "release"; return FluxUtil - .withContext(context -> createSymbolicLinkWithResponseAsync(shareName, fileName, linkText, timeout, - metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, owner, group, context)) + .withContext(context -> service.releaseLease(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), leaseId, action, this.client.getFileRequestIntent(), + this.client.isAllowTrailingDot(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a symbolic link. + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 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 {@link ResponseBase} on successful completion of {@link Mono}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSymbolicLinkWithResponseAsync( - String shareName, String fileName, String linkText, Integer timeout, Map metadata, - String fileCreationTime, String fileLastWriteTime, String requestId, String leaseId, String owner, String group, - Context context) { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service - .createSymbolicLink(this.client.getUrl(), shareName, fileName, restype, timeout, this.client.getVersion(), - metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, owner, group, linkText, - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response releaseLeaseWithResponse(String leaseId, RequestOptions requestOptions) { + try { + final String action = "release"; + return service.releaseLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), leaseId, + action, this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, + Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a symbolic link. + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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. - * @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 A {@link Mono} that completes when a successful response is received. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSymbolicLinkAsync(String shareName, String fileName, String linkText, Integer timeout, - Map metadata, String fileCreationTime, String fileLastWriteTime, String requestId, - String leaseId, String owner, String group) { - return createSymbolicLinkWithResponseAsync(shareName, fileName, linkText, timeout, metadata, fileCreationTime, - fileLastWriteTime, requestId, leaseId, owner, group) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a symbolic link. + public Mono> changeLeaseWithResponseAsync(String leaseId, RequestOptions requestOptions) { + final String action = "change"; + return FluxUtil + .withContext(context -> service.changeLease(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), leaseId, action, this.client.getFileRequestIntent(), + this.client.isAllowTrailingDot(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 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 A {@link Mono} that completes when a successful response is received. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSymbolicLinkAsync(String shareName, String fileName, String linkText, Integer timeout, - Map metadata, String fileCreationTime, String fileLastWriteTime, String requestId, - String leaseId, String owner, String group, Context context) { - return createSymbolicLinkWithResponseAsync(shareName, fileName, linkText, timeout, metadata, fileCreationTime, - fileLastWriteTime, requestId, leaseId, owner, group, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + public Response changeLeaseWithResponse(String leaseId, RequestOptions requestOptions) { + try { + final String action = "change"; + return service.changeLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), leaseId, + action, this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, + Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a symbolic link. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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. - * @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. + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSymbolicLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String linkText, Integer timeout, Map metadata, String fileCreationTime, - String fileLastWriteTime, String requestId, String leaseId, String owner, String group) { + public Mono> breakLeaseWithResponseAsync(RequestOptions requestOptions) { + final String action = "break"; return FluxUtil - .withContext(context -> createSymbolicLinkNoCustomHeadersWithResponseAsync(shareName, fileName, linkText, - timeout, metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, owner, group, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + .withContext(context -> service.breakLease(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), action, this.client.getFileRequestIntent(), + this.client.isAllowTrailingDot(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease File operation establishes and manages a lock on a file for write and delete operations. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response breakLeaseWithResponse(RequestOptions requestOptions) { + try { + final String action = "break"; + return service.breakLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), action, + this.client.getFileRequestIntent(), this.client.isAllowTrailingDot(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a symbolic link. + * Upload a range of bytes to a file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/octet-stream".
Content-MD5byte[]NoAn MD5 hash of the content. This hash is used to verify the + * integrity of the data during transport.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-last-write-timeStringNoIf the file last write time should be + * preserved or overwritten. Allowed values: "Now", "Preserve".
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
x-ms-structured-content-lengthLongNoRequired if the request body is a + * structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller + * than Content-Length.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
* - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 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. + * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. + * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request + * body into the specified range. - Clear: Clears the specified range and releases the space used in storage for + * that range. Allowed values: "update", "clear". + * @param contentLength The number of bytes being transmitted in the request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSymbolicLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String linkText, Integer timeout, Map metadata, String fileCreationTime, - String fileLastWriteTime, String requestId, String leaseId, String owner, String group, Context context) { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service - .createSymbolicLinkNoCustomHeaders(this.client.getUrl(), shareName, fileName, restype, timeout, - this.client.getVersion(), metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, owner, - group, linkText, this.client.getFileRequestIntent(), accept, context) + public Mono> uploadRangeWithResponseAsync(String range, String fileRangeWrite, long contentLength, + RequestOptions requestOptions) { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/octet-stream"); + } + }); + return FluxUtil + .withContext(context -> service.uploadRange(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), range, fileRangeWrite, contentLength, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptionsLocal, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a symbolic link. + * Upload a range of bytes to a file. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/octet-stream".
Content-MD5byte[]NoAn MD5 hash of the content. This hash is used to verify the + * integrity of the data during transport.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-last-write-timeStringNoIf the file last write time should be + * preserved or overwritten. Allowed values: "Now", "Preserve".
x-ms-structured-bodyStringNoSpecifies the response content should be returned + * as a structured message and specifies the message schema version and properties.
x-ms-structured-content-lengthLongNoRequired if the request body is a + * structured message. Specifies the length of the blob/file content inside the message body. Will always be smaller + * than Content-Length.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
* - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 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 {@link ResponseBase}. + * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. + * @param fileRangeWrite Specify one of the following options: - Update: Writes the bytes specified by the request + * body into the specified range. - Clear: Clears the specified range and releases the space used in storage for + * that range. Allowed values: "update", "clear". + * @param contentLength The number of bytes being transmitted in the request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createSymbolicLinkWithResponse(String shareName, - String fileName, String linkText, Integer timeout, Map metadata, String fileCreationTime, - String fileLastWriteTime, String requestId, String leaseId, String owner, String group, Context context) { + public Response uploadRangeWithResponse(String range, String fileRangeWrite, long contentLength, + RequestOptions requestOptions) { try { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service.createSymbolicLinkSync(this.client.getUrl(), shareName, fileName, restype, timeout, - this.client.getVersion(), metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, owner, - group, linkText, this.client.getFileRequestIntent(), accept, context); + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/octet-stream"); + } + }); + return service.uploadRangeSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), range, + fileRangeWrite, contentLength, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + requestOptionsLocal, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Creates a symbolic link. + * Upload a range of bytes to a file where the contents are read from a URL. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-source-rangeStringNoBytes of source data in the specified + * range.
x-ms-source-content-crc64byte[]NoSpecify the CRC64 hash of the source + * content.
x-ms-source-if-match-crc64byte[]NoSpecify the CRC64 hash value to check for + * source content integrity.
x-ms-source-if-none-match-crc64byte[]NoSpecify the CRC64 hash value to check + * for source content mismatch.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-copy-source-authorizationStringNoOnly Bearer type is supported. + * Credentials should be a valid OAuth access token to copy source.
x-ms-file-last-write-timeStringNoIf the file last write time should be + * preserved or overwritten. Allowed values: "Now", "Preserve".
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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. - * @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. + * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. + * @param fileRangeWriteFromUrl Only update is supported. Allowed values: "update". + * @param contentLength The number of bytes being transmitted in the request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void createSymbolicLink(String shareName, String fileName, String linkText, Integer timeout, - Map metadata, String fileCreationTime, String fileLastWriteTime, String requestId, - String leaseId, String owner, String group) { - createSymbolicLinkWithResponse(shareName, fileName, linkText, timeout, metadata, fileCreationTime, - fileLastWriteTime, requestId, leaseId, owner, group, Context.NONE); + public Mono> uploadRangeFromUrlWithResponseAsync(String range, String copySource, + String fileRangeWriteFromUrl, long contentLength, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.uploadRangeFromUrl(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), range, copySource, fileRangeWriteFromUrl, contentLength, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a symbolic link. + * Upload a range of bytes to a file where the contents are read from a URL. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-source-rangeStringNoBytes of source data in the specified + * range.
x-ms-source-content-crc64byte[]NoSpecify the CRC64 hash of the source + * content.
x-ms-source-if-match-crc64byte[]NoSpecify the CRC64 hash value to check for + * source content integrity.
x-ms-source-if-none-match-crc64byte[]NoSpecify the CRC64 hash value to check + * for source content mismatch.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-copy-source-authorizationStringNoOnly Bearer type is supported. + * Credentials should be a valid OAuth access token to copy source.
x-ms-file-last-write-timeStringNoIf the file last write time should be + * preserved or overwritten. Allowed values: "Now", "Preserve".
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param linkText NFS only. Required. The path to the original file, the symbolic link is pointing to. The path is - * of type string which is not resolved and is stored as is. The path can be absolute path or the relative path - * depending on the content stored in the symbolic link file. - * @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 fileCreationTime Creation time for the file/directory. Default value: Now. - * @param fileLastWriteTime Last write time for the file/directory. Default value: Now. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 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. + * @param range Specifies the range of bytes to be written. Both the start and end of the range must be specified. + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. + * @param fileRangeWriteFromUrl Only update is supported. Allowed values: "update". + * @param contentLength The number of bytes being transmitted in the request body. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSymbolicLinkNoCustomHeadersWithResponse(String shareName, String fileName, - String linkText, Integer timeout, Map metadata, String fileCreationTime, - String fileLastWriteTime, String requestId, String leaseId, String owner, String group, Context context) { + public Response uploadRangeFromUrlWithResponse(String range, String copySource, String fileRangeWriteFromUrl, + long contentLength, RequestOptions requestOptions) { try { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service.createSymbolicLinkNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, restype, - timeout, this.client.getVersion(), metadata, fileCreationTime, fileLastWriteTime, requestId, leaseId, - owner, group, linkText, this.client.getFileRequestIntent(), accept, context); + return service.uploadRangeFromUrlSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + range, copySource, fileRangeWriteFromUrl, contentLength, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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}. + * Returns the list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Range (Optional): [
+     *          (Optional){
+     *             Start: long (Required)
+     *             End: long (Required)
+     *         }
+     *     ]
+     *     ClearRange (Optional): [
+     *          (Optional){
+     *             Start: long (Required)
+     *             End: long (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of file ranges along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSymbolicLinkWithResponseAsync(String shareName, - String fileName, Integer timeout, String sharesnapshot, String requestId) { + public Mono> getRangeListWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; return FluxUtil - .withContext(context -> getSymbolicLinkWithResponseAsync(shareName, fileName, timeout, sharesnapshot, - requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. + .withContext(context -> service.getRangeList(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Returns the list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Range (Optional): [
+     *          (Optional){
+     *             Start: long (Required)
+     *             End: long (Required)
+     *         }
+     *     ]
+     *     ClearRange (Optional): [
+     *          (Optional){
+     *             Start: long (Required)
+     *             End: long (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of file ranges along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSymbolicLinkWithResponseAsync(String shareName, - String fileName, Integer timeout, String sharesnapshot, String requestId, Context context) { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service - .getSymbolicLink(this.client.getUrl(), shareName, fileName, restype, timeout, sharesnapshot, - this.client.getVersion(), requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response getRangeListWithResponse(RequestOptions requestOptions) { + try { + final String accept = "application/xml"; + return service.getRangeListSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions, + Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSymbolicLinkAsync(String shareName, String fileName, Integer timeout, String sharesnapshot, - String requestId) { - return getSymbolicLinkWithResponseAsync(shareName, fileName, timeout, sharesnapshot, requestId) + * Returns a paginated list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: long (Required)
+     *     End: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated list of file ranges along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllRangesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.listAllRanges(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.models.FileRange.fromXml(reader, "Range"), XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Range", "Range"), null, null)); + } + + /** + * Returns a paginated list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: long (Required)
+     *     End: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated list of file ranges as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAllRangesAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listAllRangesSinglePageAsync(requestOptions)); + } + + /** + * Returns a paginated list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: long (Required)
+     *     End: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated list of file ranges along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAllRangesSinglePage(RequestOptions requestOptions) { + try { + final String accept = "application/xml"; + Response res = service.listAllRangesSync(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.models.FileRange.fromXml(reader, "Range"), XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Range", "Range"), null, null); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSymbolicLinkAsync(String shareName, String fileName, Integer timeout, String sharesnapshot, - String requestId, Context context) { - return getSymbolicLinkWithResponseAsync(shareName, fileName, timeout, sharesnapshot, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + * Returns a paginated list of valid page ranges for a file or snapshot of a file. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
prevsharesnapshotStringNoThe previous snapshot parameter is an opaque DateTime + * value that specifies a previous file snapshot to compare against.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
RangeStringNoReturn file data only from the specified byte range.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-file-support-renameBooleanNoThis header is allowed only when + * PrevShareSnapshot query parameter is set. Determines whether the changed ranges for a file that has been renamed + * or moved should be listed.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: long (Required)
+     *     End: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the paginated list of file ranges as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAllRanges(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listAllRangesSinglePage(requestOptions)); } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. + * Copies a blob or file to a destination file within the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * file.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-file-permission-copy-modeStringNoSpecifies the option to copy file + * security descriptor from source file or to set it using the value which is defined by the header value of + * x-ms-file-permission or x-ms-file-permission-key. Allowed values: "source", "override".
x-ms-file-copy-ignore-readonlyBooleanNoA boolean value that specifies whether + * the ReadOnly attribute on a preexisting destination file should be respected or overridden.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-file-change-timeStringNoChange time for the file.
x-ms-file-copy-set-archiveBooleanNoOptional. Sets the archive attribute on the + * destination file.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-mode-copy-modeStringNoSpecifies mode copy option for the file. + * Allowed values: "source", "override".
x-ms-file-owner-copy-modeStringNoSpecifies owner copy option for the file. + * Allowed values: "source", "override".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSymbolicLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String sharesnapshot, String requestId) { + public Mono> startCopyWithResponseAsync(String copySource, RequestOptions requestOptions) { return FluxUtil - .withContext(context -> getSymbolicLinkNoCustomHeadersWithResponseAsync(shareName, fileName, timeout, - sharesnapshot, requestId, context)) + .withContext(context -> service.startCopy(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), copySource, this.client.isAllowTrailingDot(), + this.client.isAllowSourceTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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. + * Copies a blob or file to a destination file within the storage account. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * file.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-file-permission-copy-modeStringNoSpecifies the option to copy file + * security descriptor from source file or to set it using the value which is defined by the header value of + * x-ms-file-permission or x-ms-file-permission-key. Allowed values: "source", "override".
x-ms-file-copy-ignore-readonlyBooleanNoA boolean value that specifies whether + * the ReadOnly attribute on a preexisting destination file should be respected or overridden.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-file-change-timeStringNoChange time for the file.
x-ms-file-copy-set-archiveBooleanNoOptional. Sets the archive attribute on the + * destination file.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
x-ms-modeStringNoOptional, NFS only. The file mode of the file or + * directory.
x-ms-file-mode-copy-modeStringNoSpecifies mode copy option for the file. + * Allowed values: "source", "override".
x-ms-file-owner-copy-modeStringNoSpecifies owner copy option for the file. + * Allowed values: "source", "override".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param copySource Specifies the URL of the source file or blob, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startCopyWithResponse(String copySource, RequestOptions requestOptions) { + try { + return service.startCopySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), copySource, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + /** + * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param copyid The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSymbolicLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - Integer timeout, String sharesnapshot, String requestId, Context context) { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service - .getSymbolicLinkNoCustomHeaders(this.client.getUrl(), shareName, fileName, restype, timeout, sharesnapshot, - this.client.getVersion(), requestId, this.client.getFileRequestIntent(), accept, context) + public Mono> abortCopyWithResponseAsync(String copyid, RequestOptions requestOptions) { + final String copyActionAbortConstant = "abort"; + return FluxUtil + .withContext(context -> service.abortCopy(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), copyActionAbortConstant, copyid, + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. + * Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param copyid The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getSymbolicLinkWithResponse(String shareName, - String fileName, Integer timeout, String sharesnapshot, String requestId, Context context) { + public Response abortCopyWithResponse(String copyid, RequestOptions requestOptions) { try { - final String restype = "symboliclink"; - final String accept = "application/xml"; - return service.getSymbolicLinkSync(this.client.getUrl(), shareName, fileName, restype, timeout, - sharesnapshot, this.client.getVersion(), requestId, this.client.getFileRequestIntent(), accept, - context); + final String copyActionAbortConstant = "abort"; + return service.abortCopySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + copyActionAbortConstant, copyid, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), + requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getSymbolicLink(String shareName, String fileName, Integer timeout, String sharesnapshot, - String requestId) { - getSymbolicLinkWithResponse(shareName, fileName, timeout, sharesnapshot, requestId, Context.NONE); + * Lists handles for file. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHandlesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.listHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.implementation.models.HandleItem.fromXml(reader, "Handle"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Entries", "Handle"), null, null)); } /** - * The getSymbolicLink operation. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSymbolicLinkNoCustomHeadersWithResponse(String shareName, String fileName, Integer timeout, - String sharesnapshot, String requestId, Context context) { + * Lists handles for file. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listHandlesAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listHandlesSinglePageAsync(requestOptions)); + } + + /** + * Lists handles for file. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listHandlesSinglePage(RequestOptions requestOptions) { try { - final String restype = "symboliclink"; final String accept = "application/xml"; - return service.getSymbolicLinkNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, restype, - timeout, sharesnapshot, this.client.getVersion(), requestId, this.client.getFileRequestIntent(), accept, - context); + Response res = service.listHandlesSync(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData.fromObject( + com.azure.storage.file.share.implementation.models.HandleItem.fromXml(reader, "Handle"), + XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Entries", "Handle"), null, null); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Creates a hard link. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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}. + * Lists handles for file. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HandleId: String (Required)
+     *     Path (Required): {
+     *         Encoded: Boolean (Optional)
+     *         content: String (Optional)
+     *     }
+     *     FileId: String (Required)
+     *     ParentId: String (Optional)
+     *     SessionId: String (Required)
+     *     ClientIp: String (Required)
+     *     ClientName: String (Required)
+     *     OpenTime: DateTimeRfc1123 (Required)
+     *     LastReconnectTime: DateTimeRfc1123 (Optional)
+     *     AccessRightList (Optional): [
+     *         String(Read/Write/Delete) (Optional)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return an enumeration of handles as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listHandles(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listHandlesSinglePage(requestOptions)); + } + + /** + * Closes all handles open for given file. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk ('*') is a wildcard + * that specifies all handles. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createHardLinkWithResponseAsync(String shareName, - String fileName, String targetFile, Integer timeout, String requestId, String leaseId) { + public Mono> forceCloseHandlesWithResponseAsync(String handleId, RequestOptions requestOptions) { return FluxUtil - .withContext(context -> createHardLinkWithResponseAsync(shareName, fileName, targetFile, timeout, requestId, - leaseId, context)) + .withContext(context -> service.forceCloseHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), handleId, this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a hard link. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. + * Closes all handles open for given file. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param handleId Specifies handle ID opened on the file or directory to be closed. Asterisk ('*') is a wildcard + * that specifies all handles. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createHardLinkWithResponseAsync(String shareName, - String fileName, String targetFile, Integer timeout, String requestId, String leaseId, Context context) { - final String restype = "hardlink"; - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - return service - .createHardLink(this.client.getUrl(), shareName, fileName, restype, timeout, this.client.getVersion(), - fileTypeConstant, requestId, leaseId, targetFile, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response forceCloseHandlesWithResponse(String handleId, RequestOptions requestOptions) { + try { + return service.forceCloseHandlesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + handleId, this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), requestOptions, + Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a hard link. + * Renames a file. By default, the destination is overwritten and if the destination already exists and has a + * read-only attribute set, the operation will fail. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-rename-replace-if-existsBooleanNoBoolean. Default value is false. + * Set to true to indicate that the destination should be overwritten.
x-ms-file-rename-ignore-readonlyBooleanNoBoolean. Default value is false. Set + * to true to overwrite the destination even if it has the read-only attribute set.
x-ms-source-lease-idStringNoRequired if the source file has an active + * lease.
x-ms-destination-lease-idStringNoRequired if the destination has an active + * lease.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-file-change-timeStringNoChange time for the file.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * file.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-content-typeStringNoSets the MIME content type of the file.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. + * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createHardLinkAsync(String shareName, String fileName, String targetFile, Integer timeout, - String requestId, String leaseId) { - return createHardLinkWithResponseAsync(shareName, fileName, targetFile, timeout, requestId, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a hard link. + public Mono> renameWithResponseAsync(String renameSource, RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.rename(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + renameSource, this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Renames a file. By default, the destination is overwritten and if the destination already exists and has a + * read-only attribute set, the operation will fail. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-rename-replace-if-existsBooleanNoBoolean. Default value is false. + * Set to true to indicate that the destination should be overwritten.
x-ms-file-rename-ignore-readonlyBooleanNoBoolean. Default value is false. Set + * to true to overwrite the destination even if it has the read-only attribute set.
x-ms-source-lease-idStringNoRequired if the source file has an active + * lease.
x-ms-destination-lease-idStringNoRequired if the destination has an active + * lease.
x-ms-file-attributesStringNoIf specified, the provided file attributes shall + * be set.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-file-change-timeStringNoChange time for the file.
x-ms-file-permissionStringNoIf specified the permission shall be set for the + * file.
x-ms-file-permission-formatStringNoOptional. Used to set permission format. + * Allowed values: "Sddl", "Binary".
x-ms-file-permission-keyStringNoKey of the permission to be set.
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-content-typeStringNoSets the MIME content type of the file.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. + * @param renameSource Required. Specifies the URI-style path of the source file, up to 2 KB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createHardLinkAsync(String shareName, String fileName, String targetFile, Integer timeout, - String requestId, String leaseId, Context context) { - return createHardLinkWithResponseAsync(shareName, fileName, targetFile, timeout, requestId, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + public Response renameWithResponse(String renameSource, RequestOptions requestOptions) { + try { + return service.renameSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), renameSource, + this.client.isAllowTrailingDot(), this.client.isAllowSourceTrailingDot(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a hard link. - * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * Creates a symbolic link to a target file. NFS only. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param linkText NFS only. The path to the original file, the symbolic link is pointing to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createHardLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String targetFile, Integer timeout, String requestId, String leaseId) { + public Mono> createSymbolicLinkWithResponseAsync(String linkText, RequestOptions requestOptions) { return FluxUtil - .withContext(context -> createHardLinkNoCustomHeadersWithResponseAsync(shareName, fileName, targetFile, - timeout, requestId, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + .withContext(context -> service.createSymbolicLink(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), linkText, this.client.getFileRequestIntent(), + requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Creates a symbolic link to a target file. NFS only. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-file-creation-timeStringNoCreation time for the file.
x-ms-file-last-write-timeStringNoLast write time for the file.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-ownerStringNoOptional, NFS only. The owner of the file or + * directory.
x-ms-groupStringNoOptional, NFS only. The owning group of the file or + * directory.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param linkText NFS only. The path to the original file, the symbolic link is pointing to. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createSymbolicLinkWithResponse(String linkText, RequestOptions requestOptions) { + try { + return service.createSymbolicLinkSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + linkText, this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Creates a hard link. + * Returns the target of a symbolic link. NFS only. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createHardLinkNoCustomHeadersWithResponseAsync(String shareName, String fileName, - String targetFile, Integer timeout, String requestId, String leaseId, Context context) { - final String restype = "hardlink"; - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - return service - .createHardLinkNoCustomHeaders(this.client.getUrl(), shareName, fileName, restype, timeout, - this.client.getVersion(), fileTypeConstant, requestId, leaseId, targetFile, - this.client.getFileRequestIntent(), accept, context) + public Mono> getSymbolicLinkWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.getSymbolicLink(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a hard link. + * Returns the target of a symbolic link. NFS only. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. - * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createHardLinkWithResponse(String shareName, String fileName, - String targetFile, Integer timeout, String requestId, String leaseId, Context context) { + public Response getSymbolicLinkWithResponse(RequestOptions requestOptions) { try { - final String restype = "hardlink"; - final String fileTypeConstant = "file"; - final String accept = "application/xml"; - return service.createHardLinkSync(this.client.getUrl(), shareName, fileName, restype, timeout, - this.client.getVersion(), fileTypeConstant, requestId, leaseId, targetFile, - this.client.getFileRequestIntent(), accept, context); + return service.getSymbolicLinkSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Creates a hard link. + * Creates a hard link to a target file. NFS only. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * to 2 KiB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void createHardLink(String shareName, String fileName, String targetFile, Integer timeout, String requestId, - String leaseId) { - createHardLinkWithResponse(shareName, fileName, targetFile, timeout, requestId, leaseId, Context.NONE); + public Mono> createHardLinkWithResponseAsync(String targetFile, RequestOptions requestOptions) { + final String fileType = "file"; + return FluxUtil + .withContext( + context -> service.createHardLink(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + fileType, targetFile, this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Creates a hard link. + * Creates a hard link to a target file. NFS only. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @param fileName The path of the target file. * @param targetFile NFS only. Required. Specifies the path of the target file to which the link will be created, up - * to 2 KiB in length. It should be full path of the target from the root.The target file must be in the same share - * and hence the same storage account. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * to 2 KiB in length. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createHardLinkNoCustomHeadersWithResponse(String shareName, String fileName, - String targetFile, Integer timeout, String requestId, String leaseId, Context context) { + public Response createHardLinkWithResponse(String targetFile, RequestOptions requestOptions) { + try { + final String fileType = "file"; + return service.createHardLinkSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + fileType, targetFile, this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private List getValues(BinaryData binaryData, String... path) { + try { + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + List values = (List) value; + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private String getNextLink(BinaryData binaryData, String... path) { + try { + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + return (String) value; + } catch (RuntimeException e) { + return null; + } + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private static final com.azure.core.util.serializer.ObjectSerializer XML_SERIALIZER + = XmlSerializerProviders.createInstance(); + + private List getXmlValues(BinaryData binaryData, + java.util.function.Function valueReader, String... path) { + try { + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlValues(reader, valueReader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private List getXmlValues(com.azure.xml.XmlReader reader, + java.util.function.Function valueReader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { + try { + List values = new java.util.ArrayList<>(); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + values.add(valueReader.apply(reader)); + } else { + values.addAll(getXmlValues(reader, valueReader, path, pathIndex + 1)); + } + } + return values; + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private String getXmlNextLink(BinaryData binaryData, String... path) { + try { + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlNextLink(reader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + private String getXmlNextLink(com.azure.xml.XmlReader reader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { + try { + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + return reader.getStringElement(); + } else { + return getXmlNextLink(reader, path, pathIndex + 1); + } + } + return null; + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + + public Response listHandlesWithResponse(RequestOptions requestOptions) { try { - final String restype = "hardlink"; - final String fileTypeConstant = "file"; final String accept = "application/xml"; - return service.createHardLinkNoCustomHeadersSync(this.client.getUrl(), shareName, fileName, restype, - timeout, this.client.getVersion(), fileTypeConstant, requestId, leaseId, targetFile, - this.client.getFileRequestIntent(), accept, context); + return service.listHandlesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } + + public Mono> listHandlesWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext(context -> service.listHandles(this.client.getUrl(), + this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java index f84362b77754..a1ec20e360a8 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation; import com.azure.core.annotation.BodyParam; @@ -9,39 +9,32 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; 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.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.file.share.implementation.models.KeyInfo; -import com.azure.storage.file.share.implementation.models.ListSharesIncludeType; -import com.azure.storage.file.share.implementation.models.ListSharesResponse; -import com.azure.storage.file.share.implementation.models.ServicesGetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.ServicesGetUserDelegationKeyHeaders; -import com.azure.storage.file.share.implementation.models.ServicesListSharesSegmentHeaders; -import com.azure.storage.file.share.implementation.models.ServicesListSharesSegmentNextHeaders; -import com.azure.storage.file.share.implementation.models.ServicesSetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.ShareItemInternal; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; import com.azure.storage.file.share.implementation.util.ModelHelper; -import com.azure.storage.file.share.models.ShareServiceProperties; import com.azure.storage.file.share.models.ShareTokenIntent; -import com.azure.storage.file.share.models.UserDelegationKey; import java.util.List; -import java.util.Objects; +import java.util.Map; import java.util.stream.Collectors; import reactor.core.publisher.Mono; @@ -70,6 +63,19 @@ public final class ServicesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ShareServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + /** * The interface defining all the services for AzureFileStorageServices to be used by the proxy service to perform * REST calls. @@ -78,401 +84,238 @@ public final class ServicesImpl { @ServiceInterface(name = "AzureFileStorageServices") public interface ServicesService { - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setProperties(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareServiceProperties shareServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareServiceProperties shareServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Put("/") + @Put("/?restype=service&comp=properties") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setPropertiesSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareServiceProperties shareServiceProperties, - @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/xml") BinaryData storageServiceProperties, RequestOptions requestOptions, + Context context); - @Put("/") + @Put("/?restype=service&comp=properties") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareServiceProperties shareServiceProperties, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getProperties( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getPropertiesSync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listSharesSegment( - @HostParam("url") String url, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/xml") BinaryData storageServiceProperties, RequestOptions requestOptions, + Context context); - @Get("/") + @Get("/?restype=service&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listSharesSegmentNoCustomHeaders(@HostParam("url") String url, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProperties(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/") + @Get("/?restype=service&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase listSharesSegmentSync( - @HostParam("url") String url, @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, - @QueryParam("marker") String marker, @QueryParam("maxresults") Integer maxresults, - @QueryParam("include") String include, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPropertiesSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/") + @Get("/?comp=list") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response listSharesSegmentNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("comp") String comp, @QueryParam("prefix") String prefix, @QueryParam("marker") String marker, - @QueryParam("maxresults") Integer maxresults, @QueryParam("include") String include, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listSharesSegment(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getUserDelegationKey( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getUserDelegationKeyNoCustomHeaders(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Post("/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getUserDelegationKeySync( - @HostParam("url") String url, @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/") + @Get("/?comp=list") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getUserDelegationKeyNoCustomHeadersSync(@HostParam("url") String url, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @BodyParam("application/xml") KeyInfo keyInfo, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listSharesSegmentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listSharesSegmentSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Post("/?restype=service&comp=userdelegationkey") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> listSharesSegmentNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getUserDelegationKey(@HostParam("url") String url, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, @BodyParam("application/xml") BinaryData keyInfo, + RequestOptions requestOptions, Context context); + + @Post("/?restype=service&comp=userdelegationkey") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase listSharesSegmentNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response listSharesSegmentNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("url") String url, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getUserDelegationKeySync(@HostParam("url") String url, + @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("Accept") String accept, @BodyParam("application/xml") BinaryData keyInfo, + RequestOptions requestOptions, Context context); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     HourMetrics (Optional): {
+     *         Version: String (Required)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     ProtocolSettings (Optional): {
+     *         SMB (Optional): {
+     *             Multichannel (Optional): {
+     *                 Enabled: Boolean (Optional)
+     *             }
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *         NFS (Optional): {
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
* - * @param shareServiceProperties The StorageService properties. - * @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>. - * @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> - setPropertiesWithResponseAsync(ShareServiceProperties shareServiceProperties, Integer timeout) { - return FluxUtil.withContext(context -> setPropertiesWithResponseAsync(shareServiceProperties, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesWithResponseAsync( - ShareServiceProperties shareServiceProperties, Integer timeout, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), shareServiceProperties, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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>. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperties, Integer timeout) { - return setPropertiesWithResponseAsync(shareServiceProperties, timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(ShareServiceProperties shareServiceProperties, Integer timeout, - Context context) { - return setPropertiesWithResponseAsync(shareServiceProperties, timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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>. - * @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. + * @param storageServiceProperties Storage service properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - setPropertiesNoCustomHeadersWithResponseAsync(ShareServiceProperties shareServiceProperties, Integer timeout) { + public Mono> setPropertiesWithResponseAsync(BinaryData storageServiceProperties, + RequestOptions requestOptions) { + final String contentType = "application/xml"; return FluxUtil .withContext( - context -> setPropertiesNoCustomHeadersWithResponseAsync(shareServiceProperties, timeout, context)) + context -> service.setProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, this.client.getFileRequestIntent(), storageServiceProperties, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     HourMetrics (Optional): {
+     *         Version: String (Required)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     ProtocolSettings (Optional): {
+     *         SMB (Optional): {
+     *             Multichannel (Optional): {
+     *                 Enabled: Boolean (Optional)
+     *             }
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *         NFS (Optional): {
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
* - * @param shareServiceProperties The StorageService properties. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync( - ShareServiceProperties shareServiceProperties, Integer timeout, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), shareServiceProperties, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - setPropertiesWithResponse(ShareServiceProperties shareServiceProperties, Integer timeout, Context context) { - try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), shareServiceProperties, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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>. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setProperties(ShareServiceProperties shareServiceProperties, Integer timeout) { - setPropertiesWithResponse(shareServiceProperties, timeout, Context.NONE); - } - - /** - * Sets properties for a storage account's File service endpoint, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - * - * @param shareServiceProperties The StorageService properties. - * @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 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. + * @param storageServiceProperties Storage service properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setPropertiesNoCustomHeadersWithResponse(ShareServiceProperties shareServiceProperties, - Integer timeout, Context context) { + public Response setPropertiesWithResponse(BinaryData storageServiceProperties, + RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), shareServiceProperties, accept, context); + final String contentType = "application/xml"; + return service.setPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, this.client.getFileRequestIntent(), storageServiceProperties, requestOptions, + Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -481,211 +324,142 @@ public Response setPropertiesNoCustomHeadersWithResponse(ShareServicePrope /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HourMetrics (Optional): {
+     *         Version: String (Required)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     ProtocolSettings (Optional): {
+     *         SMB (Optional): {
+     *             Multichannel (Optional): {
+     *                 Enabled: Boolean (Optional)
+     *             }
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *         NFS (Optional): {
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
* - * @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>. - * @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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getPropertiesWithResponseAsync(Integer timeout) { - return FluxUtil.withContext(context -> getPropertiesWithResponseAsync(timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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 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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules along with {@link ResponseBase} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getPropertiesWithResponseAsync(Integer timeout, Context context) { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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>. - * @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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(Integer timeout) { - return getPropertiesWithResponseAsync(timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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 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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(Integer timeout, Context context) { - return getPropertiesWithResponseAsync(timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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>. - * @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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the properties of a storage account's File service, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(Integer timeout) { - return FluxUtil.withContext(context -> getPropertiesNoCustomHeadersWithResponseAsync(timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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 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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(Integer timeout, - Context context) { - final String restype = "service"; - final String comp = "properties"; + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) + return FluxUtil + .withContext( + context -> service.getProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and * CORS (Cross-Origin Resource Sharing) rules. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     HourMetrics (Optional): {
+     *         Version: String (Required)
+     *         Enabled: boolean (Required)
+     *         IncludeAPIs: Boolean (Optional)
+     *         RetentionPolicy (Optional): {
+     *             Enabled: boolean (Required)
+     *             Days: Integer (Optional)
+     *         }
+     *     }
+     *     MinuteMetrics (Optional): (recursive schema, see MinuteMetrics above)
+     *     ProtocolSettings (Optional): {
+     *         SMB (Optional): {
+     *             Multichannel (Optional): {
+     *                 Enabled: Boolean (Optional)
+     *             }
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *         NFS (Optional): {
+     *             EncryptionInTransit (Optional): {
+     *                 Required: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     Cors (Optional): [
+     *          (Optional){
+     *             AllowedOrigins: String (Required)
+     *             AllowedMethods: String (Required)
+     *             AllowedHeaders: String (Required)
+     *             ExposedHeaders: String (Required)
+     *             MaxAgeInSeconds: int (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
* - * @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 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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(Integer timeout, - Context context) { - try { - final String restype = "service"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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>. - * @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 properties of a storage account's File service, including properties for Storage Analytics metrics - * and CORS (Cross-Origin Resource Sharing) rules. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ShareServiceProperties getProperties(Integer timeout) { - try { - return getPropertiesWithResponse(timeout, Context.NONE).getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Gets the properties of a storage account's File service, including properties for Storage Analytics metrics and - * CORS (Cross-Origin Resource Sharing) rules. - * - * @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 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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the properties of a storage account's File service, including properties for Storage Analytics metrics * and CORS (Cross-Origin Resource Sharing) rules along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(Integer timeout, Context context) { + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "properties"; final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -693,340 +467,250 @@ public Response getPropertiesNoCustomHeadersWithResponse /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Snapshot: String (Optional)
+     *     Deleted: Boolean (Optional)
+     *     Version: String (Optional)
+     *     Properties (Required): {
+     *         Last-Modified: DateTimeRfc1123 (Required)
+     *         Etag: String (Required)
+     *         Quota: int (Required)
+     *         ProvisionedIops: Integer (Optional)
+     *         ProvisionedIngressMBps: Integer (Optional)
+     *         ProvisionedEgressMBps: Integer (Optional)
+     *         ProvisionedBandwidthMiBps: Integer (Optional)
+     *         NextAllowedQuotaDowngradeTime: DateTimeRfc1123 (Optional)
+     *         DeletedTime: DateTimeRfc1123 (Optional)
+     *         RemainingRetentionDays: Integer (Optional)
+     *         AccessTier: String (Optional)
+     *         AccessTierChangeTime: DateTimeRfc1123 (Optional)
+     *         AccessTierTransitionState: String (Optional)
+     *         LeaseStatus: String(locked/unlocked) (Optional)
+     *         LeaseState: String(available/leased/expired/breaking/broken) (Optional)
+     *         LeaseDuration: String(infinite/fixed) (Optional)
+     *         EnabledProtocols: String (Optional)
+     *         RootSquash: String(NoRootSquash/RootSquash/AllSquash) (Optional)
+     *         EnableSnapshotVirtualDirectoryAccess: Boolean (Optional)
+     *         PaidBurstingEnabled: Boolean (Optional)
+     *         PaidBurstingMaxIops: Long (Optional)
+     *         PaidBurstingMaxBandwidthMibps: Long (Optional)
+     *         IncludedBurstIops: Long (Optional)
+     *         MaxBurstCreditsForIops: Long (Optional)
+     *         NextAllowedProvisionedIopsDowngradeTime: DateTimeRfc1123 (Optional)
+     *         NextAllowedProvisionedBandwidthDowngradeTime: DateTimeRfc1123 (Optional)
+     *         EnableSmbDirectoryLease: Boolean (Optional)
+     *     }
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
* - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout) { - final String comp = "list"; + private Mono> listSharesSegmentSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); return FluxUtil - .withContext(context -> service.listSharesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, - includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentSinglePageAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listSharesSegment(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSharesSegmentAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout) { - return new PagedFlux<>(() -> listSharesSegmentSinglePageAsync(prefix, marker, maxresults, include, timeout), - nextLink -> listSharesSegmentNextSinglePageAsync(nextLink)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSharesSegmentAsync(String prefix, String marker, Integer maxresults, - List include, Integer timeout, Context context) { - return new PagedFlux<>( - () -> listSharesSegmentSinglePageAsync(prefix, marker, maxresults, include, timeout, context), - nextLink -> listSharesSegmentNextSinglePageAsync(nextLink, context)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNoCustomHeadersSinglePageAsync(String prefix, - String marker, Integer maxresults, List include, Integer timeout) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.listSharesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, - maxresults, includeConverted, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), - accept, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNoCustomHeadersSinglePageAsync(String prefix, - String marker, Integer maxresults, List include, Integer timeout, Context context) { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .listSharesSegmentNoCustomHeaders(this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) + .withContext( + context -> service.listSharesSegment(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSharesSegmentNoCustomHeadersAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout) { - return new PagedFlux<>( - () -> listSharesSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, include, timeout), - nextLink -> listSharesSegmentNextSinglePageAsync(nextLink)); + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData + .fromObject(com.azure.storage.file.share.implementation.models.ShareItemInternal + .fromXml(reader, "Share"), XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Shares", "Share"), null, null)); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Snapshot: String (Optional)
+     *     Deleted: Boolean (Optional)
+     *     Version: String (Optional)
+     *     Properties (Required): {
+     *         Last-Modified: DateTimeRfc1123 (Required)
+     *         Etag: String (Required)
+     *         Quota: int (Required)
+     *         ProvisionedIops: Integer (Optional)
+     *         ProvisionedIngressMBps: Integer (Optional)
+     *         ProvisionedEgressMBps: Integer (Optional)
+     *         ProvisionedBandwidthMiBps: Integer (Optional)
+     *         NextAllowedQuotaDowngradeTime: DateTimeRfc1123 (Optional)
+     *         DeletedTime: DateTimeRfc1123 (Optional)
+     *         RemainingRetentionDays: Integer (Optional)
+     *         AccessTier: String (Optional)
+     *         AccessTierChangeTime: DateTimeRfc1123 (Optional)
+     *         AccessTierTransitionState: String (Optional)
+     *         LeaseStatus: String(locked/unlocked) (Optional)
+     *         LeaseState: String(available/leased/expired/breaking/broken) (Optional)
+     *         LeaseDuration: String(infinite/fixed) (Optional)
+     *         EnabledProtocols: String (Optional)
+     *         RootSquash: String(NoRootSquash/RootSquash/AllSquash) (Optional)
+     *         EnableSnapshotVirtualDirectoryAccess: Boolean (Optional)
+     *         PaidBurstingEnabled: Boolean (Optional)
+     *         PaidBurstingMaxIops: Long (Optional)
+     *         PaidBurstingMaxBandwidthMibps: Long (Optional)
+     *         IncludedBurstIops: Long (Optional)
+     *         MaxBurstCreditsForIops: Long (Optional)
+     *         NextAllowedProvisionedIopsDowngradeTime: DateTimeRfc1123 (Optional)
+     *         NextAllowedProvisionedBandwidthDowngradeTime: DateTimeRfc1123 (Optional)
+     *         EnableSmbDirectoryLease: Boolean (Optional)
+     *     }
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
* - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return an enumeration of shares as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSharesSegmentNoCustomHeadersAsync(String prefix, String marker, - Integer maxresults, List include, Integer timeout, Context context) { - return new PagedFlux<>(() -> listSharesSegmentNoCustomHeadersSinglePageAsync(prefix, marker, maxresults, - include, timeout, context), nextLink -> listSharesSegmentNextSinglePageAsync(nextLink, context)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout) { - try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.listSharesSegmentSync( - this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } + public PagedFlux listSharesSegmentAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listSharesSegmentSinglePageAsync(requestOptions)); } /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Snapshot: String (Optional)
+     *     Deleted: Boolean (Optional)
+     *     Version: String (Optional)
+     *     Properties (Required): {
+     *         Last-Modified: DateTimeRfc1123 (Required)
+     *         Etag: String (Required)
+     *         Quota: int (Required)
+     *         ProvisionedIops: Integer (Optional)
+     *         ProvisionedIngressMBps: Integer (Optional)
+     *         ProvisionedEgressMBps: Integer (Optional)
+     *         ProvisionedBandwidthMiBps: Integer (Optional)
+     *         NextAllowedQuotaDowngradeTime: DateTimeRfc1123 (Optional)
+     *         DeletedTime: DateTimeRfc1123 (Optional)
+     *         RemainingRetentionDays: Integer (Optional)
+     *         AccessTier: String (Optional)
+     *         AccessTierChangeTime: DateTimeRfc1123 (Optional)
+     *         AccessTierTransitionState: String (Optional)
+     *         LeaseStatus: String(locked/unlocked) (Optional)
+     *         LeaseState: String(available/leased/expired/breaking/broken) (Optional)
+     *         LeaseDuration: String(infinite/fixed) (Optional)
+     *         EnabledProtocols: String (Optional)
+     *         RootSquash: String(NoRootSquash/RootSquash/AllSquash) (Optional)
+     *         EnableSnapshotVirtualDirectoryAccess: Boolean (Optional)
+     *         PaidBurstingEnabled: Boolean (Optional)
+     *         PaidBurstingMaxIops: Long (Optional)
+     *         PaidBurstingMaxBandwidthMibps: Long (Optional)
+     *         IncludedBurstIops: Long (Optional)
+     *         MaxBurstCreditsForIops: Long (Optional)
+     *         NextAllowedProvisionedIopsDowngradeTime: DateTimeRfc1123 (Optional)
+     *         NextAllowedProvisionedBandwidthDowngradeTime: DateTimeRfc1123 (Optional)
+     *         EnableSmbDirectoryLease: Boolean (Optional)
+     *     }
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
* - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return an enumeration of shares along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout, Context context) { + private PagedResponse listSharesSegmentSinglePage(RequestOptions requestOptions) { try { - final String comp = "list"; final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.listSharesSegmentSync( - this.client.getUrl(), comp, prefix, marker, maxresults, includeConverted, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); + Response res + = service.listSharesSegmentSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + getXmlValues(res.getValue(), reader -> { + try { + return BinaryData + .fromObject(com.azure.storage.file.share.implementation.models.ShareItemInternal + .fromXml(reader, "Share"), XML_SERIALIZER); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException(e); + } + }, "Shares", "Share"), null, null); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -1034,602 +718,309 @@ public PagedResponse listSharesSegmentSinglePage(String prefi /** * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
prefixStringNoFilters the results to return only items whose name begins with + * the specified prefix.
markerStringNoA string value that identifies the portion of the list to be + * returned with the next listing operation.
maxresultsIntegerNoSpecifies the maximum number of items to return.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
includeList<String>NoInclude this parameter to specify one or more + * datasets to include in the response. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     Name: String (Required)
+     *     Snapshot: String (Optional)
+     *     Deleted: Boolean (Optional)
+     *     Version: String (Optional)
+     *     Properties (Required): {
+     *         Last-Modified: DateTimeRfc1123 (Required)
+     *         Etag: String (Required)
+     *         Quota: int (Required)
+     *         ProvisionedIops: Integer (Optional)
+     *         ProvisionedIngressMBps: Integer (Optional)
+     *         ProvisionedEgressMBps: Integer (Optional)
+     *         ProvisionedBandwidthMiBps: Integer (Optional)
+     *         NextAllowedQuotaDowngradeTime: DateTimeRfc1123 (Optional)
+     *         DeletedTime: DateTimeRfc1123 (Optional)
+     *         RemainingRetentionDays: Integer (Optional)
+     *         AccessTier: String (Optional)
+     *         AccessTierChangeTime: DateTimeRfc1123 (Optional)
+     *         AccessTierTransitionState: String (Optional)
+     *         LeaseStatus: String(locked/unlocked) (Optional)
+     *         LeaseState: String(available/leased/expired/breaking/broken) (Optional)
+     *         LeaseDuration: String(infinite/fixed) (Optional)
+     *         EnabledProtocols: String (Optional)
+     *         RootSquash: String(NoRootSquash/RootSquash/AllSquash) (Optional)
+     *         EnableSnapshotVirtualDirectoryAccess: Boolean (Optional)
+     *         PaidBurstingEnabled: Boolean (Optional)
+     *         PaidBurstingMaxIops: Long (Optional)
+     *         PaidBurstingMaxBandwidthMibps: Long (Optional)
+     *         IncludedBurstIops: Long (Optional)
+     *         MaxBurstCreditsForIops: Long (Optional)
+     *         NextAllowedProvisionedIopsDowngradeTime: DateTimeRfc1123 (Optional)
+     *         NextAllowedProvisionedBandwidthDowngradeTime: DateTimeRfc1123 (Optional)
+     *         EnableSmbDirectoryLease: Boolean (Optional)
+     *     }
+     *     Metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
* - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return an enumeration of shares as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSharesSegment(String prefix, String marker, Integer maxresults, - List include, Integer timeout) { - return new PagedIterable<>(() -> listSharesSegmentSinglePage(prefix, marker, maxresults, include, timeout), - nextLink -> listSharesSegmentNextSinglePage(nextLink)); + public PagedIterable listSharesSegment(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listSharesSegmentSinglePage(requestOptions)); } /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSharesSegment(String prefix, String marker, Integer maxresults, - List include, Integer timeout, Context context) { - return new PagedIterable<>( - () -> listSharesSegmentSinglePage(prefix, marker, maxresults, include, timeout, context), - nextLink -> listSharesSegmentNextSinglePage(nextLink, context)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNoCustomHeadersSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout) { - try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.listSharesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, - prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNoCustomHeadersSinglePage(String prefix, String marker, - Integer maxresults, List include, Integer timeout, Context context) { - try { - final String comp = "list"; - final String accept = "application/xml"; - String includeConverted = (include == null) - ? null - : include.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.listSharesSegmentNoCustomHeadersSync(this.client.getUrl(), comp, - prefix, marker, maxresults, includeConverted, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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>. - * @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 an enumeration of shares as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSharesSegmentNoCustomHeaders(String prefix, String marker, - Integer maxresults, List include, Integer timeout) { - return new PagedIterable<>( - () -> listSharesSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, include, timeout), - nextLink -> listSharesSegmentNextSinglePage(nextLink)); - } - - /** - * The List Shares Segment operation returns a list of the shares and share snapshots under the specified account. - * - * @param prefix Filters the results to return only entries whose name begins with the specified prefix. - * @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 include Include this parameter to specify one or more datasets to include in the response. - * @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 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 an enumeration of shares as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSharesSegmentNoCustomHeaders(String prefix, String marker, - Integer maxresults, List include, Integer timeout, Context context) { - return new PagedIterable<>( - () -> listSharesSegmentNoCustomHeadersSinglePage(prefix, marker, maxresults, include, timeout, context), - nextLink -> listSharesSegmentNextSinglePage(nextLink, context)); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 a user delegation key along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getUserDelegationKeyWithResponseAsync(KeyInfo keyInfo, Integer timeout, String requestId) { - return FluxUtil - .withContext(context -> getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 a user delegation key along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getUserDelegationKeyWithResponseAsync(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - return service - .getUserDelegationKey(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), requestId, - keyInfo, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. + * Retrieves a user delegation key for the File service. This can be used to generate a user delegation SAS. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: String (Optional)
+     *     Expiry: String (Required)
+     *     DelegatedUserTid: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedOid: String (Required)
+     *     SignedTid: String (Required)
+     *     SignedStart: OffsetDateTime (Required)
+     *     SignedExpiry: OffsetDateTime (Required)
+     *     SignedService: String (Required)
+     *     SignedVersion: String (Required)
+     *     SignedDelegatedUserTid: String (Optional)
+     *     Value: String (Required)
+     * }
+     * }
+     * 
* * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 a user delegation key on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId) { - return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 a user delegation key on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getUserDelegationKeyAsync(KeyInfo keyInfo, Integer timeout, String requestId, - Context context) { - return getUserDelegationKeyWithResponseAsync(keyInfo, timeout, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a user delegation key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUserDelegationKeyNoCustomHeadersWithResponseAsync(KeyInfo keyInfo, - Integer timeout, String requestId) { - return FluxUtil - .withContext( - context -> getUserDelegationKeyNoCustomHeadersWithResponseAsync(keyInfo, timeout, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 a user delegation key along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUserDelegationKeyNoCustomHeadersWithResponseAsync(KeyInfo keyInfo, - Integer timeout, String requestId, Context context) { - final String restype = "service"; - final String comp = "userdelegationkey"; + public Mono> getUserDelegationKeyWithResponseAsync(BinaryData keyInfo, + RequestOptions requestOptions) { + final String contentType = "application/xml"; final String accept = "application/xml"; - return service - .getUserDelegationKeyNoCustomHeaders(this.client.getUrl(), restype, comp, timeout, this.client.getVersion(), - requestId, keyInfo, accept, context) + return FluxUtil + .withContext(context -> service.getUserDelegationKey(this.client.getUrl(), contentType, + this.client.getServiceVersion().getVersion(), accept, keyInfo, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. + * Retrieves a user delegation key for the File service. This can be used to generate a user delegation SAS. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     Start: String (Optional)
+     *     Expiry: String (Required)
+     *     DelegatedUserTid: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedOid: String (Required)
+     *     SignedTid: String (Required)
+     *     SignedStart: OffsetDateTime (Required)
+     *     SignedExpiry: OffsetDateTime (Required)
+     *     SignedService: String (Required)
+     *     SignedVersion: String (Required)
+     *     SignedDelegatedUserTid: String (Optional)
+     *     Value: String (Required)
+     * }
+     * }
+     * 
* * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 a user delegation key along with {@link ResponseBase}. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a user delegation key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - getUserDelegationKeyWithResponse(KeyInfo keyInfo, Integer timeout, String requestId, Context context) { + public Response getUserDelegationKeyWithResponse(BinaryData keyInfo, RequestOptions requestOptions) { try { - final String restype = "service"; - final String comp = "userdelegationkey"; + final String contentType = "application/xml"; final String accept = "application/xml"; - return service.getUserDelegationKeySync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); + return service.getUserDelegationKeySync(this.client.getUrl(), contentType, + this.client.getServiceVersion().getVersion(), accept, keyInfo, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 a user delegation key. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserDelegationKey getUserDelegationKey(KeyInfo keyInfo, Integer timeout, String requestId) { + private List getValues(BinaryData binaryData, String... path) { try { - return getUserDelegationKeyWithResponse(keyInfo, timeout, requestId, Context.NONE).getValue(); + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + List values = (List) value; + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Retrieves a user delegation key for the File service. This is only a valid operation when using bearer token - * authentication. - * - * @param keyInfo Key information. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 a user delegation key along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUserDelegationKeyNoCustomHeadersWithResponse(KeyInfo keyInfo, Integer timeout, - String requestId, Context context) { + private String getNextLink(BinaryData binaryData, String... path) { try { - final String restype = "service"; - final String comp = "userdelegationkey"; - final String accept = "application/xml"; - return service.getUserDelegationKeyNoCustomHeadersSync(this.client.getUrl(), restype, comp, timeout, - this.client.getVersion(), requestId, keyInfo, accept, context); + try { + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map) value).get(segment); + } + return (String) value; + } catch (RuntimeException e) { + return 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. - * @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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNextSinglePageAsync(String nextLink) { - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.listSharesSegmentNext(nextLink, this.client.getUrl(), - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of 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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNextSinglePageAsync(String nextLink, - Context context) { - final String accept = "application/xml"; - return service - .listSharesSegmentNext(nextLink, this.client.getUrl(), this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of 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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNextNoCustomHeadersSinglePageAsync(String nextLink) { - final String accept = "application/xml"; - return FluxUtil - .withContext(context -> service.listSharesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); - } + private static final com.azure.core.util.serializer.ObjectSerializer XML_SERIALIZER + = XmlSerializerProviders.createInstance(); - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of 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 an enumeration of shares along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSharesSegmentNextNoCustomHeadersSinglePageAsync(String nextLink, - Context context) { - final String accept = "application/xml"; - return service - .listSharesSegmentNextNoCustomHeaders(nextLink, this.client.getUrl(), this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null)); + private List getXmlValues(BinaryData binaryData, + java.util.function.Function valueReader, String... path) { + try { + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlValues(reader, valueReader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of 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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNextSinglePage(String nextLink) { + private List getXmlValues(com.azure.xml.XmlReader reader, + java.util.function.Function valueReader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { try { - final String accept = "application/xml"; - ResponseBase res - = service.listSharesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), - this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + List values = new java.util.ArrayList<>(); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + values.add(valueReader.apply(reader)); + } else { + values.addAll(getXmlValues(reader, valueReader, path, pathIndex + 1)); + } + } + return values; } 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 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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNextSinglePage(String nextLink, Context context) { + private String getXmlNextLink(BinaryData binaryData, String... path) { try { - final String accept = "application/xml"; - ResponseBase res - = service.listSharesSegmentNextSync(nextLink, this.client.getUrl(), this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), res.getDeserializedHeaders()); + try (com.azure.xml.XmlReader reader = com.azure.xml.XmlReader.fromStream(binaryData.toStream())) { + reader.nextElement(); + return getXmlNextLink(reader, path, 0); + } catch (javax.xml.stream.XMLStreamException e) { + throw new IllegalStateException("Failed to read XML pageable response.", e); + } } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of 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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNextNoCustomHeadersSinglePage(String nextLink) { + private String getXmlNextLink(com.azure.xml.XmlReader reader, String[] path, int pathIndex) + throws javax.xml.stream.XMLStreamException { try { - final String accept = "application/xml"; - Response res - = service.listSharesSegmentNextNoCustomHeadersSync(nextLink, this.client.getUrl(), - this.client.getVersion(), this.client.getFileRequestIntent(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + while (reader.nextElement() != com.azure.xml.XmlToken.END_ELEMENT) { + if (!reader.elementNameMatches(path[pathIndex])) { + reader.skipElement(); + } else if (pathIndex == path.length - 1) { + return reader.getStringElement(); + } else { + return getXmlNextLink(reader, path, pathIndex + 1); + } + } + return 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 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 an enumeration of shares along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse listSharesSegmentNextNoCustomHeadersSinglePage(String nextLink, - Context context) { + public Response listSharesSegmentWithResponse(RequestOptions requestOptions) { try { final String accept = "application/xml"; - Response res = service.listSharesSegmentNextNoCustomHeadersSync(nextLink, - this.client.getUrl(), this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getShareItems(), res.getValue().getNextMarker(), null); + return service.listSharesSegmentSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } + + public Mono> listSharesSegmentWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext( + context -> service.listSharesSegment(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java index 1ce207620adc..716d79980157 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation; import com.azure.core.annotation.BodyParam; @@ -10,48 +10,26 @@ import com.azure.core.annotation.HeaderParam; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType; -import com.azure.storage.file.share.implementation.models.SharePermission; -import com.azure.storage.file.share.implementation.models.ShareSignedIdentifierWrapper; -import com.azure.storage.file.share.implementation.models.ShareStats; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; -import com.azure.storage.file.share.implementation.models.SharesAcquireLeaseHeaders; -import com.azure.storage.file.share.implementation.models.SharesBreakLeaseHeaders; -import com.azure.storage.file.share.implementation.models.SharesChangeLeaseHeaders; -import com.azure.storage.file.share.implementation.models.SharesCreateHeaders; -import com.azure.storage.file.share.implementation.models.SharesCreatePermissionHeaders; -import com.azure.storage.file.share.implementation.models.SharesCreateSnapshotHeaders; -import com.azure.storage.file.share.implementation.models.SharesDeleteHeaders; -import com.azure.storage.file.share.implementation.models.SharesGetAccessPolicyHeaders; -import com.azure.storage.file.share.implementation.models.SharesGetPermissionHeaders; -import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.SharesGetStatisticsHeaders; -import com.azure.storage.file.share.implementation.models.SharesReleaseLeaseHeaders; -import com.azure.storage.file.share.implementation.models.SharesRenewLeaseHeaders; -import com.azure.storage.file.share.implementation.models.SharesRestoreHeaders; -import com.azure.storage.file.share.implementation.models.SharesSetAccessPolicyHeaders; -import com.azure.storage.file.share.implementation.models.SharesSetMetadataHeaders; -import com.azure.storage.file.share.implementation.models.SharesSetPropertiesHeaders; import com.azure.storage.file.share.implementation.util.ModelHelper; -import com.azure.storage.file.share.models.FilePermissionFormat; -import com.azure.storage.file.share.models.ShareAccessTier; -import com.azure.storage.file.share.models.ShareRootSquash; -import com.azure.storage.file.share.models.ShareSignedIdentifier; import com.azure.storage.file.share.models.ShareTokenIntent; -import java.util.List; -import java.util.Map; import reactor.core.publisher.Mono; /** @@ -79,6 +57,19 @@ public final class SharesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public ShareServiceVersion getServiceVersion() { + try { + return client.getServiceVersion(); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } + } + /** * The interface defining all the services for AzureFileStorageShares to be used by the proxy service to perform * REST calls. @@ -87,5450 +78,1831 @@ public final class SharesImpl { @ServiceInterface(name = "AzureFileStorageShares") public interface SharesService { - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> create(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-share-quota") Integer quota, @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-enabled-protocols") String enabledProtocols, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") + @Put("?restype=share") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-share-quota") Integer quota, @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-enabled-protocols") String enabledProtocols, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, - @HeaderParam("x-ms-share-quota") Integer quota, @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-enabled-protocols") String enabledProtocols, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> create(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @QueryParam("restype") String restype, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-share-quota") Integer quota, - @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-enabled-protocols") String enabledProtocols, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getProperties(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}") + @Get("?restype=share") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getPropertiesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}") + @Get("?restype=share") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> delete(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/{shareName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> deleteNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Delete("/{shareName}") + @Delete("?restype=share") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase deleteSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> delete(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Delete("/{shareName}") + @Delete("?restype=share") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response deleteNoCustomHeadersSync(@HostParam("url") String url, @PathParam("shareName") String shareName, - @QueryParam("restype") String restype, @QueryParam("sharesnapshot") String sharesnapshot, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> acquireLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase acquireLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> acquireLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> releaseLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase releaseLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response releaseLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> changeLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response acquireLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase changeLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> releaseLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response changeLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-version") String version, - @QueryParam("sharesnapshot") String sharesnapshot, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response releaseLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> renewLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> changeLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response changeLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase renewLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> renewLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response renewLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-version") String version, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> breakLease(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response renewLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase breakLeaseSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> breakLease(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=lease") @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response breakLeaseNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("comp") String comp, - @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod, - @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("sharesnapshot") String sharesnapshot, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createSnapshot(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createSnapshotNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createSnapshotSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createSnapshotNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createPermission(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/json") SharePermission sharePermission, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response breakLeaseSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-lease-action") String action, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=snapshot") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> createPermissionNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/json") SharePermission sharePermission, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createSnapshot(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=snapshot") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase createPermissionSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/json") SharePermission sharePermission, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createSnapshotSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=filepermission") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response createPermissionNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/json") SharePermission sharePermission, @HeaderParam("Accept") String accept, - Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPermission(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getPermissionNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getPermissionSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getPermissionNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @HeaderParam("x-ms-file-permission-key") String filePermissionKey, - @HeaderParam("x-ms-file-permission-format") FilePermissionFormat filePermissionFormat, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setProperties(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, - @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, - @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setPropertiesSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, - @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, - @HeaderParam("x-ms-access-tier") ShareAccessTier accessTier, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-root-squash") ShareRootSquash rootSquash, - @HeaderParam("x-ms-enable-snapshot-virtual-directory-access") Boolean enableSnapshotVirtualDirectoryAccess, - @HeaderParam("x-ms-share-paid-bursting-enabled") Boolean paidBurstingEnabled, - @HeaderParam("x-ms-share-paid-bursting-max-bandwidth-mibps") Long paidBurstingMaxBandwidthMibps, - @HeaderParam("x-ms-share-paid-bursting-max-iops") Long paidBurstingMaxIops, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, - @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, - @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadata(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setMetadataNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setMetadataSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setMetadataNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getAccessPolicy( - @HostParam("url") String url, @PathParam("shareName") String shareName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createPermission(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") BinaryData permission, RequestOptions requestOptions, Context context); - @Get("/{shareName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getAccessPolicyNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, + @Put("?restype=share&comp=filepermission") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createPermissionSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") BinaryData permission, RequestOptions requestOptions, Context context); - @Get("/{shareName}") + @Get("?restype=share&comp=filepermission") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getAccessPolicySync( - @HostParam("url") String url, @PathParam("shareName") String shareName, - @QueryParam("restype") String restype, @QueryParam("comp") String comp, - @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPermission(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-permission-key") String filePermissionKey, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}") + @Get("?restype=share&comp=filepermission") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPermissionSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-permission-key") String filePermissionKey, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setAccessPolicy(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareSignedIdentifierWrapper shareAcl, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setProperties(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=properties") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> setAccessPolicyNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareSignedIdentifierWrapper shareAcl, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setPropertiesSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=metadata") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase setAccessPolicySync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareSignedIdentifierWrapper shareAcl, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setMetadata(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=metadata") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response setAccessPolicyNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @BodyParam("application/xml") ShareSignedIdentifierWrapper shareAcl, @HeaderParam("Accept") String accept, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setMetadataSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, Context context); - @Get("/{shareName}") + @Get("?restype=share&comp=acl") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getStatistics(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAccessPolicy(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}") + @Get("?restype=share&comp=acl") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> getStatisticsNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAccessPolicySync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/{shareName}") + @Put("?restype=share&comp=acl") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase getStatisticsSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> setAccessPolicy(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Get("/{shareName}") + @Put("?restype=share&comp=acl") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response getStatisticsNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response setAccessPolicySync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> restore(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-share-name") String deletedShareName, - @HeaderParam("x-ms-deleted-share-version") String deletedShareVersion, + @Get("?restype=share&comp=stats") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getStatistics(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Mono> restoreNoCustomHeaders(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-share-name") String deletedShareName, - @HeaderParam("x-ms-deleted-share-version") String deletedShareVersion, + @Get("?restype=share&comp=stats") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getStatisticsSync(@HostParam("url") String url, + @HeaderParam("x-ms-version") String xMsVersion, @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=undelete") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - ResponseBase restoreSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-share-name") String deletedShareName, - @HeaderParam("x-ms-deleted-share-version") String deletedShareVersion, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> restore(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); - @Put("/{shareName}") + @Put("?restype=share&comp=undelete") @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ShareStorageExceptionInternal.class) - Response restoreNoCustomHeadersSync(@HostParam("url") String url, - @PathParam("shareName") String shareName, @QueryParam("restype") String restype, - @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout, - @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("x-ms-deleted-share-name") String deletedShareName, - @HeaderParam("x-ms-deleted-share-version") String deletedShareVersion, - @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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> createWithResponseAsync(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, - enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service.create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, Integer timeout, Map metadata, Integer quota, - ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String shareName, Integer timeout, Map metadata, Integer quota, - ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { - return createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response restoreSync(@HostParam("url") String url, @HeaderParam("x-ms-version") String xMsVersion, + @HeaderParam("x-ms-file-request-intent") ShareTokenIntent fileRequestIntent, RequestOptions requestOptions, + Context context); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-share-quotaIntegerNoSpecifies the maximum size of the share, in + * gigabytes.
x-ms-access-tierStringNoSpecifies the access tier of the share. Allowed + * values: "TransactionOptimized", "Hot", "Cool", "Premium".
x-ms-enabled-protocolsStringNoProtocols to enable on the share.
x-ms-root-squashStringNoRoot squash to set on the share. Only valid for NFS + * shares. Allowed values: "NoRootSquash", "RootSquash", "AllSquash".
x-ms-enable-snapshot-virtual-directory-accessBooleanNoOptional. Used to enable + * snapshot virtual directory access.
x-ms-share-paid-bursting-enabledBooleanNoOptional. Boolean. Default if not + * specified is false. This property enables paid bursting.
x-ms-share-paid-bursting-max-iopsLongNoOptional. Integer. Default if not + * specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 + * IOPS.
x-ms-share-paid-bursting-max-bandwidth-mibpsLongNoOptional. Integer. Default + * if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 + * MiB/sec.
x-ms-share-provisioned-iopsLongNoOptional. Specifies the provisioned IOPS of + * the share.
x-ms-share-provisioned-bandwidth-mibpsLongNoOptional. Specifies the + * provisioned bandwidth of the share, in MiBps.
x-ms-enable-smb-directory-leaseBooleanNoOptional. Used to enable SMB directory + * lease.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { + public Mono> createWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, quota, - accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + .withContext(context -> service.create(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** * Creates a new share under the specified account. If the share with the same name already exists, the operation * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createWithResponse(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.createSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, - this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String shareName, Integer timeout, Map metadata, Integer quota, - ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - createWithResponse(shareName, timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); - } - - /** - * Creates a new share under the specified account. If the share with the same name already exists, the operation - * fails. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param enabledProtocols Protocols to enable on the share. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createNoCustomHeadersWithResponse(String shareName, Integer timeout, - Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, - ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, - Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.createNoCustomHeadersSync(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> getPropertiesWithResponseAsync(String shareName, - String sharesnapshot, Integer timeout, String leaseId) { - return FluxUtil - .withContext(context -> getPropertiesWithResponseAsync(shareName, sharesnapshot, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesWithResponseAsync(String shareName, - String sharesnapshot, Integer timeout, String leaseId, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service - .getProperties(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, this.client.getVersion(), - leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String sharesnapshot, Integer timeout, String leaseId) { - return getPropertiesWithResponseAsync(shareName, sharesnapshot, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPropertiesAsync(String shareName, String sharesnapshot, Integer timeout, String leaseId, - Context context) { - return getPropertiesWithResponseAsync(shareName, sharesnapshot, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, String leaseId) { - return FluxUtil - .withContext(context -> getPropertiesNoCustomHeadersWithResponseAsync(shareName, sharesnapshot, timeout, - leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPropertiesNoCustomHeadersWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, String leaseId, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service - .getPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPropertiesWithResponse(String shareName, - String sharesnapshot, Integer timeout, String leaseId, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.getPropertiesSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void getProperties(String shareName, String sharesnapshot, Integer timeout, String leaseId) { - getPropertiesWithResponse(shareName, sharesnapshot, timeout, leaseId, Context.NONE); - } - - /** - * Returns all user-defined metadata and system properties for the specified share or share snapshot. The data - * returned does not include the share's list of files. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPropertiesNoCustomHeadersWithResponse(String shareName, String sharesnapshot, - Integer timeout, String leaseId, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.getPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, - timeout, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> deleteWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { - return FluxUtil.withContext( - context -> deleteWithResponseAsync(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service - .delete(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, this.client.getVersion(), - deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String sharesnapshot, Integer timeout, - DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { - return deleteWithResponseAsync(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String shareName, String sharesnapshot, Integer timeout, - DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { - return deleteWithResponseAsync(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { - return FluxUtil - .withContext(context -> deleteNoCustomHeadersWithResponseAsync(shareName, sharesnapshot, timeout, - deleteSnapshots, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteNoCustomHeadersWithResponseAsync(String shareName, String sharesnapshot, - Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { - final String restype = "share"; - final String accept = "application/xml"; - return service - .deleteNoCustomHeaders(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteWithResponse(String shareName, String sharesnapshot, - Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.deleteSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String shareName, String sharesnapshot, Integer timeout, - DeleteSnapshotsOptionType deleteSnapshots, String leaseId) { - deleteWithResponse(shareName, sharesnapshot, timeout, deleteSnapshots, leaseId, Context.NONE); - } - - /** - * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files - * contained within it are later deleted during garbage collection. - * - * @param shareName The name of the target share. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteNoCustomHeadersWithResponse(String shareName, String sharesnapshot, Integer timeout, - DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) { - try { - final String restype = "share"; - final String accept = "application/xml"; - return service.deleteNoCustomHeadersSync(this.client.getUrl(), shareName, restype, sharesnapshot, timeout, - this.client.getVersion(), deleteSnapshots, leaseId, this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> acquireLeaseWithResponseAsync(String shareName, - Integer timeout, Integer duration, String proposedLeaseId, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> acquireLeaseWithResponseAsync(shareName, timeout, duration, proposedLeaseId, - sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseWithResponseAsync(String shareName, - Integer timeout, Integer duration, String proposedLeaseId, String sharesnapshot, String requestId, - Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .acquireLease(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, proposedLeaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String shareName, Integer timeout, Integer duration, String proposedLeaseId, - String sharesnapshot, String requestId) { - return acquireLeaseWithResponseAsync(shareName, timeout, duration, proposedLeaseId, sharesnapshot, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono acquireLeaseAsync(String shareName, Integer timeout, Integer duration, String proposedLeaseId, - String sharesnapshot, String requestId, Context context) { - return acquireLeaseWithResponseAsync(shareName, timeout, duration, proposedLeaseId, sharesnapshot, requestId, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer duration, String proposedLeaseId, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> acquireLeaseNoCustomHeadersWithResponseAsync(shareName, timeout, duration, - proposedLeaseId, sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> acquireLeaseNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer duration, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "acquire"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .acquireLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase acquireLeaseWithResponse(String shareName, Integer timeout, - Integer duration, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "acquire"; - final String restype = "share"; - final String accept = "application/xml"; - return service.acquireLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, duration, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void acquireLease(String shareName, Integer timeout, Integer duration, String proposedLeaseId, - String sharesnapshot, String requestId) { - acquireLeaseWithResponse(shareName, timeout, duration, proposedLeaseId, sharesnapshot, requestId, Context.NONE); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 duration Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never - * expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or - * change. - * @param proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response acquireLeaseNoCustomHeadersWithResponse(String shareName, Integer timeout, Integer duration, - String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "acquire"; - final String restype = "share"; - final String accept = "application/xml"; - return service.acquireLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, - timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> releaseLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String sharesnapshot, String requestId) { - return FluxUtil.withContext( - context -> releaseLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .releaseLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, - String requestId) { - return releaseLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono releaseLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, - String requestId, Context context) { - return releaseLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> releaseLeaseNoCustomHeadersWithResponseAsync(shareName, leaseId, timeout, - sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> releaseLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "release"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .releaseLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase releaseLeaseWithResponse(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "release"; - final String restype = "share"; - final String accept = "application/xml"; - return service.releaseLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void releaseLease(String shareName, String leaseId, Integer timeout, String sharesnapshot, - String requestId) { - releaseLeaseWithResponse(shareName, leaseId, timeout, sharesnapshot, requestId, Context.NONE); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response releaseLeaseNoCustomHeadersWithResponse(String shareName, String leaseId, Integer timeout, - String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "release"; - final String restype = "share"; - final String accept = "application/xml"; - return service.releaseLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, - timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> changeLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> changeLeaseWithResponseAsync(shareName, leaseId, timeout, proposedLeaseId, - sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId, - Context context) { - final String comp = "lease"; - final String action = "change"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .changeLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, proposedLeaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String shareName, String leaseId, Integer timeout, String proposedLeaseId, - String sharesnapshot, String requestId) { - return changeLeaseWithResponseAsync(shareName, leaseId, timeout, proposedLeaseId, sharesnapshot, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeLeaseAsync(String shareName, String leaseId, Integer timeout, String proposedLeaseId, - String sharesnapshot, String requestId, Context context) { - return changeLeaseWithResponseAsync(shareName, leaseId, timeout, proposedLeaseId, sharesnapshot, requestId, - context).onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> changeLeaseNoCustomHeadersWithResponseAsync(shareName, leaseId, timeout, - proposedLeaseId, sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> changeLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "change"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .changeLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase changeLeaseWithResponse(String shareName, String leaseId, - Integer timeout, String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "change"; - final String restype = "share"; - final String accept = "application/xml"; - return service.changeLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), - accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void changeLease(String shareName, String leaseId, Integer timeout, String proposedLeaseId, - String sharesnapshot, String requestId) { - changeLeaseWithResponse(shareName, leaseId, timeout, proposedLeaseId, sharesnapshot, requestId, Context.NONE); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 proposedLeaseId Proposed lease ID, in a GUID string format. The File service returns 400 (Invalid request) - * if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID - * string formats. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response changeLeaseNoCustomHeadersWithResponse(String shareName, String leaseId, Integer timeout, - String proposedLeaseId, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "change"; - final String restype = "share"; - final String accept = "application/xml"; - return service.changeLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, - timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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> renewLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String sharesnapshot, String requestId) { - return FluxUtil - .withContext( - context -> renewLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseWithResponseAsync(String shareName, - String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "renew"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .renewLease(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, - String requestId) { - return renewLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono renewLeaseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, - String requestId, Context context) { - return renewLeaseWithResponseAsync(shareName, leaseId, timeout, sharesnapshot, requestId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId) { - return FluxUtil - .withContext(context -> renewLeaseNoCustomHeadersWithResponseAsync(shareName, leaseId, timeout, - sharesnapshot, requestId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> renewLeaseNoCustomHeadersWithResponseAsync(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId, Context context) { - final String comp = "lease"; - final String action = "renew"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .renewLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase renewLeaseWithResponse(String shareName, String leaseId, - Integer timeout, String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "renew"; - final String restype = "share"; - final String accept = "application/xml"; - return service.renewLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, leaseId, - this.client.getVersion(), sharesnapshot, requestId, this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void renewLease(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId) { - renewLeaseWithResponse(shareName, leaseId, timeout, sharesnapshot, requestId, Context.NONE); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @param leaseId Specifies the current lease ID on the resource. - * @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 sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response renewLeaseNoCustomHeadersWithResponse(String shareName, String leaseId, Integer timeout, - String sharesnapshot, String requestId, Context context) { - try { - final String comp = "lease"; - final String action = "renew"; - final String restype = "share"; - final String accept = "application/xml"; - return service.renewLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, - timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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> breakLeaseWithResponseAsync(String shareName, - Integer timeout, Integer breakPeriod, String leaseId, String requestId, String sharesnapshot) { - return FluxUtil - .withContext(context -> breakLeaseWithResponseAsync(shareName, timeout, breakPeriod, leaseId, requestId, - sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseWithResponseAsync(String shareName, - Integer timeout, Integer breakPeriod, String leaseId, String requestId, String sharesnapshot, Context context) { - final String comp = "lease"; - final String action = "break"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .breakLease(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, leaseId, - this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String shareName, Integer timeout, Integer breakPeriod, String leaseId, - String requestId, String sharesnapshot) { - return breakLeaseWithResponseAsync(shareName, timeout, breakPeriod, leaseId, requestId, sharesnapshot) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono breakLeaseAsync(String shareName, Integer timeout, Integer breakPeriod, String leaseId, - String requestId, String sharesnapshot, Context context) { - return breakLeaseWithResponseAsync(shareName, timeout, breakPeriod, leaseId, requestId, sharesnapshot, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer breakPeriod, String leaseId, String requestId, String sharesnapshot) { - return FluxUtil - .withContext(context -> breakLeaseNoCustomHeadersWithResponseAsync(shareName, timeout, breakPeriod, leaseId, - requestId, sharesnapshot, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> breakLeaseNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer breakPeriod, String leaseId, String requestId, String sharesnapshot, Context context) { - final String comp = "lease"; - final String action = "break"; - final String restype = "share"; - final String accept = "application/xml"; - return service - .breakLeaseNoCustomHeaders(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, - leaseId, this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase breakLeaseWithResponse(String shareName, Integer timeout, - Integer breakPeriod, String leaseId, String requestId, String sharesnapshot, Context context) { - try { - final String comp = "lease"; - final String action = "break"; - final String restype = "share"; - final String accept = "application/xml"; - return service.breakLeaseSync(this.client.getUrl(), shareName, comp, action, restype, timeout, breakPeriod, - leaseId, this.client.getVersion(), requestId, sharesnapshot, this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void breakLease(String shareName, Integer timeout, Integer breakPeriod, String leaseId, String requestId, - String sharesnapshot) { - breakLeaseWithResponse(shareName, timeout, breakPeriod, leaseId, requestId, sharesnapshot, Context.NONE); - } - - /** - * The Lease Share operation establishes and manages a lock on a share, or the specified snapshot for set and delete - * share operations. - * - * @param shareName The name of the target share. - * @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 breakPeriod For a break operation, proposed duration the lease should continue before it is broken, in - * seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. - * If longer, the time remaining on the lease is used. A new lease will not be available before the break period has - * expired, but the lease may be held for longer than the break period. If this header does not appear with a break - * operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks - * immediately. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param sharesnapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the share - * snapshot to query. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response breakLeaseNoCustomHeadersWithResponse(String shareName, Integer timeout, Integer breakPeriod, - String leaseId, String requestId, String sharesnapshot, Context context) { - try { - final String comp = "lease"; - final String action = "break"; - final String restype = "share"; - final String accept = "application/xml"; - return service.breakLeaseNoCustomHeadersSync(this.client.getUrl(), shareName, comp, action, restype, - timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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. - * @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> createSnapshotWithResponseAsync(String shareName, - Integer timeout, Map metadata) { - return FluxUtil.withContext(context -> createSnapshotWithResponseAsync(shareName, timeout, metadata, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotWithResponseAsync(String shareName, - Integer timeout, Map metadata, Context context) { - final String restype = "share"; - final String comp = "snapshot"; - final String accept = "application/xml"; - return service - .createSnapshot(this.client.getUrl(), shareName, restype, comp, timeout, metadata, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String shareName, Integer timeout, Map metadata) { - return createSnapshotWithResponseAsync(shareName, timeout, metadata) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String shareName, Integer timeout, Map metadata, - Context context) { - return createSnapshotWithResponseAsync(shareName, timeout, metadata, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata) { - return FluxUtil - .withContext( - context -> createSnapshotNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata, Context context) { - final String restype = "share"; - final String comp = "snapshot"; - final String accept = "application/xml"; - return service - .createSnapshotNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createSnapshotWithResponse(String shareName, Integer timeout, - Map metadata, Context context) { - try { - final String restype = "share"; - final String comp = "snapshot"; - final String accept = "application/xml"; - return service.createSnapshotSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createSnapshot(String shareName, Integer timeout, Map metadata) { - createSnapshotWithResponse(shareName, timeout, metadata, Context.NONE); - } - - /** - * Creates a read-only snapshot of a share. - * - * @param shareName The name of the target share. - * @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 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSnapshotNoCustomHeadersWithResponse(String shareName, Integer timeout, - Map metadata, Context context) { - try { - final String restype = "share"; - final String comp = "snapshot"; - final String accept = "application/xml"; - return service.createSnapshotNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - metadata, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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>. - * @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> createPermissionWithResponseAsync(String shareName, - SharePermission sharePermission, Integer timeout) { - return FluxUtil - .withContext(context -> createPermissionWithResponseAsync(shareName, sharePermission, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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 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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createPermissionWithResponseAsync(String shareName, - SharePermission sharePermission, Integer timeout, Context context) { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/xml"; - return service - .createPermission(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), sharePermission, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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>. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createPermissionAsync(String shareName, SharePermission sharePermission, Integer timeout) { - return createPermissionWithResponseAsync(shareName, sharePermission, timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createPermissionAsync(String shareName, SharePermission sharePermission, Integer timeout, - Context context) { - return createPermissionWithResponseAsync(shareName, sharePermission, timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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>. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createPermissionNoCustomHeadersWithResponseAsync(String shareName, - SharePermission sharePermission, Integer timeout) { - return FluxUtil.withContext( - context -> createPermissionNoCustomHeadersWithResponseAsync(shareName, sharePermission, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createPermissionNoCustomHeadersWithResponseAsync(String shareName, - SharePermission sharePermission, Integer timeout, Context context) { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/xml"; - return service - .createPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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 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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createPermissionWithResponse(String shareName, - SharePermission sharePermission, Integer timeout, Context context) { - try { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/xml"; - return service.createPermissionSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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>. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void createPermission(String shareName, SharePermission sharePermission, Integer timeout) { - createPermissionWithResponse(shareName, sharePermission, timeout, Context.NONE); - } - - /** - * Create a permission (a security descriptor). - * - * @param shareName The name of the target share. - * @param sharePermission A permission (a security descriptor) at the share level. - * @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 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createPermissionNoCustomHeadersWithResponse(String shareName, SharePermission sharePermission, - Integer timeout, Context context) { - try { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/xml"; - return service.createPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), this.client.getFileRequestIntent(), sharePermission, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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>. - * @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 a permission (a security descriptor) at the share level along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPermissionWithResponseAsync( - String shareName, String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout) { - return FluxUtil - .withContext(context -> getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, - timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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 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 a permission (a security descriptor) at the share level along with {@link ResponseBase} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPermissionWithResponseAsync( - String shareName, String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout, - Context context) { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/json"; - return service - .getPermission(this.client.getUrl(), shareName, restype, comp, filePermissionKey, filePermissionFormat, - timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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>. - * @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 a permission (a security descriptor) at the share level on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPermissionAsync(String shareName, String filePermissionKey, - FilePermissionFormat filePermissionFormat, Integer timeout) { - return getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, timeout) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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 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 a permission (a security descriptor) at the share level on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPermissionAsync(String shareName, String filePermissionKey, - FilePermissionFormat filePermissionFormat, Integer timeout, Context context) { - return getPermissionWithResponseAsync(shareName, filePermissionKey, filePermissionFormat, timeout, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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>. - * @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 a permission (a security descriptor) at the share level along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPermissionNoCustomHeadersWithResponseAsync(String shareName, - String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout) { - return FluxUtil - .withContext(context -> getPermissionNoCustomHeadersWithResponseAsync(shareName, filePermissionKey, - filePermissionFormat, timeout, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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 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 a permission (a security descriptor) at the share level along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPermissionNoCustomHeadersWithResponseAsync(String shareName, - String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout, Context context) { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/json"; - return service - .getPermissionNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, filePermissionKey, - filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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 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 a permission (a security descriptor) at the share level along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getPermissionWithResponse(String shareName, - String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout, Context context) { - try { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/json"; - return service.getPermissionSync(this.client.getUrl(), shareName, restype, comp, filePermissionKey, - filePermissionFormat, timeout, this.client.getVersion(), this.client.getFileRequestIntent(), accept, - context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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>. - * @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 a permission (a security descriptor) at the share level. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SharePermission getPermission(String shareName, String filePermissionKey, - FilePermissionFormat filePermissionFormat, Integer timeout) { - try { - return getPermissionWithResponse(shareName, filePermissionKey, filePermissionFormat, timeout, Context.NONE) - .getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns the permission (security descriptor) for a given key. - * - * @param shareName The name of the target share. - * @param filePermissionKey Key of the permission to be set for the directory/file. - * @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 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 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 a permission (a security descriptor) at the share level along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getPermissionNoCustomHeadersWithResponse(String shareName, - String filePermissionKey, FilePermissionFormat filePermissionFormat, Integer timeout, Context context) { - try { - final String restype = "share"; - final String comp = "filepermission"; - final String accept = "application/json"; - return service.getPermissionNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, - filePermissionKey, filePermissionFormat, timeout, this.client.getVersion(), - this.client.getFileRequestIntent(), accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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> setPropertiesWithResponseAsync(String shareName, - Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil.withContext(context -> setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesWithResponseAsync(String shareName, - Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { - final String restype = "share"; - final String comp = "properties"; - final String accept = "application/xml"; - return service - .setProperties(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), quota, - accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, - String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, - Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setPropertiesAsync(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, - String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, - Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, - Context context) { - return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { - final String restype = "share"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setPropertiesWithResponse(String shareName, Integer timeout, - Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { - try { - final String restype = "share"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, - this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void setProperties(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, - String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, - Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - setPropertiesWithResponse(shareName, timeout, quota, accessTier, leaseId, rootSquash, - enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); - } - - /** - * Sets properties for the specified share. - * - * @param shareName The name of the target share. - * @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 quota Specifies the maximum size of the share, in gigabytes. - * @param accessTier Specifies the access tier of the share. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param rootSquash Root squash to set on the share. Only valid for NFS shares. - * @param enableSnapshotVirtualDirectoryAccess The enableSnapshotVirtualDirectoryAccess parameter. - * @param paidBurstingEnabled Optional. Boolean. Default if not specified is false. This property enables paid - * bursting. - * @param paidBurstingMaxBandwidthMibps Optional. Integer. Default if not specified is the maximum throughput the - * file share can support. Current maximum for a file share is 10,340 MiB/sec. - * @param paidBurstingMaxIops Optional. Integer. Default if not specified is the maximum IOPS the file share can - * support. Current maximum for a file share is 102,400 IOPS. - * @param shareProvisionedIops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 - * file shares. Specifies the provisioned number of input/output operations per second (IOPS) of the share. If this - * is not specified, the provisioned IOPS is set to value calculated based on recommendation formula. - * @param shareProvisionedBandwidthMibps Optional. Supported in version 2025-01-05 and later. Only allowed for - * provisioned v2 file shares. Specifies the provisioned bandwidth of the share, in mebibytes per second (MiBps). If - * this is not specified, the provisioned bandwidth is set to value calculated based on recommendation formula. - * @param enableSmbDirectoryLease SMB only, default is true. Specifies whether granting of new directory leases for - * directories present in a share are to be enabled or disabled. An input of true specifies that granting of new - * directory leases is to be allowed. An input of false specifies that granting of new directory leases is to be - * blocked. - * @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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response setPropertiesNoCustomHeadersWithResponse(String shareName, Integer timeout, Integer quota, - ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, - Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, - Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { - try { - final String restype = "share"; - final String comp = "properties"; - final String accept = "application/xml"; - return service.setPropertiesNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, - this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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> setMetadataWithResponseAsync(String shareName, - Integer timeout, Map metadata, String leaseId) { - return FluxUtil - .withContext(context -> setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataWithResponseAsync(String shareName, - Integer timeout, Map metadata, String leaseId, Context context) { - final String restype = "share"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadata(this.client.getUrl(), shareName, restype, comp, timeout, metadata, this.client.getVersion(), - leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, Integer timeout, Map metadata, - String leaseId) { - return setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setMetadataAsync(String shareName, Integer timeout, Map metadata, String leaseId, - Context context) { - return setMetadataWithResponseAsync(shareName, timeout, metadata, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata, String leaseId) { - return FluxUtil - .withContext( - context -> setMetadataNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setMetadataNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - Map metadata, String leaseId, Context context) { - final String restype = "share"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service - .setMetadataNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 {@link ResponseBase}. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-share-quotaIntegerNoSpecifies the maximum size of the share, in + * gigabytes.
x-ms-access-tierStringNoSpecifies the access tier of the share. Allowed + * values: "TransactionOptimized", "Hot", "Cool", "Premium".
x-ms-enabled-protocolsStringNoProtocols to enable on the share.
x-ms-root-squashStringNoRoot squash to set on the share. Only valid for NFS + * shares. Allowed values: "NoRootSquash", "RootSquash", "AllSquash".
x-ms-enable-snapshot-virtual-directory-accessBooleanNoOptional. Used to enable + * snapshot virtual directory access.
x-ms-share-paid-bursting-enabledBooleanNoOptional. Boolean. Default if not + * specified is false. This property enables paid bursting.
x-ms-share-paid-bursting-max-iopsLongNoOptional. Integer. Default if not + * specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 + * IOPS.
x-ms-share-paid-bursting-max-bandwidth-mibpsLongNoOptional. Integer. Default + * if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 + * MiB/sec.
x-ms-share-provisioned-iopsLongNoOptional. Specifies the provisioned IOPS of + * the share.
x-ms-share-provisioned-bandwidth-mibpsLongNoOptional. Specifies the + * provisioned bandwidth of the share, in MiBps.
x-ms-enable-smb-directory-leaseBooleanNoOptional. Used to enable SMB directory + * lease.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setMetadataWithResponse(String shareName, Integer timeout, - Map metadata, String leaseId, Context context) { + public Response createWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataSync(this.client.getUrl(), shareName, restype, comp, timeout, metadata, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service.createSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + * Returns all user-defined metadata and system properties for the specified share or share snapshot. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void setMetadata(String shareName, Integer timeout, Map metadata, String leaseId) { - setMetadataWithResponse(shareName, timeout, metadata, leaseId, Context.NONE); - } - - /** - * Sets one or more user-defined name-value pairs for the specified share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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. + public Mono> getPropertiesWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.getProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Returns all user-defined metadata and system properties for the specified share or share snapshot. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setMetadataNoCustomHeadersWithResponse(String shareName, Integer timeout, - Map metadata, String leaseId, Context context) { + public Response getPropertiesWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "metadata"; - final String accept = "application/xml"; - return service.setMetadataNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - metadata, this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service.getPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Returns information about stored access policies specified on the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link ResponseBase} on successful completion of - * {@link Mono}. + * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files + * contained within it are later deleted during garbage collection. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-delete-snapshotsStringNoSpecifies the option include to delete the base + * share and all of its snapshots. Allowed values: "include", "include-leased".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyWithResponseAsync(String shareName, Integer timeout, String leaseId) { - return FluxUtil.withContext(context -> getAccessPolicyWithResponseAsync(shareName, timeout, leaseId, context)) + public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.delete(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Returns information about stored access policies specified on the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link ResponseBase} on successful completion of - * {@link Mono}. + * Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files + * contained within it are later deleted during garbage collection. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-delete-snapshotsStringNoSpecifies the option include to delete the base + * share and all of its snapshots. Allowed values: "include", "include-leased".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyWithResponseAsync(String shareName, Integer timeout, String leaseId, Context context) { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - return service - .getAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response deleteWithResponse(RequestOptions requestOptions) { + try { + return service.deleteSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Returns information about stored access policies specified on the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers on successful completion of {@link Mono}. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-durationIntegerNoSpecifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A + * lease duration cannot be changed using renew or change.
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAccessPolicyAsync(String shareName, Integer timeout, String leaseId) { - return getAccessPolicyWithResponseAsync(shareName, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns information about stored access policies specified on the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers on successful completion of {@link Mono}. + public Mono> acquireLeaseWithResponseAsync(RequestOptions requestOptions) { + final String action = "acquire"; + return FluxUtil + .withContext( + context -> service.acquireLease(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + action, this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-durationIntegerNoSpecifies the duration of the lease, in seconds, + * or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A + * lease duration cannot be changed using renew or change.
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAccessPolicyAsync(String shareName, Integer timeout, String leaseId, - Context context) { - return getAccessPolicyWithResponseAsync(shareName, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response acquireLeaseWithResponse(RequestOptions requestOptions) { + try { + final String action = "acquire"; + return service.acquireLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), action, + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Returns information about stored access policies specified on the share. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link Response} on successful completion of {@link Mono}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getAccessPolicyNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, String leaseId) { + public Mono> releaseLeaseWithResponseAsync(String leaseId, RequestOptions requestOptions) { + final String action = "release"; return FluxUtil .withContext( - context -> getAccessPolicyNoCustomHeadersWithResponseAsync(shareName, timeout, leaseId, context)) + context -> service.releaseLease(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + leaseId, action, this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Returns information about stored access policies specified on the share. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAccessPolicyNoCustomHeadersWithResponseAsync( - String shareName, Integer timeout, String leaseId, Context context) { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - return service - .getAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Returns information about stored access policies specified on the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link ResponseBase}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase - getAccessPolicyWithResponse(String shareName, Integer timeout, String leaseId, Context context) { + public Response releaseLeaseWithResponse(String leaseId, RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - return service.getAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + final String action = "release"; + return service.releaseLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), leaseId, + action, this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Returns information about stored access policies specified on the share. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareSignedIdentifierWrapper getAccessPolicy(String shareName, Integer timeout, String leaseId) { - try { - return getAccessPolicyWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); - } catch (ShareStorageExceptionInternal internalException) { - throw ModelHelper.mapToShareStorageException(internalException); - } - } - - /** - * Returns information about stored access policies specified on the share. + public Mono> changeLeaseWithResponseAsync(String leaseId, RequestOptions requestOptions) { + final String action = "change"; + return FluxUtil + .withContext( + context -> service.changeLease(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + leaseId, action, this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-proposed-lease-idStringNoProposed lease ID, in a GUID string format. The + * File service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid + * Constructor (String) for a list of valid GUID string formats.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 a collection of signed identifiers along with {@link Response}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAccessPolicyNoCustomHeadersWithResponse(String shareName, - Integer timeout, String leaseId, Context context) { + public Response changeLeaseWithResponse(String leaseId, RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - return service.getAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + final String action = "change"; + return service.changeLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), leaseId, + action, this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Sets a stored access policy for use with shared access signatures. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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}. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyWithResponseAsync(String shareName, - Integer timeout, String leaseId, List shareAcl) { + public Mono> renewLeaseWithResponseAsync(String leaseId, RequestOptions requestOptions) { + final String action = "renew"; return FluxUtil - .withContext(context -> setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyWithResponseAsync(String shareName, - Integer timeout, String leaseId, List shareAcl, Context context) { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service - .setAccessPolicy(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), shareAclConverted, accept, context) + .withContext( + context -> service.renewLease(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + leaseId, action, this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Sets a stored access policy for use with shared access signatures. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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 A {@link Mono} that completes when a successful response is received. + * @param leaseId Specifies the current lease ID on the resource. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setAccessPolicyAsync(String shareName, Integer timeout, String leaseId, - List shareAcl) { - return setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); + public Response renewLeaseWithResponse(String leaseId, RequestOptions requestOptions) { + try { + final String action = "renew"; + return service.renewLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), leaseId, + action, this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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 A {@link Mono} that completes when a successful response is received. + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-break-periodIntegerNoFor a break operation, proposed duration the + * lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is + * shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease + * will not be available before the break period has expired, but the lease may be held for longer than the break + * period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining + * lease period elapses, and an infinite lease breaks immediately.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono setAccessPolicyAsync(String shareName, Integer timeout, String leaseId, - List shareAcl, Context context) { - return setAccessPolicyWithResponseAsync(shareName, timeout, leaseId, shareAcl, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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 Response} on successful completion of {@link Mono}. + public Mono> breakLeaseWithResponseAsync(RequestOptions requestOptions) { + final String action = "break"; + return FluxUtil + .withContext( + context -> service.breakLease(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + action, this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
sharesnapshotStringNoThe snapshot parameter is an opaque DateTime value that + * specifies a share snapshot.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-break-periodIntegerNoFor a break operation, proposed duration the + * lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is + * shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease + * will not be available before the break period has expired, but the lease may be held for longer than the break + * period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining + * lease period elapses, and an infinite lease breaks immediately.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String leaseId, List shareAcl) { - return FluxUtil.withContext( - context -> setAccessPolicyNoCustomHeadersWithResponseAsync(shareName, timeout, leaseId, shareAcl, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response breakLeaseWithResponse(RequestOptions requestOptions) { + try { + final String action = "break"; + return service.breakLeaseSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), action, + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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. + * Creates a read-only snapshot of a share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> setAccessPolicyNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String leaseId, List shareAcl, Context context) { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicyNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, context) + public Mono> createSnapshotWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.createSnapshot(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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 {@link ResponseBase}. + * Creates a read-only snapshot of a share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase setAccessPolicyWithResponse(String shareName, - Integer timeout, String leaseId, List shareAcl, Context context) { + public Response createSnapshotWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicySync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, - context); + return service.createSnapshotSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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. + * Create a permission (a security descriptor). This is used to support file level ACLs for SMB shares. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     permission: String (Required)
+     *     format: String(Sddl/Binary) (Optional)
+     * }
+     * }
+     * 
+ * + * @param permission A permission (a security descriptor) at the share level. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void setAccessPolicy(String shareName, Integer timeout, String leaseId, - List shareAcl) { - setAccessPolicyWithResponse(shareName, timeout, leaseId, shareAcl, Context.NONE); - } - - /** - * Sets a stored access policy for use with shared access signatures. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param shareAcl The ACL for the share. - * @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. + public Mono> createPermissionWithResponseAsync(BinaryData permission, + RequestOptions requestOptions) { + final String contentType = "application/json"; + return FluxUtil + .withContext( + context -> service.createPermission(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, this.client.getFileRequestIntent(), permission, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Create a permission (a security descriptor). This is used to support file level ACLs for SMB shares. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     permission: String (Required)
+     *     format: String(Sddl/Binary) (Optional)
+     * }
+     * }
+     * 
+ * + * @param permission A permission (a security descriptor) at the share level. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response setAccessPolicyNoCustomHeadersWithResponse(String shareName, Integer timeout, String leaseId, - List shareAcl, Context context) { + public Response createPermissionWithResponse(BinaryData permission, RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "acl"; - final String accept = "application/xml"; - ShareSignedIdentifierWrapper shareAclConverted = new ShareSignedIdentifierWrapper(shareAcl); - return service.setAccessPolicyNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), shareAclConverted, accept, - context); + final String contentType = "application/json"; + return service.createPermissionSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + contentType, this.client.getFileRequestIntent(), permission, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link ResponseBase} on successful completion of {@link Mono}. + * Returns the permission (security descriptor) for a given permission key. This is used to support file level ACLs + * for SMB shares. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-permission-formatStringNoOptional. Specifies the format in which the + * permission is returned. Acceptable values are SDDL or binary. Allowed values: "Sddl", "Binary".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     permission: String (Required)
+     *     format: String(Sddl/Binary) (Optional)
+     * }
+     * }
+     * 
+ * + * @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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a permission (a security descriptor) at the share level along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsWithResponseAsync(String shareName, - Integer timeout, String leaseId) { - return FluxUtil.withContext(context -> getStatisticsWithResponseAsync(shareName, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link ResponseBase} on successful completion of {@link Mono}. + public Mono> getPermissionWithResponseAsync(String filePermissionKey, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getPermission(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + filePermissionKey, this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Returns the permission (security descriptor) for a given permission key. This is used to support file level ACLs + * for SMB shares. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-file-permission-formatStringNoOptional. Specifies the format in which the + * permission is returned. Acceptable values are SDDL or binary. Allowed values: "Sddl", "Binary".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     permission: String (Required)
+     *     format: String(Sddl/Binary) (Optional)
+     * }
+     * }
+     * 
+ * + * @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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a permission (a security descriptor) at the share level along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsWithResponseAsync(String shareName, - Integer timeout, String leaseId, Context context) { - final String restype = "share"; - final String comp = "stats"; - final String accept = "application/xml"; - return service - .getStatistics(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), leaseId, - this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + public Response getPermissionWithResponse(String filePermissionKey, RequestOptions requestOptions) { + try { + final String accept = "application/json"; + return service.getPermissionSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + filePermissionKey, this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share on successful completion of {@link Mono}. + * Sets properties for the specified share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-share-quotaIntegerNoSpecifies the maximum size of the share, in + * gigabytes.
x-ms-access-tierStringNoSpecifies the access tier of the share. Allowed + * values: "TransactionOptimized", "Hot", "Cool", "Premium".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-root-squashStringNoRoot squash to set on the share. Only valid for NFS + * shares. Allowed values: "NoRootSquash", "RootSquash", "AllSquash".
x-ms-enable-snapshot-virtual-directory-accessBooleanNoOptional. Used to enable + * snapshot virtual directory access.
x-ms-share-paid-bursting-enabledBooleanNoOptional. Boolean. Default if not + * specified is false. This property enables paid bursting.
x-ms-share-paid-bursting-max-iopsLongNoOptional. Integer. Default if not + * specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 + * IOPS.
x-ms-share-paid-bursting-max-bandwidth-mibpsLongNoOptional. Integer. Default + * if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 + * MiB/sec.
x-ms-share-provisioned-iopsLongNoOptional. Specifies the provisioned IOPS of + * the share.
x-ms-share-provisioned-bandwidth-mibpsLongNoOptional. Specifies the + * provisioned bandwidth of the share, in MiBps.
x-ms-enable-smb-directory-leaseBooleanNoOptional. Used to enable SMB directory + * lease.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatisticsAsync(String shareName, Integer timeout, String leaseId) { - return getStatisticsWithResponseAsync(shareName, timeout, leaseId) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono> setPropertiesWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext( + context -> service.setProperties(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share on successful completion of {@link Mono}. + * Sets properties for the specified share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-share-quotaIntegerNoSpecifies the maximum size of the share, in + * gigabytes.
x-ms-access-tierStringNoSpecifies the access tier of the share. Allowed + * values: "TransactionOptimized", "Hot", "Cool", "Premium".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
x-ms-root-squashStringNoRoot squash to set on the share. Only valid for NFS + * shares. Allowed values: "NoRootSquash", "RootSquash", "AllSquash".
x-ms-enable-snapshot-virtual-directory-accessBooleanNoOptional. Used to enable + * snapshot virtual directory access.
x-ms-share-paid-bursting-enabledBooleanNoOptional. Boolean. Default if not + * specified is false. This property enables paid bursting.
x-ms-share-paid-bursting-max-iopsLongNoOptional. Integer. Default if not + * specified is the maximum IOPS the file share can support. Current maximum for a file share is 102,400 + * IOPS.
x-ms-share-paid-bursting-max-bandwidth-mibpsLongNoOptional. Integer. Default + * if not specified is the maximum throughput the file share can support. Current maximum for a file share is 10,340 + * MiB/sec.
x-ms-share-provisioned-iopsLongNoOptional. Specifies the provisioned IOPS of + * the share.
x-ms-share-provisioned-bandwidth-mibpsLongNoOptional. Specifies the + * provisioned bandwidth of the share, in MiBps.
x-ms-enable-smb-directory-leaseBooleanNoOptional. Used to enable SMB directory + * lease.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getStatisticsAsync(String shareName, Integer timeout, String leaseId, Context context) { - return getStatisticsWithResponseAsync(shareName, timeout, leaseId, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response setPropertiesWithResponse(RequestOptions requestOptions) { + try { + return service.setPropertiesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); + } catch (ShareStorageExceptionInternal internalException) { + throw ModelHelper.mapToShareStorageException(internalException); + } } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link Response} on successful completion of {@link Mono}. + * Sets one or more user-defined name-value pairs for the specified share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String leaseId) { + public Mono> setMetadataWithResponseAsync(RequestOptions requestOptions) { return FluxUtil - .withContext(context -> getStatisticsNoCustomHeadersWithResponseAsync(shareName, timeout, leaseId, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getStatisticsNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String leaseId, Context context) { - final String restype = "share"; - final String comp = "stats"; - final String accept = "application/xml"; - return service - .getStatisticsNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context) + .withContext( + context -> service.setMetadata(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link ResponseBase}. + * Sets one or more user-defined name-value pairs for the specified share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-metaStringNoOptional. User-defined metadata for the resource.
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getStatisticsWithResponse(String shareName, - Integer timeout, String leaseId, Context context) { + public Response setMetadataWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "stats"; - final String accept = "application/xml"; - return service.getStatisticsSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + return service.setMetadataSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share. + * Returns information about stored access policies specified on the share that may be used with Shared Access + * Signatures. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Optional): {
+     *                 Start: OffsetDateTime (Optional)
+     *                 Expiry: OffsetDateTime (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an array of signed identifiers along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ShareStats getStatistics(String shareName, Integer timeout, String leaseId) { + public Mono> getAccessPolicyWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/xml"; + return FluxUtil + .withContext( + context -> service.getAccessPolicy(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Returns information about stored access policies specified on the share that may be used with Shared Access + * Signatures. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Optional): {
+     *                 Start: OffsetDateTime (Optional)
+     *                 Expiry: OffsetDateTime (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return represents an array of signed identifiers along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessPolicyWithResponse(RequestOptions requestOptions) { try { - return getStatisticsWithResponse(shareName, timeout, leaseId, Context.NONE).getValue(); + final String accept = "application/xml"; + return service.getAccessPolicySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Retrieves statistics related to the share. - * - * @param shareName The name of the target share. - * @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 leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @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 stats for the share along with {@link Response}. + * Sets stored access policies for the share that may be used with Shared Access Signatures. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Optional): {
+     *                 Start: OffsetDateTime (Optional)
+     *                 Expiry: OffsetDateTime (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> setAccessPolicyWithResponseAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); + return FluxUtil + .withContext( + context -> service.setAccessPolicy(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptionsLocal, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Sets stored access policies for the share that may be used with Shared Access Signatures. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Content-TypeStringNoThe content type. Allowed values: + * "application/xml".
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     SignedIdentifier (Required): [
+     *          (Required){
+     *             Id: String (Required)
+     *             AccessPolicy (Optional): {
+     *                 Start: OffsetDateTime (Optional)
+     *                 Expiry: OffsetDateTime (Optional)
+     *                 Permission: String (Optional)
+     *             }
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatisticsNoCustomHeadersWithResponse(String shareName, Integer timeout, - String leaseId, Context context) { + public Response setAccessPolicyWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "stats"; - final String accept = "application/xml"; - return service.getStatisticsNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), leaseId, this.client.getFileRequestIntent(), accept, context); + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null + && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"); + } + }); + return service.setAccessPolicySync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptionsLocal, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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> restoreWithResponseAsync(String shareName, Integer timeout, - String requestId, String deletedShareName, String deletedShareVersion) { - return FluxUtil - .withContext(context -> restoreWithResponseAsync(shareName, timeout, requestId, deletedShareName, - deletedShareVersion, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 {@link ResponseBase} on successful completion of {@link Mono}. + * Retrieves statistics related to the share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ShareUsageBytes: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return stats for the share along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restoreWithResponseAsync(String shareName, Integer timeout, - String requestId, String deletedShareName, String deletedShareVersion, Context context) { - final String restype = "share"; - final String comp = "undelete"; + public Mono> getStatisticsWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/xml"; - return service - .restore(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), requestId, - deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreAsync(String shareName, Integer timeout, String requestId, String deletedShareName, - String deletedShareVersion) { - return restoreWithResponseAsync(shareName, timeout, requestId, deletedShareName, deletedShareVersion) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreAsync(String shareName, Integer timeout, String requestId, String deletedShareName, - String deletedShareVersion, Context context) { - return restoreWithResponseAsync(shareName, timeout, requestId, deletedShareName, deletedShareVersion, context) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restoreNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String requestId, String deletedShareName, String deletedShareVersion) { return FluxUtil - .withContext(context -> restoreNoCustomHeadersWithResponseAsync(shareName, timeout, requestId, - deletedShareName, deletedShareVersion, context)) - .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> restoreNoCustomHeadersWithResponseAsync(String shareName, Integer timeout, - String requestId, String deletedShareName, String deletedShareVersion, Context context) { - final String restype = "share"; - final String comp = "undelete"; - final String accept = "application/xml"; - return service - .restoreNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), - requestId, deletedShareName, deletedShareVersion, this.client.getFileRequestIntent(), accept, context) + .withContext( + context -> service.getStatistics(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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 {@link ResponseBase}. + * Retrieves statistics related to the share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-lease-idStringNoIf specified, the lease ID must match the lease ID of the + * file.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     ShareUsageBytes: long (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return stats for the share along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase restoreWithResponse(String shareName, Integer timeout, - String requestId, String deletedShareName, String deletedShareVersion, Context context) { + public Response getStatisticsWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "undelete"; final String accept = "application/xml"; - return service.restoreSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context); + return service.getStatisticsSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } } /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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. + * Restores a previously deleted share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-deleted-share-nameStringNoSpecifies the name of the previously-deleted + * share.
x-ms-deleted-share-versionStringNoSpecifies the version of the + * previously-deleted share.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restore(String shareName, Integer timeout, String requestId, String deletedShareName, - String deletedShareVersion) { - restoreWithResponse(shareName, timeout, requestId, deletedShareName, deletedShareVersion, Context.NONE); - } - - /** - * Restores a previously deleted Share. - * - * @param shareName The name of the target share. - * @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 requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param deletedShareName Specifies the name of the previously-deleted share. - * @param deletedShareVersion Specifies the version of the previously-deleted share. - * @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. + public Mono> restoreWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.restore(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, context)) + .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); + } + + /** + * Restores a previously deleted share. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
timeoutIntegerNoThe timeout parameter is expressed in seconds.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-deleted-share-nameStringNoSpecifies the name of the previously-deleted + * share.
x-ms-deleted-share-versionStringNoSpecifies the version of the + * previously-deleted share.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response restoreNoCustomHeadersWithResponse(String shareName, Integer timeout, String requestId, - String deletedShareName, String deletedShareVersion, Context context) { + public Response restoreWithResponse(RequestOptions requestOptions) { try { - final String restype = "share"; - final String comp = "undelete"; - final String accept = "application/xml"; - return service.restoreNoCustomHeadersSync(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), requestId, deletedShareName, deletedShareVersion, - this.client.getFileRequestIntent(), accept, context); + return service.restoreSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(), + this.client.getFileRequestIntent(), requestOptions, Context.NONE); } 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/XmlSerializer.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/XmlSerializer.java new file mode 100644 index 000000000000..c2f52e003815 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/XmlSerializer.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.storage.file.share.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import com.azure.xml.XmlReader; +import com.azure.xml.XmlSerializable; +import com.azure.xml.XmlWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UncheckedIOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.concurrent.ConcurrentHashMap; +import javax.xml.stream.XMLStreamException; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class +/** + * An {@link ObjectSerializer} implementation that serializes and deserializes {@link XmlSerializable} types using + * {@code azure-xml}. Deserialization relies on the generated static {@code fromXml(XmlReader)} factory method on the + * target type. + */ +public final class XmlSerializer implements ObjectSerializer { + + private static final ConcurrentHashMap, Method> FROM_XML_CACHE = new ConcurrentHashMap<>(); + + @Override + @SuppressWarnings({ "unchecked", "cast" }) + public T deserialize(InputStream stream, TypeReference typeReference) { + Class clazz = (Class) typeReference.getJavaClass(); + Method fromXml = FROM_XML_CACHE.computeIfAbsent(clazz, c -> { + try { + return c.getDeclaredMethod("fromXml", XmlReader.class); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + "Type " + c.getName() + " does not have a static fromXml(XmlReader) method.", e); + } + }); + try (XmlReader xmlReader = XmlReader.fromStream(stream)) { + return (T) fromXml.invoke(null, xmlReader); + } catch (XMLStreamException | IllegalAccessException e) { + throw new IllegalStateException(e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(e.getCause() == null ? e : e.getCause()); + } + } + + @Override + public Mono deserializeAsync(InputStream stream, TypeReference typeReference) { + return Mono.fromCallable(() -> deserialize(stream, typeReference)); + } + + @Override + public void serialize(OutputStream stream, Object value) { + if (!(value instanceof XmlSerializable)) { + throw new IllegalArgumentException("Value must implement XmlSerializable to be serialized as XML, but was: " + + (value == null ? "null" : value.getClass().getName())); + } + try (XmlWriter xmlWriter = XmlWriter.toStream(stream)) { + xmlWriter.writeStartDocument(); + xmlWriter.writeXml((XmlSerializable) value); + xmlWriter.flush(); + } catch (XMLStreamException e) { + throw new UncheckedIOException(new IOException(e)); + } + } + + @Override + public Mono serializeAsync(OutputStream stream, Object value) { + return Mono.fromRunnable(() -> serialize(stream, value)); + } +} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/XmlSerializerProviders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/XmlSerializerProviders.java new file mode 100644 index 000000000000..fdbe36863c39 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/XmlSerializerProviders.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.file.share.implementation; + +import com.azure.core.util.serializer.ObjectSerializer; + +// DO NOT modify this helper class + +/** + * This class is a proxy for creating an {@link ObjectSerializer} that serializes and deserializes XML payloads using + * {@code azure-xml}. It mirrors the pattern of {@code JsonSerializerProviders} in {@code azure-core}, but for XML. + */ +public final class XmlSerializerProviders { + + /** + * Creates an instance of an XML {@link ObjectSerializer}. + * + * @return A new instance of an XML {@link ObjectSerializer}. + */ + public static ObjectSerializer createInstance() { + return new XmlSerializer(); + } + + private XmlSerializerProviders() { + // no-op + } +} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DeleteSnapshotsOptionType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DeleteSnapshotsOptionType.java index 5db13033adbf..d5f4687cb9c1 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DeleteSnapshotsOptionType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DeleteSnapshotsOptionType.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; /** - * Defines values for DeleteSnapshotsOptionType. + * The delete snapshots option type. */ public enum DeleteSnapshotsOptionType { /** - * Enum value include. + * include. */ INCLUDE("include"), /** - * Enum value include-leased. + * include-leased. */ INCLUDE_LEASED("include-leased"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java index 5b72c5ea86d4..26103c5e8d7b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -16,16 +16,16 @@ /** * A listed directory item. */ -@Fluent +@Immutable public final class DirectoryItem implements XmlSerializable { /* - * The Name property. + * The directory name. */ @Generated - private StringEncoded name; + private final StringEncoded name; /* - * The FileId property. + * The file ID. */ @Generated private String fileId; @@ -37,26 +37,29 @@ public final class DirectoryItem implements XmlSerializable { private FileProperty properties; /* - * The Attributes property. + * The file attributes. */ @Generated private String attributes; /* - * The PermissionKey property. + * The permission key. */ @Generated private String permissionKey; /** * Creates an instance of DirectoryItem class. + * + * @param name the name value to set. */ @Generated - public DirectoryItem() { + private DirectoryItem(StringEncoded name) { + this.name = name; } /** - * Get the name property: The Name property. + * Get the name property: The directory name. * * @return the name value. */ @@ -66,19 +69,7 @@ public StringEncoded getName() { } /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. + * Get the fileId property: The file ID. * * @return the fileId value. */ @@ -87,18 +78,6 @@ public String getFileId() { return this.fileId; } - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - /** * Get the properties property: File properties. * @@ -110,19 +89,7 @@ public FileProperty getProperties() { } /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the attributes property: The Attributes property. + * Get the attributes property: The file attributes. * * @return the attributes value. */ @@ -132,19 +99,7 @@ public String getAttributes() { } /** - * Set the attributes property: The Attributes property. - * - * @param attributes the attributes value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setAttributes(String attributes) { - this.attributes = attributes; - return this; - } - - /** - * Get the permissionKey property: The PermissionKey property. + * Get the permissionKey property: The permission key. * * @return the permissionKey value. */ @@ -153,18 +108,6 @@ public String getPermissionKey() { return this.permissionKey; } - /** - * Set the permissionKey property: The PermissionKey property. - * - * @param permissionKey the permissionKey value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setPermissionKey(String permissionKey) { - this.permissionKey = permissionKey; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -190,6 +133,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of DirectoryItem if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the DirectoryItem. */ @Generated @@ -205,6 +149,7 @@ public static DirectoryItem fromXml(XmlReader xmlReader) throws XMLStreamExcepti * cases where the model can deserialize from different root element names. * @return An instance of DirectoryItem if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the DirectoryItem. */ @Generated @@ -212,24 +157,33 @@ public static DirectoryItem fromXml(XmlReader xmlReader, String rootElementName) String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Directory" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - DirectoryItem deserializedDirectoryItem = new DirectoryItem(); + StringEncoded name = null; + String fileId = null; + FileProperty properties = null; + String attributes = null; + String permissionKey = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Name".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.name = StringEncoded.fromXml(reader, "Name"); + name = StringEncoded.fromXml(reader, "Name"); } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.fileId = reader.getStringElement(); + fileId = reader.getStringElement(); } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.properties = FileProperty.fromXml(reader, "Properties"); + properties = FileProperty.fromXml(reader, "Properties"); } else if ("Attributes".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.attributes = reader.getStringElement(); + attributes = reader.getStringElement(); } else if ("PermissionKey".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.permissionKey = reader.getStringElement(); + permissionKey = reader.getStringElement(); } else { reader.skipElement(); } } + DirectoryItem deserializedDirectoryItem = new DirectoryItem(name); + deserializedDirectoryItem.fileId = fileId; + deserializedDirectoryItem.properties = properties; + deserializedDirectoryItem.attributes = attributes; + deserializedDirectoryItem.permissionKey = permissionKey; return deserializedDirectoryItem; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java index c8338e96372d..27e60beab2c4 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -16,16 +16,16 @@ /** * A listed file item. */ -@Fluent +@Immutable public final class FileItem implements XmlSerializable { /* - * The Name property. + * The file name. */ @Generated - private StringEncoded name; + private final StringEncoded name; /* - * The FileId property. + * The file ID. */ @Generated private String fileId; @@ -34,29 +34,34 @@ public final class FileItem implements XmlSerializable { * File properties. */ @Generated - private FileProperty properties; + private final FileProperty properties; /* - * The Attributes property. + * The file attributes. */ @Generated private String attributes; /* - * The PermissionKey property. + * The permission key. */ @Generated private String permissionKey; /** * Creates an instance of FileItem class. + * + * @param name the name value to set. + * @param properties the properties value to set. */ @Generated - public FileItem() { + private FileItem(StringEncoded name, FileProperty properties) { + this.name = name; + this.properties = properties; } /** - * Get the name property: The Name property. + * Get the name property: The file name. * * @return the name value. */ @@ -66,19 +71,7 @@ public StringEncoded getName() { } /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. + * Get the fileId property: The file ID. * * @return the fileId value. */ @@ -87,18 +80,6 @@ public String getFileId() { return this.fileId; } - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - /** * Get the properties property: File properties. * @@ -110,19 +91,7 @@ public FileProperty getProperties() { } /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the attributes property: The Attributes property. + * Get the attributes property: The file attributes. * * @return the attributes value. */ @@ -132,19 +101,7 @@ public String getAttributes() { } /** - * Set the attributes property: The Attributes property. - * - * @param attributes the attributes value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setAttributes(String attributes) { - this.attributes = attributes; - return this; - } - - /** - * Get the permissionKey property: The PermissionKey property. + * Get the permissionKey property: The permission key. * * @return the permissionKey value. */ @@ -153,18 +110,6 @@ public String getPermissionKey() { return this.permissionKey; } - /** - * Set the permissionKey property: The PermissionKey property. - * - * @param permissionKey the permissionKey value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setPermissionKey(String permissionKey) { - this.permissionKey = permissionKey; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -190,6 +135,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of FileItem if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileItem. */ @Generated @@ -205,30 +151,39 @@ public static FileItem fromXml(XmlReader xmlReader) throws XMLStreamException { * cases where the model can deserialize from different root element names. * @return An instance of FileItem if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileItem. */ @Generated public static FileItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "File" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - FileItem deserializedFileItem = new FileItem(); + StringEncoded name = null; + String fileId = null; + FileProperty properties = null; + String attributes = null; + String permissionKey = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Name".equals(elementName.getLocalPart())) { - deserializedFileItem.name = StringEncoded.fromXml(reader, "Name"); + name = StringEncoded.fromXml(reader, "Name"); } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedFileItem.fileId = reader.getStringElement(); + fileId = reader.getStringElement(); } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedFileItem.properties = FileProperty.fromXml(reader, "Properties"); + properties = FileProperty.fromXml(reader, "Properties"); } else if ("Attributes".equals(elementName.getLocalPart())) { - deserializedFileItem.attributes = reader.getStringElement(); + attributes = reader.getStringElement(); } else if ("PermissionKey".equals(elementName.getLocalPart())) { - deserializedFileItem.permissionKey = reader.getStringElement(); + permissionKey = reader.getStringElement(); } else { reader.skipElement(); } } + FileItem deserializedFileItem = new FileItem(name, properties); + deserializedFileItem.fileId = fileId; + deserializedFileItem.attributes = attributes; + deserializedFileItem.permissionKey = permissionKey; return deserializedFileItem; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java index 7bf07bbc0a4d..4ae98053073d 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.core.util.DateTimeRfc1123; import com.azure.xml.XmlReader; @@ -21,63 +21,68 @@ /** * File properties. */ -@Fluent +@Immutable public final class FileProperty implements XmlSerializable { /* - * Content length of the file. This value may not be up-to-date since an SMB client may have modified the file - * locally. The value of Content-Length may not reflect that fact until the handle is closed or the op-lock is - * broken. To retrieve current property values, call Get File Properties. + * Content length of the file. This value may not be up-to-date since an SMB + * client may have modified the file locally. The value of Content-Length may not + * reflect that fact until the handle is closed or the op-lock is broken. To + * retrieve current property values, call Get File Properties. */ @Generated - private long contentLength; + private final long contentLength; /* - * The CreationTime property. + * The creation time. */ @Generated private OffsetDateTime creationTime; /* - * The LastAccessTime property. + * The last access time. */ @Generated private OffsetDateTime lastAccessTime; /* - * The LastWriteTime property. + * The last write time. */ @Generated private OffsetDateTime lastWriteTime; /* - * The ChangeTime property. + * The change time. */ @Generated private OffsetDateTime changeTime; /* - * The Last-Modified property. + * The last modified time. */ @Generated private DateTimeRfc1123 lastModified; /* - * The Etag property. + * The ETag of the file. */ @Generated - private String etag; + private String eTag; /** * Creates an instance of FileProperty class. + * + * @param contentLength the contentLength value to set. */ @Generated - public FileProperty() { + private FileProperty(long contentLength) { + this.contentLength = contentLength; } /** - * Get the contentLength property: Content length of the file. This value may not be up-to-date since an SMB client - * may have modified the file locally. The value of Content-Length may not reflect that fact until the handle is - * closed or the op-lock is broken. To retrieve current property values, call Get File Properties. + * Get the contentLength property: Content length of the file. This value may not be up-to-date since an SMB + * client may have modified the file locally. The value of Content-Length may not + * reflect that fact until the handle is closed or the op-lock is broken. To + * retrieve current property values, call Get File Properties. * * @return the contentLength value. */ @@ -87,21 +92,7 @@ public long getContentLength() { } /** - * Set the contentLength property: Content length of the file. This value may not be up-to-date since an SMB client - * may have modified the file locally. The value of Content-Length may not reflect that fact until the handle is - * closed or the op-lock is broken. To retrieve current property values, call Get File Properties. - * - * @param contentLength the contentLength value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setContentLength(long contentLength) { - this.contentLength = contentLength; - return this; - } - - /** - * Get the creationTime property: The CreationTime property. + * Get the creationTime property: The creation time. * * @return the creationTime value. */ @@ -111,19 +102,7 @@ public OffsetDateTime getCreationTime() { } /** - * Set the creationTime property: The CreationTime property. - * - * @param creationTime the creationTime value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setCreationTime(OffsetDateTime creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * Get the lastAccessTime property: The LastAccessTime property. + * Get the lastAccessTime property: The last access time. * * @return the lastAccessTime value. */ @@ -133,19 +112,7 @@ public OffsetDateTime getLastAccessTime() { } /** - * Set the lastAccessTime property: The LastAccessTime property. - * - * @param lastAccessTime the lastAccessTime value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setLastAccessTime(OffsetDateTime lastAccessTime) { - this.lastAccessTime = lastAccessTime; - return this; - } - - /** - * Get the lastWriteTime property: The LastWriteTime property. + * Get the lastWriteTime property: The last write time. * * @return the lastWriteTime value. */ @@ -155,19 +122,7 @@ public OffsetDateTime getLastWriteTime() { } /** - * Set the lastWriteTime property: The LastWriteTime property. - * - * @param lastWriteTime the lastWriteTime value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setLastWriteTime(OffsetDateTime lastWriteTime) { - this.lastWriteTime = lastWriteTime; - return this; - } - - /** - * Get the changeTime property: The ChangeTime property. + * Get the changeTime property: The change time. * * @return the changeTime value. */ @@ -177,19 +132,7 @@ public OffsetDateTime getChangeTime() { } /** - * Set the changeTime property: The ChangeTime property. - * - * @param changeTime the changeTime value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setChangeTime(OffsetDateTime changeTime) { - this.changeTime = changeTime; - return this; - } - - /** - * Get the lastModified property: The Last-Modified property. + * Get the lastModified property: The last modified time. * * @return the lastModified value. */ @@ -202,41 +145,13 @@ public OffsetDateTime getLastModified() { } /** - * Set the lastModified property: The Last-Modified property. - * - * @param lastModified the lastModified value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty 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. + * Get the eTag property: The ETag of the file. * - * @param etag the etag value to set. - * @return the FileProperty object itself. + * @return the eTag value. */ @Generated - public FileProperty setEtag(String etag) { - this.etag = etag; - return this; + public String getETag() { + return this.eTag; } @Generated @@ -260,7 +175,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeStringElement("ChangeTime", this.changeTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.changeTime)); xmlWriter.writeStringElement("Last-Modified", Objects.toString(this.lastModified, null)); - xmlWriter.writeStringElement("Etag", this.etag); + xmlWriter.writeStringElement("Etag", this.eTag); return xmlWriter.writeEndElement(); } @@ -270,6 +185,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of FileProperty if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileProperty. */ @Generated @@ -285,6 +201,7 @@ public static FileProperty fromXml(XmlReader xmlReader) throws XMLStreamExceptio * cases where the model can deserialize from different root element names. * @return An instance of FileProperty if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileProperty. */ @Generated @@ -292,32 +209,44 @@ public static FileProperty fromXml(XmlReader xmlReader, String rootElementName) String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "FileProperty" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - FileProperty deserializedFileProperty = new FileProperty(); + long contentLength = 0L; + OffsetDateTime creationTime = null; + OffsetDateTime lastAccessTime = null; + OffsetDateTime lastWriteTime = null; + OffsetDateTime changeTime = null; + DateTimeRfc1123 lastModified = null; + String eTag = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Content-Length".equals(elementName.getLocalPart())) { - deserializedFileProperty.contentLength = reader.getLongElement(); + contentLength = reader.getLongElement(); } else if ("CreationTime".equals(elementName.getLocalPart())) { - deserializedFileProperty.creationTime + creationTime = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("LastAccessTime".equals(elementName.getLocalPart())) { - deserializedFileProperty.lastAccessTime + lastAccessTime = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("LastWriteTime".equals(elementName.getLocalPart())) { - deserializedFileProperty.lastWriteTime + lastWriteTime = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("ChangeTime".equals(elementName.getLocalPart())) { - deserializedFileProperty.changeTime - = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); + changeTime = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("Last-Modified".equals(elementName.getLocalPart())) { - deserializedFileProperty.lastModified = reader.getNullableElement(DateTimeRfc1123::new); + lastModified = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Etag".equals(elementName.getLocalPart())) { - deserializedFileProperty.etag = reader.getStringElement(); + eTag = reader.getStringElement(); } else { reader.skipElement(); } } + FileProperty deserializedFileProperty = new FileProperty(contentLength); + deserializedFileProperty.creationTime = creationTime; + deserializedFileProperty.lastAccessTime = lastAccessTime; + deserializedFileProperty.lastWriteTime = lastWriteTime; + deserializedFileProperty.changeTime = changeTime; + deserializedFileProperty.lastModified = lastModified; + deserializedFileProperty.eTag = eTag; return deserializedFileProperty; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java index db47d0b499b2..14bf552a66ea 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -18,29 +18,34 @@ /** * Abstract for entries that can be listed from Directory. */ -@Fluent +@Immutable public final class FilesAndDirectoriesListSegment implements XmlSerializable { /* - * The DirectoryItems property. + * The directory items. */ @Generated - private List directoryItems = new ArrayList<>(); + private final List directoryItems; /* - * The FileItems property. + * The file items. */ @Generated - private List fileItems = new ArrayList<>(); + private final List fileItems; /** * Creates an instance of FilesAndDirectoriesListSegment class. + * + * @param directoryItems the directoryItems value to set. + * @param fileItems the fileItems value to set. */ @Generated - public FilesAndDirectoriesListSegment() { + private FilesAndDirectoriesListSegment(List directoryItems, List fileItems) { + this.directoryItems = directoryItems; + this.fileItems = fileItems; } /** - * Get the directoryItems property: The DirectoryItems property. + * Get the directoryItems property: The directory items. * * @return the directoryItems value. */ @@ -50,19 +55,7 @@ public List getDirectoryItems() { } /** - * Set the directoryItems property: The DirectoryItems property. - * - * @param directoryItems the directoryItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setDirectoryItems(List directoryItems) { - this.directoryItems = directoryItems; - return this; - } - - /** - * Get the fileItems property: The FileItems property. + * Get the fileItems property: The file items. * * @return the fileItems value. */ @@ -71,18 +64,6 @@ public List getFileItems() { return this.fileItems; } - /** - * Set the fileItems property: The FileItems property. - * - * @param fileItems the fileItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setFileItems(List fileItems) { - this.fileItems = fileItems; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -92,7 +73,8 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Entries" : rootElementName; + rootElementName + = rootElementName == null || rootElementName.isEmpty() ? "FilesAndDirectoriesListSegment" : rootElementName; xmlWriter.writeStartElement(rootElementName); if (this.directoryItems != null) { for (DirectoryItem element : this.directoryItems) { @@ -113,6 +95,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of FilesAndDirectoriesListSegment if the XmlReader was pointing to an instance of it, or null * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FilesAndDirectoriesListSegment. */ @Generated @@ -128,30 +111,35 @@ public static FilesAndDirectoriesListSegment fromXml(XmlReader xmlReader) throws * cases where the model can deserialize from different root element names. * @return An instance of FilesAndDirectoriesListSegment if the XmlReader was pointing to an instance of it, or null * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FilesAndDirectoriesListSegment. */ @Generated public static FilesAndDirectoriesListSegment fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "Entries" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "FilesAndDirectoriesListSegment" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - FilesAndDirectoriesListSegment deserializedFilesAndDirectoriesListSegment - = new FilesAndDirectoriesListSegment(); + List directoryItems = null; + List fileItems = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Directory".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.directoryItems - .add(DirectoryItem.fromXml(reader, "Directory")); + if (directoryItems == null) { + directoryItems = new ArrayList<>(); + } + directoryItems.add(DirectoryItem.fromXml(reader, "Directory")); } else if ("File".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.fileItems.add(FileItem.fromXml(reader, "File")); + if (fileItems == null) { + fileItems = new ArrayList<>(); + } + fileItems.add(FileItem.fromXml(reader, "File")); } else { reader.skipElement(); } } - - return deserializedFilesAndDirectoriesListSegment; + return new FilesAndDirectoriesListSegment(directoryItems, fileItems); }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/HandleItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/HandleItem.java index b2077e8f68c5..cce00424903d 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/HandleItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/HandleItem.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.DateTimeRfc1123; import com.azure.storage.file.share.models.ShareFileHandleAccessRights; import com.azure.xml.XmlReader; @@ -22,25 +22,25 @@ /** * A listed Azure Storage handle item. */ -@Fluent +@Immutable public final class HandleItem implements XmlSerializable { /* * XSMB service handle ID */ @Generated - private String handleId; + private final String handleId; /* - * The Path property. + * The path. */ @Generated - private StringEncoded path; + private final StringEncoded path; /* * FileId uniquely identifies the file or directory. */ @Generated - private String fileId; + private final String fileId; /* * ParentId uniquely identifies the parent directory of the object. @@ -52,25 +52,26 @@ public final class HandleItem implements XmlSerializable { * SMB session ID in context of which the file handle was opened */ @Generated - private String sessionId; + private final String sessionId; /* * Client IP that opened the handle */ @Generated - private String clientIp; + private final String clientIp; /* * Name of the client machine where the share is being mounted */ @Generated - private String clientName; + private final String clientName; /* - * Time when the session that previously opened the handle has last been reconnected. (UTC) + * Time when the session that previously opened the handle has last been + * reconnected. (UTC) */ @Generated - private DateTimeRfc1123 openTime; + private final DateTimeRfc1123 openTime; /* * Time handle was last connected to (UTC) @@ -79,16 +80,36 @@ public final class HandleItem implements XmlSerializable { private DateTimeRfc1123 lastReconnectTime; /* - * The AccessRightList property. + * The access rights. */ @Generated private List accessRightList; /** * Creates an instance of HandleItem class. + * + * @param handleId the handleId value to set. + * @param path the path value to set. + * @param fileId the fileId value to set. + * @param sessionId the sessionId value to set. + * @param clientIp the clientIp value to set. + * @param clientName the clientName value to set. + * @param openTime the openTime value to set. */ @Generated - public HandleItem() { + private HandleItem(String handleId, StringEncoded path, String fileId, String sessionId, String clientIp, + String clientName, OffsetDateTime openTime) { + this.handleId = handleId; + this.path = path; + this.fileId = fileId; + this.sessionId = sessionId; + this.clientIp = clientIp; + this.clientName = clientName; + if (openTime == null) { + this.openTime = null; + } else { + this.openTime = new DateTimeRfc1123(openTime); + } } /** @@ -102,19 +123,7 @@ public String getHandleId() { } /** - * Set the handleId property: XSMB service handle ID. - * - * @param handleId the handleId value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setHandleId(String handleId) { - this.handleId = handleId; - return this; - } - - /** - * Get the path property: The Path property. + * Get the path property: The path. * * @return the path value. */ @@ -123,18 +132,6 @@ public StringEncoded getPath() { return this.path; } - /** - * Set the path property: The Path property. - * - * @param path the path value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setPath(StringEncoded path) { - this.path = path; - return this; - } - /** * Get the fileId property: FileId uniquely identifies the file or directory. * @@ -145,18 +142,6 @@ public String getFileId() { return this.fileId; } - /** - * Set the fileId property: FileId uniquely identifies the file or directory. - * - * @param fileId the fileId value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - /** * Get the parentId property: ParentId uniquely identifies the parent directory of the object. * @@ -167,18 +152,6 @@ public String getParentId() { return this.parentId; } - /** - * Set the parentId property: ParentId uniquely identifies the parent directory of the object. - * - * @param parentId the parentId value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setParentId(String parentId) { - this.parentId = parentId; - return this; - } - /** * Get the sessionId property: SMB session ID in context of which the file handle was opened. * @@ -189,18 +162,6 @@ public String getSessionId() { return this.sessionId; } - /** - * Set the sessionId property: SMB session ID in context of which the file handle was opened. - * - * @param sessionId the sessionId value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setSessionId(String sessionId) { - this.sessionId = sessionId; - return this; - } - /** * Get the clientIp property: Client IP that opened the handle. * @@ -211,18 +172,6 @@ public String getClientIp() { return this.clientIp; } - /** - * Set the clientIp property: Client IP that opened the handle. - * - * @param clientIp the clientIp value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setClientIp(String clientIp) { - this.clientIp = clientIp; - return this; - } - /** * Get the clientName property: Name of the client machine where the share is being mounted. * @@ -234,20 +183,8 @@ public String getClientName() { } /** - * Set the clientName property: Name of the client machine where the share is being mounted. - * - * @param clientName the clientName value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setClientName(String clientName) { - this.clientName = clientName; - return this; - } - - /** - * Get the openTime property: Time when the session that previously opened the handle has last been reconnected. - * (UTC). + * Get the openTime property: Time when the session that previously opened the handle has last been + * reconnected. (UTC). * * @return the openTime value. */ @@ -259,23 +196,6 @@ public OffsetDateTime getOpenTime() { return this.openTime.getDateTime(); } - /** - * Set the openTime property: Time when the session that previously opened the handle has last been reconnected. - * (UTC). - * - * @param openTime the openTime value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setOpenTime(OffsetDateTime openTime) { - if (openTime == null) { - this.openTime = null; - } else { - this.openTime = new DateTimeRfc1123(openTime); - } - return this; - } - /** * Get the lastReconnectTime property: Time handle was last connected to (UTC). * @@ -290,23 +210,7 @@ public OffsetDateTime getLastReconnectTime() { } /** - * Set the lastReconnectTime property: Time handle was last connected to (UTC). - * - * @param lastReconnectTime the lastReconnectTime value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setLastReconnectTime(OffsetDateTime lastReconnectTime) { - if (lastReconnectTime == null) { - this.lastReconnectTime = null; - } else { - this.lastReconnectTime = new DateTimeRfc1123(lastReconnectTime); - } - return this; - } - - /** - * Get the accessRightList property: The AccessRightList property. + * Get the accessRightList property: The access rights. * * @return the accessRightList value. */ @@ -318,18 +222,6 @@ public List getAccessRightList() { return this.accessRightList; } - /** - * Set the accessRightList property: The AccessRightList property. - * - * @param accessRightList the accessRightList value to set. - * @return the HandleItem object itself. - */ - @Generated - public HandleItem setAccessRightList(List accessRightList) { - this.accessRightList = accessRightList; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -366,6 +258,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of HandleItem if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the HandleItem. */ @Generated @@ -381,43 +274,55 @@ public static HandleItem fromXml(XmlReader xmlReader) throws XMLStreamException * cases where the model can deserialize from different root element names. * @return An instance of HandleItem if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the HandleItem. */ @Generated public static HandleItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Handle" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - HandleItem deserializedHandleItem = new HandleItem(); + String handleId = null; + StringEncoded path = null; + String fileId = null; + String parentId = null; + String sessionId = null; + String clientIp = null; + String clientName = null; + OffsetDateTime openTime = null; + DateTimeRfc1123 lastReconnectTime = null; + List accessRightList = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("HandleId".equals(elementName.getLocalPart())) { - deserializedHandleItem.handleId = reader.getStringElement(); + handleId = reader.getStringElement(); } else if ("Path".equals(elementName.getLocalPart())) { - deserializedHandleItem.path = StringEncoded.fromXml(reader, "Path"); + path = StringEncoded.fromXml(reader, "Path"); } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedHandleItem.fileId = reader.getStringElement(); + fileId = reader.getStringElement(); } else if ("ParentId".equals(elementName.getLocalPart())) { - deserializedHandleItem.parentId = reader.getStringElement(); + parentId = reader.getStringElement(); } else if ("SessionId".equals(elementName.getLocalPart())) { - deserializedHandleItem.sessionId = reader.getStringElement(); + sessionId = reader.getStringElement(); } else if ("ClientIp".equals(elementName.getLocalPart())) { - deserializedHandleItem.clientIp = reader.getStringElement(); + clientIp = reader.getStringElement(); } else if ("ClientName".equals(elementName.getLocalPart())) { - deserializedHandleItem.clientName = reader.getStringElement(); + clientName = reader.getStringElement(); } else if ("OpenTime".equals(elementName.getLocalPart())) { - deserializedHandleItem.openTime = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 openTimeHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (openTimeHolder != null) { + openTime = openTimeHolder.getDateTime(); + } } else if ("LastReconnectTime".equals(elementName.getLocalPart())) { - deserializedHandleItem.lastReconnectTime = reader.getNullableElement(DateTimeRfc1123::new); + lastReconnectTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("AccessRightList".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { elementName = reader.getElementName(); if ("AccessRight".equals(elementName.getLocalPart())) { - if (deserializedHandleItem.accessRightList == null) { - deserializedHandleItem.accessRightList = new ArrayList<>(); + if (accessRightList == null) { + accessRightList = new ArrayList<>(); } - deserializedHandleItem.accessRightList - .add(ShareFileHandleAccessRights.fromString(reader.getStringElement())); + accessRightList.add(ShareFileHandleAccessRights.fromString(reader.getStringElement())); } else { reader.skipElement(); } @@ -426,6 +331,11 @@ public static HandleItem fromXml(XmlReader xmlReader, String rootElementName) th reader.skipElement(); } } + HandleItem deserializedHandleItem + = new HandleItem(handleId, path, fileId, sessionId, clientIp, clientName, openTime); + deserializedHandleItem.parentId = parentId; + deserializedHandleItem.lastReconnectTime = lastReconnectTime; + deserializedHandleItem.accessRightList = accessRightList; return deserializedHandleItem; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/KeyInfo.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/KeyInfo.java index 9f8c17da76c5..feb84be0c907 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/KeyInfo.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/KeyInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; @@ -28,7 +28,7 @@ public final class KeyInfo implements XmlSerializable { * The date-time the key expires in ISO 8601 UTC time */ @Generated - private String expiry; + private final String expiry; /* * The delegated user tenant id in Azure AD @@ -38,9 +38,12 @@ public final class KeyInfo implements XmlSerializable { /** * Creates an instance of KeyInfo class. + * + * @param expiry the expiry value to set. */ @Generated - public KeyInfo() { + public KeyInfo(String expiry) { + this.expiry = expiry; } /** @@ -75,18 +78,6 @@ public String getExpiry() { return this.expiry; } - /** - * Set the expiry property: The date-time the key expires in ISO 8601 UTC time. - * - * @param expiry the expiry value to set. - * @return the KeyInfo object itself. - */ - @Generated - public KeyInfo setExpiry(String expiry) { - this.expiry = expiry; - return this; - } - /** * Get the delegatedUserTenantId property: The delegated user tenant id in Azure AD. * @@ -132,6 +123,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of KeyInfo if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the KeyInfo. */ @Generated @@ -147,6 +139,7 @@ public static KeyInfo fromXml(XmlReader xmlReader) throws XMLStreamException { * cases where the model can deserialize from different root element names. * @return An instance of KeyInfo if the XmlReader was pointing to an instance of it, or null if it was pointing to * XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the KeyInfo. */ @Generated @@ -154,20 +147,25 @@ public static KeyInfo fromXml(XmlReader xmlReader, String rootElementName) throw String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "KeyInfo" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - KeyInfo deserializedKeyInfo = new KeyInfo(); + String start = null; + String expiry = null; + String delegatedUserTenantId = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Start".equals(elementName.getLocalPart())) { - deserializedKeyInfo.start = reader.getStringElement(); + start = reader.getStringElement(); } else if ("Expiry".equals(elementName.getLocalPart())) { - deserializedKeyInfo.expiry = reader.getStringElement(); + expiry = reader.getStringElement(); } else if ("DelegatedUserTid".equals(elementName.getLocalPart())) { - deserializedKeyInfo.delegatedUserTenantId = reader.getStringElement(); + delegatedUserTenantId = reader.getStringElement(); } else { reader.skipElement(); } } + KeyInfo deserializedKeyInfo = new KeyInfo(expiry); + deserializedKeyInfo.start = start; + deserializedKeyInfo.delegatedUserTenantId = delegatedUserTenantId; return deserializedKeyInfo; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesAndDirectoriesSegmentResponse.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesAndDirectoriesSegmentResponse.java index b35802e502a8..4f5aa76cfef1 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesAndDirectoriesSegmentResponse.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesAndDirectoriesSegmentResponse.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -16,53 +16,53 @@ /** * An enumeration of directories and files. */ -@Fluent +@Immutable public final class ListFilesAndDirectoriesSegmentResponse implements XmlSerializable { /* - * The ServiceEndpoint property. + * The service endpoint. */ @Generated - private String serviceEndpoint; + private final String serviceEndpoint; /* - * The ShareName property. + * The share name. */ @Generated - private String shareName; + private final String shareName; /* - * The ShareSnapshot property. + * The share snapshot. */ @Generated private String shareSnapshot; /* - * The Encoded property. + * Whether the listing is encoded. */ @Generated private Boolean encoded; /* - * The DirectoryPath property. + * The directory path. */ @Generated - private String directoryPath; + private final String directoryPath; /* - * The Prefix property. + * The prefix. */ @Generated - private StringEncoded prefix; + private final StringEncoded prefix; /* - * The Marker property. + * The marker. */ @Generated private String marker; /* - * The MaxResults property. + * The max results. */ @Generated private Integer maxResults; @@ -71,29 +71,43 @@ public final class ListFilesAndDirectoriesSegmentResponse * Abstract for entries that can be listed from Directory. */ @Generated - private FilesAndDirectoriesListSegment segment; + private final FilesAndDirectoriesListSegment segment; /* - * The NextMarker property. + * The next marker. */ @Generated - private String nextMarker; + private final String nextMarker; /* - * The DirectoryId property. + * The directory ID. */ @Generated private String directoryId; /** * Creates an instance of ListFilesAndDirectoriesSegmentResponse class. + * + * @param serviceEndpoint the serviceEndpoint value to set. + * @param shareName the shareName value to set. + * @param directoryPath the directoryPath value to set. + * @param prefix the prefix value to set. + * @param segment the segment value to set. + * @param nextMarker the nextMarker value to set. */ @Generated - public ListFilesAndDirectoriesSegmentResponse() { + private ListFilesAndDirectoriesSegmentResponse(String serviceEndpoint, String shareName, String directoryPath, + StringEncoded prefix, FilesAndDirectoriesListSegment segment, String nextMarker) { + this.serviceEndpoint = serviceEndpoint; + this.shareName = shareName; + this.directoryPath = directoryPath; + this.prefix = prefix; + this.segment = segment; + this.nextMarker = nextMarker; } /** - * Get the serviceEndpoint property: The ServiceEndpoint property. + * Get the serviceEndpoint property: The service endpoint. * * @return the serviceEndpoint value. */ @@ -103,19 +117,7 @@ public String getServiceEndpoint() { } /** - * Set the serviceEndpoint property: The ServiceEndpoint property. - * - * @param serviceEndpoint the serviceEndpoint value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setServiceEndpoint(String serviceEndpoint) { - this.serviceEndpoint = serviceEndpoint; - return this; - } - - /** - * Get the shareName property: The ShareName property. + * Get the shareName property: The share name. * * @return the shareName value. */ @@ -125,19 +127,7 @@ public String getShareName() { } /** - * Set the shareName property: The ShareName property. - * - * @param shareName the shareName value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setShareName(String shareName) { - this.shareName = shareName; - return this; - } - - /** - * Get the shareSnapshot property: The ShareSnapshot property. + * Get the shareSnapshot property: The share snapshot. * * @return the shareSnapshot value. */ @@ -147,19 +137,7 @@ public String getShareSnapshot() { } /** - * Set the shareSnapshot property: The ShareSnapshot property. - * - * @param shareSnapshot the shareSnapshot value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setShareSnapshot(String shareSnapshot) { - this.shareSnapshot = shareSnapshot; - return this; - } - - /** - * Get the encoded property: The Encoded property. + * Get the encoded property: Whether the listing is encoded. * * @return the encoded value. */ @@ -169,19 +147,7 @@ public Boolean isEncoded() { } /** - * Set the encoded property: The Encoded property. - * - * @param encoded the encoded value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setEncoded(Boolean encoded) { - this.encoded = encoded; - return this; - } - - /** - * Get the directoryPath property: The DirectoryPath property. + * Get the directoryPath property: The directory path. * * @return the directoryPath value. */ @@ -191,19 +157,7 @@ public String getDirectoryPath() { } /** - * Set the directoryPath property: The DirectoryPath property. - * - * @param directoryPath the directoryPath value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setDirectoryPath(String directoryPath) { - this.directoryPath = directoryPath; - return this; - } - - /** - * Get the prefix property: The Prefix property. + * Get the prefix property: The prefix. * * @return the prefix value. */ @@ -213,19 +167,7 @@ public StringEncoded getPrefix() { } /** - * Set the prefix property: The Prefix property. - * - * @param prefix the prefix value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setPrefix(StringEncoded prefix) { - this.prefix = prefix; - return this; - } - - /** - * Get the marker property: The Marker property. + * Get the marker property: The marker. * * @return the marker value. */ @@ -235,19 +177,7 @@ public String getMarker() { } /** - * Set the marker property: The Marker property. - * - * @param marker the marker value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setMarker(String marker) { - this.marker = marker; - return this; - } - - /** - * Get the maxResults property: The MaxResults property. + * Get the maxResults property: The max results. * * @return the maxResults value. */ @@ -256,18 +186,6 @@ public Integer getMaxResults() { return this.maxResults; } - /** - * Set the maxResults property: The MaxResults property. - * - * @param maxResults the maxResults value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setMaxResults(Integer maxResults) { - this.maxResults = maxResults; - return this; - } - /** * Get the segment property: Abstract for entries that can be listed from Directory. * @@ -279,19 +197,7 @@ public FilesAndDirectoriesListSegment getSegment() { } /** - * Set the segment property: Abstract for entries that can be listed from Directory. - * - * @param segment the segment value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setSegment(FilesAndDirectoriesListSegment segment) { - this.segment = segment; - return this; - } - - /** - * Get the nextMarker property: The NextMarker property. + * Get the nextMarker property: The next marker. * * @return the nextMarker value. */ @@ -301,19 +207,7 @@ public String getNextMarker() { } /** - * Set the nextMarker property: The NextMarker property. - * - * @param nextMarker the nextMarker value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setNextMarker(String nextMarker) { - this.nextMarker = nextMarker; - return this; - } - - /** - * Get the directoryId property: The DirectoryId property. + * Get the directoryId property: The directory ID. * * @return the directoryId value. */ @@ -322,18 +216,6 @@ public String getDirectoryId() { return this.directoryId; } - /** - * Set the directoryId property: The DirectoryId property. - * - * @param directoryId the directoryId value to set. - * @return the ListFilesAndDirectoriesSegmentResponse object itself. - */ - @Generated - public ListFilesAndDirectoriesSegmentResponse setDirectoryId(String directoryId) { - this.directoryId = directoryId; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -365,6 +247,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of ListFilesAndDirectoriesSegmentResponse if the XmlReader was pointing to an instance of it, * or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ListFilesAndDirectoriesSegmentResponse. */ @Generated @@ -380,6 +263,7 @@ public static ListFilesAndDirectoriesSegmentResponse fromXml(XmlReader xmlReader * cases where the model can deserialize from different root element names. * @return An instance of ListFilesAndDirectoriesSegmentResponse if the XmlReader was pointing to an instance of it, * or null if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ListFilesAndDirectoriesSegmentResponse. */ @Generated @@ -388,38 +272,44 @@ public static ListFilesAndDirectoriesSegmentResponse fromXml(XmlReader xmlReader String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "EnumerationResults" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ListFilesAndDirectoriesSegmentResponse deserializedListFilesAndDirectoriesSegmentResponse - = new ListFilesAndDirectoriesSegmentResponse(); - deserializedListFilesAndDirectoriesSegmentResponse.serviceEndpoint - = reader.getStringAttribute(null, "ServiceEndpoint"); - deserializedListFilesAndDirectoriesSegmentResponse.shareName = reader.getStringAttribute(null, "ShareName"); - deserializedListFilesAndDirectoriesSegmentResponse.shareSnapshot - = reader.getStringAttribute(null, "ShareSnapshot"); - deserializedListFilesAndDirectoriesSegmentResponse.encoded - = reader.getNullableAttribute(null, "Encoded", Boolean::parseBoolean); - deserializedListFilesAndDirectoriesSegmentResponse.directoryPath - = reader.getStringAttribute(null, "DirectoryPath"); + StringEncoded prefix = null; + String marker = null; + Integer maxResults = null; + FilesAndDirectoriesListSegment segment = null; + String nextMarker = null; + String directoryId = null; + String serviceEndpoint = reader.getStringAttribute(null, "ServiceEndpoint"); + String shareName = reader.getStringAttribute(null, "ShareName"); + String shareSnapshot = reader.getStringAttribute(null, "ShareSnapshot"); + Boolean encoded = reader.getNullableAttribute(null, "Encoded", Boolean::parseBoolean); + String directoryPath = reader.getStringAttribute(null, "DirectoryPath"); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Prefix".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.prefix = StringEncoded.fromXml(reader, "Prefix"); + prefix = StringEncoded.fromXml(reader, "Prefix"); } else if ("Marker".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.marker = reader.getStringElement(); + marker = reader.getStringElement(); } else if ("MaxResults".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.maxResults - = reader.getNullableElement(Integer::parseInt); + maxResults = reader.getNullableElement(Integer::parseInt); } else if ("Entries".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.segment - = FilesAndDirectoriesListSegment.fromXml(reader, "Entries"); + segment = FilesAndDirectoriesListSegment.fromXml(reader, "Entries"); } else if ("NextMarker".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.nextMarker = reader.getStringElement(); + nextMarker = reader.getStringElement(); } else if ("DirectoryId".equals(elementName.getLocalPart())) { - deserializedListFilesAndDirectoriesSegmentResponse.directoryId = reader.getStringElement(); + directoryId = reader.getStringElement(); } else { reader.skipElement(); } } + ListFilesAndDirectoriesSegmentResponse deserializedListFilesAndDirectoriesSegmentResponse + = new ListFilesAndDirectoriesSegmentResponse(serviceEndpoint, shareName, directoryPath, prefix, segment, + nextMarker); + deserializedListFilesAndDirectoriesSegmentResponse.shareSnapshot = shareSnapshot; + deserializedListFilesAndDirectoriesSegmentResponse.encoded = encoded; + deserializedListFilesAndDirectoriesSegmentResponse.marker = marker; + deserializedListFilesAndDirectoriesSegmentResponse.maxResults = maxResults; + deserializedListFilesAndDirectoriesSegmentResponse.directoryId = directoryId; return deserializedListFilesAndDirectoriesSegmentResponse; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java index 183e5958cebb..aaade8e50502 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java @@ -1,30 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; /** - * Defines values for ListFilesIncludeType. + * The type of file information to include in the listing. */ public enum ListFilesIncludeType { /** - * Enum value Timestamps. + * Timestamps. */ TIMESTAMPS("Timestamps"), /** - * Enum value Etag. + * Etag. */ ETAG("Etag"), /** - * Enum value Attributes. + * Attributes. */ ATTRIBUTES("Attributes"), /** - * Enum value PermissionKey. + * PermissionKey. */ PERMISSION_KEY("PermissionKey"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListSharesIncludeType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListSharesIncludeType.java index 7f0c639c4d57..0f1c837c88af 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListSharesIncludeType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListSharesIncludeType.java @@ -1,25 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; /** - * Defines values for ListSharesIncludeType. + * The type of share information to include in the listing. */ public enum ListSharesIncludeType { /** - * Enum value snapshots. + * snapshots. */ SNAPSHOTS("snapshots"), /** - * Enum value metadata. + * metadata. */ METADATA("metadata"), /** - * Enum value deleted. + * deleted. */ DELETED("deleted"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteFromUrlType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteFromUrlType.java new file mode 100644 index 000000000000..9f6d8327d669 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteFromUrlType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.storage.file.share.implementation.models; + +/** + * Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. + */ +public enum ShareFileRangeWriteFromUrlType { + /** + * Writes the bytes specified by the source URL into the specified range. + */ + UPDATE("update"); + + /** + * The actual serialized value for a ShareFileRangeWriteFromUrlType instance. + */ + private final String value; + + ShareFileRangeWriteFromUrlType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ShareFileRangeWriteFromUrlType instance. + * + * @param value the serialized value to parse. + * @return the parsed ShareFileRangeWriteFromUrlType object, or null if unable to parse. + */ + public static ShareFileRangeWriteFromUrlType fromString(String value) { + if (value == null) { + return null; + } + ShareFileRangeWriteFromUrlType[] items = ShareFileRangeWriteFromUrlType.values(); + for (ShareFileRangeWriteFromUrlType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteType.java index 8578835707de..dc488a7b9fee 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteType.java @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; /** - * Defines values for ShareFileRangeWriteType. + * Specify one of the following options: - Update: Writes the bytes specified by the request body into the specified + * range. - Clear: Clears the specified range and releases the space used in storage for that range. */ public enum ShareFileRangeWriteType { /** - * Enum value update. + * Writes the bytes specified by the request body into the specified range. */ UPDATE("update"), /** - * Enum value clear. + * Clears the specified range and releases the space used in storage for that range. */ CLEAR("clear"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareItemInternal.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareItemInternal.java index 251fad989940..0ee19a8742ea 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareItemInternal.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareItemInternal.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -18,28 +18,28 @@ /** * A listed Azure Storage share item. */ -@Fluent +@Immutable public final class ShareItemInternal implements XmlSerializable { /* - * The Name property. + * The share name. */ @Generated - private String name; + private final String name; /* - * The Snapshot property. + * The share snapshot. */ @Generated private String snapshot; /* - * The Deleted property. + * Whether the share is deleted. */ @Generated private Boolean deleted; /* - * The Version property. + * The share version. */ @Generated private String version; @@ -48,7 +48,7 @@ public final class ShareItemInternal implements XmlSerializable @@ -58,13 +58,18 @@ public final class ShareItemInternal implements XmlSerializable getMetadata() { return this.metadata; } - /** - * Set the metadata property: Dictionary of <string>. - * - * @param metadata the metadata value to set. - * @return the ShareItemInternal object itself. - */ - @Generated - public ShareItemInternal setMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -227,6 +160,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of ShareItemInternal if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareItemInternal. */ @Generated @@ -242,38 +176,48 @@ public static ShareItemInternal fromXml(XmlReader xmlReader) throws XMLStreamExc * cases where the model can deserialize from different root element names. * @return An instance of ShareItemInternal if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareItemInternal. */ @Generated public static ShareItemInternal fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Share" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ShareItemInternal deserializedShareItemInternal = new ShareItemInternal(); + String name = null; + String snapshot = null; + Boolean deleted = null; + String version = null; + SharePropertiesInternal properties = null; + Map metadata = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Name".equals(elementName.getLocalPart())) { - deserializedShareItemInternal.name = reader.getStringElement(); + name = reader.getStringElement(); } else if ("Snapshot".equals(elementName.getLocalPart())) { - deserializedShareItemInternal.snapshot = reader.getStringElement(); + snapshot = reader.getStringElement(); } else if ("Deleted".equals(elementName.getLocalPart())) { - deserializedShareItemInternal.deleted = reader.getNullableElement(Boolean::parseBoolean); + deleted = reader.getNullableElement(Boolean::parseBoolean); } else if ("Version".equals(elementName.getLocalPart())) { - deserializedShareItemInternal.version = reader.getStringElement(); + version = reader.getStringElement(); } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedShareItemInternal.properties = SharePropertiesInternal.fromXml(reader, "Properties"); + properties = SharePropertiesInternal.fromXml(reader, "Properties"); } else if ("Metadata".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { - if (deserializedShareItemInternal.metadata == null) { - deserializedShareItemInternal.metadata = new LinkedHashMap<>(); + if (metadata == null) { + metadata = new LinkedHashMap<>(); } - deserializedShareItemInternal.metadata.put(reader.getElementName().getLocalPart(), - reader.getStringElement()); + metadata.put(reader.getElementName().getLocalPart(), reader.getStringElement()); } } else { reader.skipElement(); } } + ShareItemInternal deserializedShareItemInternal = new ShareItemInternal(name, properties); + deserializedShareItemInternal.snapshot = snapshot; + deserializedShareItemInternal.deleted = deleted; + deserializedShareItemInternal.version = version; + deserializedShareItemInternal.metadata = metadata; return deserializedShareItemInternal; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePermission.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePermission.java index 3ff783c96742..3e6c057e9408 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePermission.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePermission.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; @@ -22,19 +22,22 @@ public final class SharePermission implements JsonSerializable * The permission in the Security Descriptor Definition Language (SDDL). */ @Generated - private String permission; + private final String permission; /* - * The format property. + * The permission format. */ @Generated private FilePermissionFormat format; /** * Creates an instance of SharePermission class. + * + * @param permission the permission value to set. */ @Generated - public SharePermission() { + public SharePermission(String permission) { + this.permission = permission; } /** @@ -48,19 +51,7 @@ public String getPermission() { } /** - * Set the permission property: The permission in the Security Descriptor Definition Language (SDDL). - * - * @param permission the permission value to set. - * @return the SharePermission object itself. - */ - @Generated - public SharePermission setPermission(String permission) { - this.permission = permission; - return this; - } - - /** - * Get the format property: The format property. + * Get the format property: The permission format. * * @return the format value. */ @@ -70,7 +61,7 @@ public FilePermissionFormat getFormat() { } /** - * Set the format property: The format property. + * Set the format property: The permission format. * * @param format the format value to set. * @return the SharePermission object itself. @@ -105,19 +96,22 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static SharePermission fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - SharePermission deserializedSharePermission = new SharePermission(); + String permission = null; + FilePermissionFormat format = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("permission".equals(fieldName)) { - deserializedSharePermission.permission = reader.getString(); + permission = reader.getString(); } else if ("format".equals(fieldName)) { - deserializedSharePermission.format = FilePermissionFormat.fromString(reader.getString()); + format = FilePermissionFormat.fromString(reader.getString()); } else { reader.skipChildren(); } } + SharePermission deserializedSharePermission = new SharePermission(permission); + deserializedSharePermission.format = format; return deserializedSharePermission; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java index b59ff963df07..bfeefd12e42f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.core.util.DateTimeRfc1123; import com.azure.storage.file.share.models.LeaseDurationType; import com.azure.storage.file.share.models.LeaseStateType; @@ -16,8 +16,6 @@ import com.azure.xml.XmlToken; import com.azure.xml.XmlWriter; import java.time.OffsetDateTime; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.Objects; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; @@ -25,82 +23,82 @@ /** * Properties of a share. */ -@Fluent +@Immutable public final class SharePropertiesInternal implements XmlSerializable { /* - * The Last-Modified property. + * The last modified time. */ @Generated - private DateTimeRfc1123 lastModified; + private final DateTimeRfc1123 lastModified; /* - * The Etag property. + * The ETag of the share. */ @Generated - private String eTag; + private final String eTag; /* - * The Quota property. + * The share quota. */ @Generated - private int quota; + private final int quota; /* - * The ProvisionedIops property. + * The provisioned IOPS. */ @Generated private Integer provisionedIops; /* - * The ProvisionedIngressMBps property. + * The provisioned ingress in MBps. */ @Generated private Integer provisionedIngressMBps; /* - * The ProvisionedEgressMBps property. + * The provisioned egress in MBps. */ @Generated private Integer provisionedEgressMBps; /* - * The ProvisionedBandwidthMiBps property. + * The provisioned bandwidth in MiBps. */ @Generated private Integer provisionedBandwidthMiBps; /* - * The NextAllowedQuotaDowngradeTime property. + * The next allowed quota downgrade time. */ @Generated private DateTimeRfc1123 nextAllowedQuotaDowngradeTime; /* - * The DeletedTime property. + * The deleted time. */ @Generated private DateTimeRfc1123 deletedTime; /* - * The RemainingRetentionDays property. + * The remaining retention days. */ @Generated private Integer remainingRetentionDays; /* - * The AccessTier property. + * The access tier. */ @Generated private String accessTier; /* - * The AccessTierChangeTime property. + * The access tier change time. */ @Generated private DateTimeRfc1123 accessTierChangeTime; /* - * The AccessTierTransitionState property. + * The access tier transition state. */ @Generated private String accessTierTransitionState; @@ -118,92 +116,98 @@ public final class SharePropertiesInternal implements XmlSerializable - */ - @Generated - private Map metadata; - /** * Creates an instance of SharePropertiesInternal class. + * + * @param lastModified the lastModified value to set. + * @param eTag the eTag value to set. + * @param quota the quota value to set. */ @Generated - public SharePropertiesInternal() { + private SharePropertiesInternal(OffsetDateTime lastModified, String eTag, int quota) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + this.eTag = eTag; + this.quota = quota; } /** - * Get the lastModified property: The Last-Modified property. + * Get the lastModified property: The last modified time. * * @return the lastModified value. */ @@ -216,23 +220,7 @@ public OffsetDateTime getLastModified() { } /** - * Set the lastModified property: The Last-Modified property. - * - * @param lastModified the lastModified value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setLastModified(OffsetDateTime lastModified) { - if (lastModified == null) { - this.lastModified = null; - } else { - this.lastModified = new DateTimeRfc1123(lastModified); - } - return this; - } - - /** - * Get the eTag property: The Etag property. + * Get the eTag property: The ETag of the share. * * @return the eTag value. */ @@ -242,19 +230,7 @@ public String getETag() { } /** - * Set the eTag property: The Etag property. - * - * @param eTag the eTag value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the quota property: The Quota property. + * Get the quota property: The share quota. * * @return the quota value. */ @@ -264,19 +240,7 @@ public int getQuota() { } /** - * Set the quota property: The Quota property. - * - * @param quota the quota value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setQuota(int quota) { - this.quota = quota; - return this; - } - - /** - * Get the provisionedIops property: The ProvisionedIops property. + * Get the provisionedIops property: The provisioned IOPS. * * @return the provisionedIops value. */ @@ -286,19 +250,7 @@ public Integer getProvisionedIops() { } /** - * Set the provisionedIops property: The ProvisionedIops property. - * - * @param provisionedIops the provisionedIops value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setProvisionedIops(Integer provisionedIops) { - this.provisionedIops = provisionedIops; - return this; - } - - /** - * Get the provisionedIngressMBps property: The ProvisionedIngressMBps property. + * Get the provisionedIngressMBps property: The provisioned ingress in MBps. * * @return the provisionedIngressMBps value. */ @@ -308,19 +260,7 @@ public Integer getProvisionedIngressMBps() { } /** - * Set the provisionedIngressMBps property: The ProvisionedIngressMBps property. - * - * @param provisionedIngressMBps the provisionedIngressMBps value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setProvisionedIngressMBps(Integer provisionedIngressMBps) { - this.provisionedIngressMBps = provisionedIngressMBps; - return this; - } - - /** - * Get the provisionedEgressMBps property: The ProvisionedEgressMBps property. + * Get the provisionedEgressMBps property: The provisioned egress in MBps. * * @return the provisionedEgressMBps value. */ @@ -330,19 +270,7 @@ public Integer getProvisionedEgressMBps() { } /** - * Set the provisionedEgressMBps property: The ProvisionedEgressMBps property. - * - * @param provisionedEgressMBps the provisionedEgressMBps value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setProvisionedEgressMBps(Integer provisionedEgressMBps) { - this.provisionedEgressMBps = provisionedEgressMBps; - return this; - } - - /** - * Get the provisionedBandwidthMiBps property: The ProvisionedBandwidthMiBps property. + * Get the provisionedBandwidthMiBps property: The provisioned bandwidth in MiBps. * * @return the provisionedBandwidthMiBps value. */ @@ -352,19 +280,7 @@ public Integer getProvisionedBandwidthMiBps() { } /** - * Set the provisionedBandwidthMiBps property: The ProvisionedBandwidthMiBps property. - * - * @param provisionedBandwidthMiBps the provisionedBandwidthMiBps value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setProvisionedBandwidthMiBps(Integer provisionedBandwidthMiBps) { - this.provisionedBandwidthMiBps = provisionedBandwidthMiBps; - return this; - } - - /** - * Get the nextAllowedQuotaDowngradeTime property: The NextAllowedQuotaDowngradeTime property. + * Get the nextAllowedQuotaDowngradeTime property: The next allowed quota downgrade time. * * @return the nextAllowedQuotaDowngradeTime value. */ @@ -377,23 +293,7 @@ public OffsetDateTime getNextAllowedQuotaDowngradeTime() { } /** - * Set the nextAllowedQuotaDowngradeTime property: The NextAllowedQuotaDowngradeTime property. - * - * @param nextAllowedQuotaDowngradeTime the nextAllowedQuotaDowngradeTime value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setNextAllowedQuotaDowngradeTime(OffsetDateTime nextAllowedQuotaDowngradeTime) { - if (nextAllowedQuotaDowngradeTime == null) { - this.nextAllowedQuotaDowngradeTime = null; - } else { - this.nextAllowedQuotaDowngradeTime = new DateTimeRfc1123(nextAllowedQuotaDowngradeTime); - } - return this; - } - - /** - * Get the deletedTime property: The DeletedTime property. + * Get the deletedTime property: The deleted time. * * @return the deletedTime value. */ @@ -406,23 +306,7 @@ public OffsetDateTime getDeletedTime() { } /** - * Set the deletedTime property: The DeletedTime property. - * - * @param deletedTime the deletedTime value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setDeletedTime(OffsetDateTime deletedTime) { - if (deletedTime == null) { - this.deletedTime = null; - } else { - this.deletedTime = new DateTimeRfc1123(deletedTime); - } - return this; - } - - /** - * Get the remainingRetentionDays property: The RemainingRetentionDays property. + * Get the remainingRetentionDays property: The remaining retention days. * * @return the remainingRetentionDays value. */ @@ -432,19 +316,7 @@ public Integer getRemainingRetentionDays() { } /** - * Set the remainingRetentionDays property: The RemainingRetentionDays property. - * - * @param remainingRetentionDays the remainingRetentionDays value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setRemainingRetentionDays(Integer remainingRetentionDays) { - this.remainingRetentionDays = remainingRetentionDays; - return this; - } - - /** - * Get the accessTier property: The AccessTier property. + * Get the accessTier property: The access tier. * * @return the accessTier value. */ @@ -454,19 +326,7 @@ public String getAccessTier() { } /** - * Set the accessTier property: The AccessTier property. - * - * @param accessTier the accessTier value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setAccessTier(String accessTier) { - this.accessTier = accessTier; - return this; - } - - /** - * Get the accessTierChangeTime property: The AccessTierChangeTime property. + * Get the accessTierChangeTime property: The access tier change time. * * @return the accessTierChangeTime value. */ @@ -479,23 +339,7 @@ public OffsetDateTime getAccessTierChangeTime() { } /** - * Set the accessTierChangeTime property: The AccessTierChangeTime property. - * - * @param accessTierChangeTime the accessTierChangeTime value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setAccessTierChangeTime(OffsetDateTime accessTierChangeTime) { - if (accessTierChangeTime == null) { - this.accessTierChangeTime = null; - } else { - this.accessTierChangeTime = new DateTimeRfc1123(accessTierChangeTime); - } - return this; - } - - /** - * Get the accessTierTransitionState property: The AccessTierTransitionState property. + * Get the accessTierTransitionState property: The access tier transition state. * * @return the accessTierTransitionState value. */ @@ -504,18 +348,6 @@ public String getAccessTierTransitionState() { return this.accessTierTransitionState; } - /** - * Set the accessTierTransitionState property: The AccessTierTransitionState property. - * - * @param accessTierTransitionState the accessTierTransitionState value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setAccessTierTransitionState(String accessTierTransitionState) { - this.accessTierTransitionState = accessTierTransitionState; - return this; - } - /** * Get the leaseStatus property: The current lease status of the share. * @@ -526,18 +358,6 @@ public LeaseStatusType getLeaseStatus() { return this.leaseStatus; } - /** - * Set the leaseStatus property: The current lease status of the share. - * - * @param leaseStatus the leaseStatus value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setLeaseStatus(LeaseStatusType leaseStatus) { - this.leaseStatus = leaseStatus; - return this; - } - /** * Get the leaseState property: Lease state of the share. * @@ -548,18 +368,6 @@ public LeaseStateType getLeaseState() { return this.leaseState; } - /** - * Set the leaseState property: Lease state of the share. - * - * @param leaseState the leaseState value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setLeaseState(LeaseStateType leaseState) { - this.leaseState = leaseState; - return this; - } - /** * Get the leaseDuration property: When a share is leased, specifies whether the lease is of infinite or fixed * duration. @@ -572,20 +380,7 @@ public LeaseDurationType getLeaseDuration() { } /** - * Set the leaseDuration property: When a share is leased, specifies whether the lease is of infinite or fixed - * duration. - * - * @param leaseDuration the leaseDuration value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setLeaseDuration(LeaseDurationType leaseDuration) { - this.leaseDuration = leaseDuration; - return this; - } - - /** - * Get the enabledProtocols property: The EnabledProtocols property. + * Get the enabledProtocols property: The enabled protocols. * * @return the enabledProtocols value. */ @@ -595,19 +390,7 @@ public String getEnabledProtocols() { } /** - * Set the enabledProtocols property: The EnabledProtocols property. - * - * @param enabledProtocols the enabledProtocols value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setEnabledProtocols(String enabledProtocols) { - this.enabledProtocols = enabledProtocols; - return this; - } - - /** - * Get the rootSquash property: The RootSquash property. + * Get the rootSquash property: The root squash setting. * * @return the rootSquash value. */ @@ -617,19 +400,7 @@ public ShareRootSquash getRootSquash() { } /** - * Set the rootSquash property: The RootSquash property. - * - * @param rootSquash the rootSquash value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setRootSquash(ShareRootSquash rootSquash) { - this.rootSquash = rootSquash; - return this; - } - - /** - * Get the enableSnapshotVirtualDirectoryAccess property: The EnableSnapshotVirtualDirectoryAccess property. + * Get the enableSnapshotVirtualDirectoryAccess property: Whether snapshot virtual directory access is enabled. * * @return the enableSnapshotVirtualDirectoryAccess value. */ @@ -639,20 +410,7 @@ public Boolean isEnableSnapshotVirtualDirectoryAccess() { } /** - * Set the enableSnapshotVirtualDirectoryAccess property: The EnableSnapshotVirtualDirectoryAccess property. - * - * @param enableSnapshotVirtualDirectoryAccess the enableSnapshotVirtualDirectoryAccess value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal - setEnableSnapshotVirtualDirectoryAccess(Boolean enableSnapshotVirtualDirectoryAccess) { - this.enableSnapshotVirtualDirectoryAccess = enableSnapshotVirtualDirectoryAccess; - return this; - } - - /** - * Get the paidBurstingEnabled property: The PaidBurstingEnabled property. + * Get the paidBurstingEnabled property: Whether paid bursting is enabled. * * @return the paidBurstingEnabled value. */ @@ -662,19 +420,7 @@ public Boolean isPaidBurstingEnabled() { } /** - * Set the paidBurstingEnabled property: The PaidBurstingEnabled property. - * - * @param paidBurstingEnabled the paidBurstingEnabled value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setPaidBurstingEnabled(Boolean paidBurstingEnabled) { - this.paidBurstingEnabled = paidBurstingEnabled; - return this; - } - - /** - * Get the paidBurstingMaxIops property: The PaidBurstingMaxIops property. + * Get the paidBurstingMaxIops property: The maximum IOPS for paid bursting. * * @return the paidBurstingMaxIops value. */ @@ -684,19 +430,7 @@ public Long getPaidBurstingMaxIops() { } /** - * Set the paidBurstingMaxIops property: The PaidBurstingMaxIops property. - * - * @param paidBurstingMaxIops the paidBurstingMaxIops value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setPaidBurstingMaxIops(Long paidBurstingMaxIops) { - this.paidBurstingMaxIops = paidBurstingMaxIops; - return this; - } - - /** - * Get the paidBurstingMaxBandwidthMibps property: The PaidBurstingMaxBandwidthMibps property. + * Get the paidBurstingMaxBandwidthMibps property: The maximum bandwidth for paid bursting in MiBps. * * @return the paidBurstingMaxBandwidthMibps value. */ @@ -706,19 +440,7 @@ public Long getPaidBurstingMaxBandwidthMibps() { } /** - * Set the paidBurstingMaxBandwidthMibps property: The PaidBurstingMaxBandwidthMibps property. - * - * @param paidBurstingMaxBandwidthMibps the paidBurstingMaxBandwidthMibps value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setPaidBurstingMaxBandwidthMibps(Long paidBurstingMaxBandwidthMibps) { - this.paidBurstingMaxBandwidthMibps = paidBurstingMaxBandwidthMibps; - return this; - } - - /** - * Get the includedBurstIops property: The IncludedBurstIops property. + * Get the includedBurstIops property: The included burst IOPS. * * @return the includedBurstIops value. */ @@ -728,19 +450,7 @@ public Long getIncludedBurstIops() { } /** - * Set the includedBurstIops property: The IncludedBurstIops property. - * - * @param includedBurstIops the includedBurstIops value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setIncludedBurstIops(Long includedBurstIops) { - this.includedBurstIops = includedBurstIops; - return this; - } - - /** - * Get the maxBurstCreditsForIops property: The MaxBurstCreditsForIops property. + * Get the maxBurstCreditsForIops property: The maximum burst credits for IOPS. * * @return the maxBurstCreditsForIops value. */ @@ -750,19 +460,7 @@ public Long getMaxBurstCreditsForIops() { } /** - * Set the maxBurstCreditsForIops property: The MaxBurstCreditsForIops property. - * - * @param maxBurstCreditsForIops the maxBurstCreditsForIops value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setMaxBurstCreditsForIops(Long maxBurstCreditsForIops) { - this.maxBurstCreditsForIops = maxBurstCreditsForIops; - return this; - } - - /** - * Get the nextAllowedProvisionedIopsDowngradeTime property: The NextAllowedProvisionedIopsDowngradeTime property. + * Get the nextAllowedProvisionedIopsDowngradeTime property: The next allowed provisioned IOPS downgrade time. * * @return the nextAllowedProvisionedIopsDowngradeTime value. */ @@ -775,25 +473,8 @@ public OffsetDateTime getNextAllowedProvisionedIopsDowngradeTime() { } /** - * Set the nextAllowedProvisionedIopsDowngradeTime property: The NextAllowedProvisionedIopsDowngradeTime property. - * - * @param nextAllowedProvisionedIopsDowngradeTime the nextAllowedProvisionedIopsDowngradeTime value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal - setNextAllowedProvisionedIopsDowngradeTime(OffsetDateTime nextAllowedProvisionedIopsDowngradeTime) { - if (nextAllowedProvisionedIopsDowngradeTime == null) { - this.nextAllowedProvisionedIopsDowngradeTime = null; - } else { - this.nextAllowedProvisionedIopsDowngradeTime = new DateTimeRfc1123(nextAllowedProvisionedIopsDowngradeTime); - } - return this; - } - - /** - * Get the nextAllowedProvisionedBandwidthDowngradeTime property: The NextAllowedProvisionedBandwidthDowngradeTime - * property. + * Get the nextAllowedProvisionedBandwidthDowngradeTime property: The next allowed provisioned bandwidth downgrade + * time. * * @return the nextAllowedProvisionedBandwidthDowngradeTime value. */ @@ -806,27 +487,7 @@ public OffsetDateTime getNextAllowedProvisionedBandwidthDowngradeTime() { } /** - * Set the nextAllowedProvisionedBandwidthDowngradeTime property: The NextAllowedProvisionedBandwidthDowngradeTime - * property. - * - * @param nextAllowedProvisionedBandwidthDowngradeTime the nextAllowedProvisionedBandwidthDowngradeTime value to - * set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal - setNextAllowedProvisionedBandwidthDowngradeTime(OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime) { - if (nextAllowedProvisionedBandwidthDowngradeTime == null) { - this.nextAllowedProvisionedBandwidthDowngradeTime = null; - } else { - this.nextAllowedProvisionedBandwidthDowngradeTime - = new DateTimeRfc1123(nextAllowedProvisionedBandwidthDowngradeTime); - } - return this; - } - - /** - * Get the enableSmbDirectoryLease property: The EnableSmbDirectoryLease property. + * Get the enableSmbDirectoryLease property: Whether SMB directory lease is enabled. * * @return the enableSmbDirectoryLease value. */ @@ -835,40 +496,6 @@ public Boolean isEnableSmbDirectoryLease() { return this.enableSmbDirectoryLease; } - /** - * Set the enableSmbDirectoryLease property: The EnableSmbDirectoryLease property. - * - * @param enableSmbDirectoryLease the enableSmbDirectoryLease value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setEnableSmbDirectoryLease(Boolean enableSmbDirectoryLease) { - this.enableSmbDirectoryLease = enableSmbDirectoryLease; - return this; - } - - /** - * Get the metadata property: Dictionary of <string>. - * - * @return the metadata value. - */ - @Generated - public Map getMetadata() { - return this.metadata; - } - - /** - * Set the metadata property: Dictionary of <string>. - * - * @param metadata the metadata value to set. - * @return the SharePropertiesInternal object itself. - */ - @Generated - public SharePropertiesInternal setMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -913,13 +540,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeStringElement("NextAllowedProvisionedBandwidthDowngradeTime", Objects.toString(this.nextAllowedProvisionedBandwidthDowngradeTime, null)); xmlWriter.writeBooleanElement("EnableSmbDirectoryLease", this.enableSmbDirectoryLease); - if (this.metadata != null) { - xmlWriter.writeStartElement("Metadata"); - for (Map.Entry entry : this.metadata.entrySet()) { - xmlWriter.writeStringElement(entry.getKey(), entry.getValue()); - } - xmlWriter.writeEndElement(); - } return xmlWriter.writeEndElement(); } @@ -929,6 +549,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of SharePropertiesInternal if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the SharePropertiesInternal. */ @Generated @@ -944,6 +565,7 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader) throws XMLStr * cases where the model can deserialize from different root element names. * @return An instance of SharePropertiesInternal if the XmlReader was pointing to an instance of it, or null if it * was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the SharePropertiesInternal. */ @Generated @@ -952,94 +574,126 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader, String rootEl String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "SharePropertiesInternal" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - SharePropertiesInternal deserializedSharePropertiesInternal = new SharePropertiesInternal(); + OffsetDateTime lastModified = null; + String eTag = null; + int quota = 0; + Integer provisionedIops = null; + Integer provisionedIngressMBps = null; + Integer provisionedEgressMBps = null; + Integer provisionedBandwidthMiBps = null; + DateTimeRfc1123 nextAllowedQuotaDowngradeTime = null; + DateTimeRfc1123 deletedTime = null; + Integer remainingRetentionDays = null; + String accessTier = null; + DateTimeRfc1123 accessTierChangeTime = null; + String accessTierTransitionState = null; + LeaseStatusType leaseStatus = null; + LeaseStateType leaseState = null; + LeaseDurationType leaseDuration = null; + String enabledProtocols = null; + ShareRootSquash rootSquash = null; + Boolean enableSnapshotVirtualDirectoryAccess = null; + Boolean paidBurstingEnabled = null; + Long paidBurstingMaxIops = null; + Long paidBurstingMaxBandwidthMibps = null; + Long includedBurstIops = null; + Long maxBurstCreditsForIops = null; + DateTimeRfc1123 nextAllowedProvisionedIopsDowngradeTime = null; + DateTimeRfc1123 nextAllowedProvisionedBandwidthDowngradeTime = null; + Boolean enableSmbDirectoryLease = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("Last-Modified".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.lastModified = reader.getNullableElement(DateTimeRfc1123::new); + DateTimeRfc1123 lastModifiedHolder = reader.getNullableElement(DateTimeRfc1123::new); + if (lastModifiedHolder != null) { + lastModified = lastModifiedHolder.getDateTime(); + } } else if ("Etag".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.eTag = reader.getStringElement(); + eTag = reader.getStringElement(); } else if ("Quota".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.quota = reader.getIntElement(); + quota = reader.getIntElement(); } else if ("ProvisionedIops".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.provisionedIops = reader.getNullableElement(Integer::parseInt); + provisionedIops = reader.getNullableElement(Integer::parseInt); } else if ("ProvisionedIngressMBps".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.provisionedIngressMBps - = reader.getNullableElement(Integer::parseInt); + provisionedIngressMBps = reader.getNullableElement(Integer::parseInt); } else if ("ProvisionedEgressMBps".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.provisionedEgressMBps - = reader.getNullableElement(Integer::parseInt); + provisionedEgressMBps = reader.getNullableElement(Integer::parseInt); } else if ("ProvisionedBandwidthMiBps".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.provisionedBandwidthMiBps - = reader.getNullableElement(Integer::parseInt); + provisionedBandwidthMiBps = reader.getNullableElement(Integer::parseInt); } else if ("NextAllowedQuotaDowngradeTime".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.nextAllowedQuotaDowngradeTime - = reader.getNullableElement(DateTimeRfc1123::new); + nextAllowedQuotaDowngradeTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("DeletedTime".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.deletedTime = reader.getNullableElement(DateTimeRfc1123::new); + deletedTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("RemainingRetentionDays".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.remainingRetentionDays - = reader.getNullableElement(Integer::parseInt); + remainingRetentionDays = reader.getNullableElement(Integer::parseInt); } else if ("AccessTier".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.accessTier = reader.getStringElement(); + accessTier = reader.getStringElement(); } else if ("AccessTierChangeTime".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.accessTierChangeTime - = reader.getNullableElement(DateTimeRfc1123::new); + accessTierChangeTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("AccessTierTransitionState".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.accessTierTransitionState = reader.getStringElement(); + accessTierTransitionState = reader.getStringElement(); } else if ("LeaseStatus".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.leaseStatus - = LeaseStatusType.fromString(reader.getStringElement()); + leaseStatus = LeaseStatusType.fromString(reader.getStringElement()); } else if ("LeaseState".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.leaseState - = LeaseStateType.fromString(reader.getStringElement()); + leaseState = LeaseStateType.fromString(reader.getStringElement()); } else if ("LeaseDuration".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.leaseDuration - = LeaseDurationType.fromString(reader.getStringElement()); + leaseDuration = LeaseDurationType.fromString(reader.getStringElement()); } else if ("EnabledProtocols".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.enabledProtocols = reader.getStringElement(); + enabledProtocols = reader.getStringElement(); } else if ("RootSquash".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.rootSquash - = ShareRootSquash.fromString(reader.getStringElement()); + rootSquash = ShareRootSquash.fromString(reader.getStringElement()); } else if ("EnableSnapshotVirtualDirectoryAccess".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.enableSnapshotVirtualDirectoryAccess - = reader.getNullableElement(Boolean::parseBoolean); + enableSnapshotVirtualDirectoryAccess = reader.getNullableElement(Boolean::parseBoolean); } else if ("PaidBurstingEnabled".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.paidBurstingEnabled - = reader.getNullableElement(Boolean::parseBoolean); + paidBurstingEnabled = reader.getNullableElement(Boolean::parseBoolean); } else if ("PaidBurstingMaxIops".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.paidBurstingMaxIops - = reader.getNullableElement(Long::parseLong); + paidBurstingMaxIops = reader.getNullableElement(Long::parseLong); } else if ("PaidBurstingMaxBandwidthMibps".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.paidBurstingMaxBandwidthMibps - = reader.getNullableElement(Long::parseLong); + paidBurstingMaxBandwidthMibps = reader.getNullableElement(Long::parseLong); } else if ("IncludedBurstIops".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.includedBurstIops = reader.getNullableElement(Long::parseLong); + includedBurstIops = reader.getNullableElement(Long::parseLong); } else if ("MaxBurstCreditsForIops".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.maxBurstCreditsForIops - = reader.getNullableElement(Long::parseLong); + maxBurstCreditsForIops = reader.getNullableElement(Long::parseLong); } else if ("NextAllowedProvisionedIopsDowngradeTime".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.nextAllowedProvisionedIopsDowngradeTime - = reader.getNullableElement(DateTimeRfc1123::new); + nextAllowedProvisionedIopsDowngradeTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("NextAllowedProvisionedBandwidthDowngradeTime".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.nextAllowedProvisionedBandwidthDowngradeTime - = reader.getNullableElement(DateTimeRfc1123::new); + nextAllowedProvisionedBandwidthDowngradeTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("EnableSmbDirectoryLease".equals(elementName.getLocalPart())) { - deserializedSharePropertiesInternal.enableSmbDirectoryLease - = reader.getNullableElement(Boolean::parseBoolean); - } else if ("Metadata".equals(elementName.getLocalPart())) { - while (reader.nextElement() != XmlToken.END_ELEMENT) { - if (deserializedSharePropertiesInternal.metadata == null) { - deserializedSharePropertiesInternal.metadata = new LinkedHashMap<>(); - } - deserializedSharePropertiesInternal.metadata.put(reader.getElementName().getLocalPart(), - reader.getStringElement()); - } + enableSmbDirectoryLease = reader.getNullableElement(Boolean::parseBoolean); } else { reader.skipElement(); } } + SharePropertiesInternal deserializedSharePropertiesInternal + = new SharePropertiesInternal(lastModified, eTag, quota); + deserializedSharePropertiesInternal.provisionedIops = provisionedIops; + deserializedSharePropertiesInternal.provisionedIngressMBps = provisionedIngressMBps; + deserializedSharePropertiesInternal.provisionedEgressMBps = provisionedEgressMBps; + deserializedSharePropertiesInternal.provisionedBandwidthMiBps = provisionedBandwidthMiBps; + deserializedSharePropertiesInternal.nextAllowedQuotaDowngradeTime = nextAllowedQuotaDowngradeTime; + deserializedSharePropertiesInternal.deletedTime = deletedTime; + deserializedSharePropertiesInternal.remainingRetentionDays = remainingRetentionDays; + deserializedSharePropertiesInternal.accessTier = accessTier; + deserializedSharePropertiesInternal.accessTierChangeTime = accessTierChangeTime; + deserializedSharePropertiesInternal.accessTierTransitionState = accessTierTransitionState; + deserializedSharePropertiesInternal.leaseStatus = leaseStatus; + deserializedSharePropertiesInternal.leaseState = leaseState; + deserializedSharePropertiesInternal.leaseDuration = leaseDuration; + deserializedSharePropertiesInternal.enabledProtocols = enabledProtocols; + deserializedSharePropertiesInternal.rootSquash = rootSquash; + deserializedSharePropertiesInternal.enableSnapshotVirtualDirectoryAccess + = enableSnapshotVirtualDirectoryAccess; + deserializedSharePropertiesInternal.paidBurstingEnabled = paidBurstingEnabled; + deserializedSharePropertiesInternal.paidBurstingMaxIops = paidBurstingMaxIops; + deserializedSharePropertiesInternal.paidBurstingMaxBandwidthMibps = paidBurstingMaxBandwidthMibps; + deserializedSharePropertiesInternal.includedBurstIops = includedBurstIops; + deserializedSharePropertiesInternal.maxBurstCreditsForIops = maxBurstCreditsForIops; + deserializedSharePropertiesInternal.nextAllowedProvisionedIopsDowngradeTime + = nextAllowedProvisionedIopsDowngradeTime; + deserializedSharePropertiesInternal.nextAllowedProvisionedBandwidthDowngradeTime + = nextAllowedProvisionedBandwidthDowngradeTime; + deserializedSharePropertiesInternal.enableSmbDirectoryLease = enableSmbDirectoryLease; return deserializedSharePropertiesInternal; }); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareSignedIdentifierWrapper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareSignedIdentifierWrapper.java index 59ed1707bcee..626be22c9c2a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareSignedIdentifierWrapper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareSignedIdentifierWrapper.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.implementation.models; import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; import com.azure.storage.file.share.models.ShareSignedIdentifier; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; @@ -16,27 +17,34 @@ import javax.xml.stream.XMLStreamException; /** - * A wrapper around List<ShareSignedIdentifier> which provides top-level metadata for serialization. + * Represents an array of signed identifiers. */ +@Immutable public final class ShareSignedIdentifierWrapper implements XmlSerializable { - private final List signedIdentifiers; + /* + * The array of signed identifiers. + */ + @Generated + private final List items; /** - * Creates an instance of ShareSignedIdentifierWrapper. + * Creates an instance of ShareSignedIdentifierWrapper class. * - * @param signedIdentifiers the list. + * @param items the items value to set. */ - public ShareSignedIdentifierWrapper(List signedIdentifiers) { - this.signedIdentifiers = signedIdentifiers; + @Generated + public ShareSignedIdentifierWrapper(List items) { + this.items = items; } /** - * Get the List<ShareSignedIdentifier> contained in this wrapper. + * Get the items property: The array of signed identifiers. * - * @return the List<ShareSignedIdentifier>. + * @return the items value. */ - public List items() { - return signedIdentifiers; + @Generated + public List getItems() { + return this.items; } @Generated @@ -50,26 +58,46 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; xmlWriter.writeStartElement(rootElementName); - if (signedIdentifiers != null) { - for (ShareSignedIdentifier element : signedIdentifiers) { + if (this.items != null) { + for (ShareSignedIdentifier element : this.items) { xmlWriter.writeXml(element, "SignedIdentifier"); } } return xmlWriter.writeEndElement(); } + /** + * Reads an instance of ShareSignedIdentifierWrapper from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @return An instance of ShareSignedIdentifierWrapper if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ShareSignedIdentifierWrapper. + */ @Generated public static ShareSignedIdentifierWrapper fromXml(XmlReader xmlReader) throws XMLStreamException { return fromXml(xmlReader, null); } + /** + * Reads an instance of ShareSignedIdentifierWrapper from the XmlReader. + * + * @param xmlReader The XmlReader being read. + * @param rootElementName Optional root element name to override the default defined by the model. Used to support + * cases where the model can deserialize from different root element names. + * @return An instance of ShareSignedIdentifierWrapper if the XmlReader was pointing to an instance of it, or null + * if it was pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. + * @throws XMLStreamException If an error occurs while reading the ShareSignedIdentifierWrapper. + */ @Generated public static ShareSignedIdentifierWrapper fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; - return xmlReader.readObject(rootElementName, reader -> { + String finalRootElementName + = rootElementName == null || rootElementName.isEmpty() ? "SignedIdentifiers" : rootElementName; + return xmlReader.readObject(finalRootElementName, reader -> { List items = null; - while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); @@ -77,10 +105,9 @@ public static ShareSignedIdentifierWrapper fromXml(XmlReader xmlReader, String r if (items == null) { items = new ArrayList<>(); } - - items.add(ShareSignedIdentifier.fromXml(reader)); + items.add(ShareSignedIdentifier.fromXml(reader, "SignedIdentifier")); } else { - reader.nextElement(); + reader.skipElement(); } } return new ShareSignedIdentifierWrapper(items); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareStats.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareStats.java index 86dc8c23dd3c..7acc3dbdf56a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareStats.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ShareStats.java @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -16,25 +16,28 @@ /** * Stats for the share. */ -@Fluent +@Immutable public final class ShareStats implements XmlSerializable { /* - * The approximate size of the data stored in bytes, rounded up to the nearest gigabyte. Note that this value may - * not include all recently created or recently resized files. + * The approximate size of the data stored in bytes. Note that this value may not + * include all recently created or recently resized files. */ @Generated - private long shareUsageBytes; + private final long shareUsageBytes; /** * Creates an instance of ShareStats class. + * + * @param shareUsageBytes the shareUsageBytes value to set. */ @Generated - public ShareStats() { + private ShareStats(long shareUsageBytes) { + this.shareUsageBytes = shareUsageBytes; } /** - * Get the shareUsageBytes property: The approximate size of the data stored in bytes, rounded up to the nearest - * gigabyte. Note that this value may not include all recently created or recently resized files. + * Get the shareUsageBytes property: The approximate size of the data stored in bytes. Note that this value may not + * include all recently created or recently resized files. * * @return the shareUsageBytes value. */ @@ -43,19 +46,6 @@ public long getShareUsageBytes() { return this.shareUsageBytes; } - /** - * Set the shareUsageBytes property: The approximate size of the data stored in bytes, rounded up to the nearest - * gigabyte. Note that this value may not include all recently created or recently resized files. - * - * @param shareUsageBytes the shareUsageBytes value to set. - * @return the ShareStats object itself. - */ - @Generated - public ShareStats setShareUsageBytes(long shareUsageBytes) { - this.shareUsageBytes = shareUsageBytes; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -77,6 +67,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt * @param xmlReader The XmlReader being read. * @return An instance of ShareStats if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareStats. */ @Generated @@ -92,6 +83,7 @@ public static ShareStats fromXml(XmlReader xmlReader) throws XMLStreamException * cases where the model can deserialize from different root element names. * @return An instance of ShareStats if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareStats. */ @Generated @@ -99,18 +91,17 @@ public static ShareStats fromXml(XmlReader xmlReader, String rootElementName) th String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "ShareStats" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ShareStats deserializedShareStats = new ShareStats(); + long shareUsageBytes = 0L; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); if ("ShareUsageBytes".equals(elementName.getLocalPart())) { - deserializedShareStats.shareUsageBytes = reader.getLongElement(); + shareUsageBytes = reader.getLongElement(); } else { reader.skipElement(); } } - - return deserializedShareStats; + return new ShareStats(shareUsageBytes); }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesCreateSnapshotHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesCreateSnapshotHeaders.java deleted file mode 100644 index e6708f44d46f..000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesCreateSnapshotHeaders.java +++ /dev/null @@ -1,229 +0,0 @@ -// 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 SharesCreateSnapshotHeaders model. - */ -@Fluent -public final class SharesCreateSnapshotHeaders { - /* - * The x-ms-snapshot property. - */ - @Generated - private String xMsSnapshot; - - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Last-Modified property. - */ - @Generated - private DateTimeRfc1123 lastModified; - - /* - * 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_SNAPSHOT = HttpHeaderName.fromString("x-ms-snapshot"); - - private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of SharesCreateSnapshotHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public SharesCreateSnapshotHeaders(HttpHeaders rawHeaders) { - this.xMsSnapshot = rawHeaders.getValue(X_MS_SNAPSHOT); - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - String lastModified = rawHeaders.getValue(HttpHeaderName.LAST_MODIFIED); - if (lastModified != null) { - this.lastModified = new DateTimeRfc1123(lastModified); - } else { - this.lastModified = 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 xMsSnapshot property: The x-ms-snapshot property. - * - * @return the xMsSnapshot value. - */ - @Generated - public String getXMsSnapshot() { - return this.xMsSnapshot; - } - - /** - * Set the xMsSnapshot property: The x-ms-snapshot property. - * - * @param xMsSnapshot the xMsSnapshot value to set. - * @return the SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders setXMsSnapshot(String xMsSnapshot) { - this.xMsSnapshot = xMsSnapshot; - 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 SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * 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 SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders setLastModified(OffsetDateTime lastModified) { - if (lastModified == null) { - this.lastModified = null; - } else { - this.lastModified = new DateTimeRfc1123(lastModified); - } - 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 SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders 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 SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders 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 SharesCreateSnapshotHeaders object itself. - */ - @Generated - public SharesCreateSnapshotHeaders 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/implementation/models/StringEncoded.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/StringEncoded.java index d8c7c503a309..f79e4a456101 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/StringEncoded.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/StringEncoded.java @@ -1,29 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.annotation.Immutable; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlWriter; import javax.xml.stream.XMLStreamException; /** - * The StringEncoded model. + * An encoded string value. */ -@Fluent +@Immutable public final class StringEncoded implements XmlSerializable { /* - * The Encoded property. + * Whether the value is encoded. */ @Generated private Boolean encoded; /* - * The content property. + * The string content. */ @Generated private String content; @@ -32,11 +32,11 @@ public final class StringEncoded implements XmlSerializable { * Creates an instance of StringEncoded class. */ @Generated - public StringEncoded() { + private StringEncoded() { } /** - * Get the encoded property: The Encoded property. + * Get the encoded property: Whether the value is encoded. * * @return the encoded value. */ @@ -46,19 +46,7 @@ public Boolean isEncoded() { } /** - * Set the encoded property: The Encoded property. - * - * @param encoded the encoded value to set. - * @return the StringEncoded object itself. - */ - @Generated - public StringEncoded setEncoded(Boolean encoded) { - this.encoded = encoded; - return this; - } - - /** - * Get the content property: The content property. + * Get the content property: The string content. * * @return the content value. */ @@ -67,18 +55,6 @@ public String getContent() { return this.content; } - /** - * Set the content property: The content property. - * - * @param content the content value to set. - * @return the StringEncoded object itself. - */ - @Generated - public StringEncoded setContent(String content) { - this.content = content; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/package-info.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/package-info.java index e6ea6efc5e04..fada2577345a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/package-info.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for AzureFileStorage. - * null. + * Package containing the data models for File. + * Azure File Storage provides scalable file shares in the cloud using SMB and NFS protocols. */ package com.azure.storage.file.share.implementation.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java index a6830e7cb854..077ab2636850 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java @@ -6,9 +6,12 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; +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.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.DateTimeRfc1123; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -27,7 +30,9 @@ import com.azure.storage.file.share.implementation.accesshelpers.ShareFileSymbolicLinkInfoHelper; import com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType; import com.azure.storage.file.share.implementation.models.DirectoriesCreateHeaders; +import com.azure.storage.file.share.implementation.models.DirectoriesForceCloseHandlesHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesGetPropertiesHeaders; +import com.azure.storage.file.share.implementation.models.DirectoriesListHandlesHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesSetMetadataHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesSetPropertiesHeaders; import com.azure.storage.file.share.implementation.models.FileProperty; @@ -35,23 +40,30 @@ import com.azure.storage.file.share.implementation.models.FilesCreateHeaders; import com.azure.storage.file.share.implementation.models.FilesCreateSymbolicLinkHeaders; import com.azure.storage.file.share.implementation.models.FilesDownloadHeaders; +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.FilesGetSymbolicLinkHeaders; +import com.azure.storage.file.share.implementation.models.FilesListHandlesHeaders; import com.azure.storage.file.share.implementation.models.FilesSetHttpHeadersHeaders; import com.azure.storage.file.share.implementation.models.FilesSetMetadataHeaders; import com.azure.storage.file.share.implementation.models.FilesUploadRangeFromURLHeaders; import com.azure.storage.file.share.implementation.models.FilesUploadRangeHeaders; import com.azure.storage.file.share.implementation.models.InternalShareFileItemProperties; import com.azure.storage.file.share.implementation.models.ListFilesAndDirectoriesSegmentResponse; +import com.azure.storage.file.share.implementation.models.ListHandlesResponse; +import com.azure.storage.file.share.implementation.models.ListSharesResponse; import com.azure.storage.file.share.implementation.models.ServicesListSharesSegmentHeaders; import com.azure.storage.file.share.implementation.models.ShareItemInternal; import com.azure.storage.file.share.implementation.models.SharePropertiesInternal; +import com.azure.storage.file.share.implementation.models.SharePermission; +import com.azure.storage.file.share.implementation.models.ShareSignedIdentifierWrapper; import com.azure.storage.file.share.implementation.models.ShareStats; import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; -import com.azure.storage.file.share.implementation.models.SharesCreateSnapshotHeaders; +import com.azure.storage.file.share.implementation.models.SharesGetAccessPolicyHeaders; import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; import com.azure.storage.file.share.implementation.models.StringEncoded; import com.azure.storage.file.share.models.ClearRange; +import com.azure.storage.file.share.models.CloseHandlesInfo; import com.azure.storage.file.share.models.CopyStatusType; import com.azure.storage.file.share.models.CopyableFileSmbPropertiesList; import com.azure.storage.file.share.models.FilePosixProperties; @@ -81,12 +93,15 @@ import com.azure.storage.file.share.models.ShareItem; import com.azure.storage.file.share.models.ShareProperties; import com.azure.storage.file.share.models.ShareProtocols; +import com.azure.storage.file.share.models.ShareServiceProperties; import com.azure.storage.file.share.models.ShareSignedIdentifier; import com.azure.storage.file.share.models.ShareSnapshotInfo; import com.azure.storage.file.share.models.ShareSnapshotsDeleteOptionType; import com.azure.storage.file.share.models.ShareStatistics; import com.azure.storage.file.share.models.ShareStorageException; +import com.azure.storage.file.share.models.UserDelegationKey; import com.azure.storage.file.share.options.ShareFileCopyOptions; +import com.azure.xml.XmlReader; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -102,6 +117,8 @@ import java.util.Set; import java.util.TreeSet; +import javax.xml.stream.XMLStreamException; + import static com.azure.core.http.HttpHeaderName.LAST_MODIFIED; public class ModelHelper { @@ -200,7 +217,7 @@ public static ShareItem populateShareItem(ShareItemInternal shareItemInternal) { item.setSnapshot(shareItemInternal.getSnapshot()); item.setDeleted(shareItemInternal.isDeleted()); item.setVersion(shareItemInternal.getVersion()); - item.setProperties(populateShareProperties(shareItemInternal.getProperties())); + item.setProperties(populateShareProperties(shareItemInternal.getProperties(), shareItemInternal.getMetadata())); item.setMetadata(shareItemInternal.getMetadata()); return item; } @@ -209,9 +226,11 @@ public static ShareItem populateShareItem(ShareItemInternal shareItemInternal) { * Transforms {@link SharePropertiesInternal} into a public {@link ShareProperties}. * * @param sharePropertiesInternal {@link SharePropertiesInternal} + * @param metadata the share metadata (carried on the parent {@code ShareItemInternal}). * @return {@link ShareProperties} */ - public static ShareProperties populateShareProperties(SharePropertiesInternal sharePropertiesInternal) { + public static ShareProperties populateShareProperties(SharePropertiesInternal sharePropertiesInternal, + Map metadata) { ShareProperties properties = new ShareProperties(); properties.setLastModified(sharePropertiesInternal.getLastModified()); properties.setETag(sharePropertiesInternal.getETag()); @@ -230,7 +249,7 @@ public static ShareProperties populateShareProperties(SharePropertiesInternal sh properties.setLeaseDuration(sharePropertiesInternal.getLeaseDuration()); properties.setProtocols(parseShareProtocols(sharePropertiesInternal.getEnabledProtocols())); properties.setRootSquash(sharePropertiesInternal.getRootSquash()); - properties.setMetadata(sharePropertiesInternal.getMetadata()); + properties.setMetadata(metadata); properties.setProvisionedBandwidthMiBps(sharePropertiesInternal.getProvisionedBandwidthMiBps()); properties .setSnapshotVirtualDirectoryAccessEnabled(sharePropertiesInternal.isEnableSnapshotVirtualDirectoryAccess()); @@ -303,7 +322,7 @@ public static ShareFileItemProperties transformFileProperty(FileProperty propert return null; } return new InternalShareFileItemProperties(property.getCreationTime(), property.getLastAccessTime(), - property.getLastWriteTime(), property.getChangeTime(), property.getLastModified(), property.getEtag()); + property.getLastWriteTime(), property.getChangeTime(), property.getLastModified(), property.getETag()); } public static HandleItem @@ -378,10 +397,11 @@ public static boolean checkDoesNotExistStatusCode(Throwable t) { } } - public static Response createFileInfoResponse(ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); - boolean isServerEncrypted = response.getDeserializedHeaders().isXMsRequestServerEncrypted(); + public static Response createFileInfoResponse(Response response) { + FilesCreateHeaders headers = new FilesCreateHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); + boolean isServerEncrypted = headers.isXMsRequestServerEncrypted(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareFileInfo shareFileInfo @@ -389,9 +409,8 @@ public static Response createFileInfoResponse(ResponseBase(response, shareFileInfo); } - public static Response - getPropertiesResponse(final ResponseBase response) { - FilesGetPropertiesHeaders headers = response.getDeserializedHeaders(); + public static Response getPropertiesResponse(final Response response) { + FilesGetPropertiesHeaders headers = new FilesGetPropertiesHeaders(response.getHeaders()); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); Map metadata = headers.getXMsMeta(); @@ -426,11 +445,11 @@ public static Response createFileInfoResponse(ResponseBase(response, shareFileProperties); } - public static Response - setPropertiesResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); - boolean isServerEncrypted = response.getDeserializedHeaders().isXMsRequestServerEncrypted(); + public static Response setPropertiesResponse(final Response response) { + FilesSetHttpHeadersHeaders headers = new FilesSetHttpHeadersHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); + boolean isServerEncrypted = headers.isXMsRequestServerEncrypted(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareFileInfo shareFileInfo @@ -438,10 +457,10 @@ public static Response createFileInfoResponse(ResponseBase(response, shareFileInfo); } - public static Response - setMetadataResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - Boolean isServerEncrypted = response.getDeserializedHeaders().isXMsRequestServerEncrypted(); + public static Response setMetadataResponse(final Response response) { + FilesSetMetadataHeaders headers = new FilesSetMetadataHeaders(response.getHeaders()); + String eTag = headers.getETag(); + Boolean isServerEncrypted = headers.isXMsRequestServerEncrypted(); ShareFileMetadataInfo shareFileMetadataInfo = new ShareFileMetadataInfo(eTag, isServerEncrypted); return new SimpleResponse<>(response, shareFileMetadataInfo); } @@ -470,9 +489,8 @@ public static void validateCopyFlagAndSmbProperties(ShareFileCopyOptions options } } - public static Response - transformUploadResponse(ResponseBase response) { - FilesUploadRangeHeaders headers = response.getDeserializedHeaders(); + public static Response transformUploadResponse(Response response) { + FilesUploadRangeHeaders headers = new FilesUploadRangeHeaders(response.getHeaders()); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); byte[] contentMD5 = headers.getContentMD5(); @@ -494,9 +512,8 @@ public static Response mapToShareInfoResponse(Response response) { new ShareInfo(eTag, lastModified)); } - public static Response - mapGetPropertiesResponse(ResponseBase response) { - SharesGetPropertiesHeaders headers = response.getDeserializedHeaders(); + public static Response mapGetPropertiesResponse(Response response) { + SharesGetPropertiesHeaders headers = new SharesGetPropertiesHeaders(response.getHeaders()); ShareProperties shareProperties = new ShareProperties().setETag(headers.getETag()) .setLastModified(headers.getLastModified()) .setMetadata(headers.getXMsMeta()) @@ -527,13 +544,70 @@ public static Response mapToShareInfoResponse(Response response) { return new SimpleResponse<>(response, shareProperties); } - public static Response mapGetStatisticsResponse(Response response) { - return new SimpleResponse<>(response, new ShareStatistics(response.getValue().getShareUsageBytes())); + public static Response mapGetStatisticsResponse(Response response) { + ShareStats shareStats = deserializeXml(response.getValue(), ShareStats::fromXml); + return new SimpleResponse<>(response, new ShareStatistics(shareStats.getShareUsageBytes())); } - public static Response - uploadRangeHeadersToShareFileInfo(ResponseBase response) { - FilesUploadRangeHeaders headers = response.getDeserializedHeaders(); + public static PagedResponse mapGetAccessPolicyResponse(Response response) { + ShareSignedIdentifierWrapper wrapper + = deserializeXml(response.getValue(), ShareSignedIdentifierWrapper::fromXml); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + wrapper.getItems(), null, new SharesGetAccessPolicyHeaders(response.getHeaders())); + } + + private static final HttpHeaderName X_MS_FILE_PERMISSION_KEY + = HttpHeaderName.fromString("x-ms-file-permission-key"); + + public static Response mapCreatePermissionResponse(Response response) { + return new SimpleResponse<>(response, response.getHeaders().getValue(X_MS_FILE_PERMISSION_KEY)); + } + + public static Response mapGetPermissionResponse(Response response) { + return new SimpleResponse<>(response, response.getValue().toObject(SharePermission.class).getPermission()); + } + + public static Response mapGetServicePropertiesResponse(Response response) { + return new SimpleResponse<>(response, deserializeXml(response.getValue(), ShareServiceProperties::fromXml)); + } + + public static Response mapGetUserDelegationKeyResponse(Response response) { + return new SimpleResponse<>(response, deserializeXml(response.getValue(), UserDelegationKey::fromXml)); + } + + /** + * Deserializes a List Shares Segment response envelope into a {@link PagedResponse} of {@link ShareItem}, carrying + * the {@code NextMarker} as the continuation token. The protocol paging helpers discard {@code NextMarker}, so the + * hand-written {@code ShareServiceClient#listShares} deserializes the full {@code ListSharesResponse} envelope here. + */ + public static PagedResponse mapListSharesResponse(Response response) { + ListSharesResponse listSharesResponse = deserializeXml(response.getValue(), ListSharesResponse::fromXml); + List value = listSharesResponse.getShareItems() == null + ? Collections.emptyList() + : listSharesResponse.getShareItems() + .stream() + .map(ModelHelper::populateShareItem) + .collect(java.util.stream.Collectors.toList()); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), value, + listSharesResponse.getNextMarker(), transformListSharesHeaders(response.getHeaders())); + } + + /** Deserializes an XML response body via the model's {@code fromXml}. */ + private static T deserializeXml(BinaryData body, XmlDeserializer deserializer) { + try (XmlReader reader = XmlReader.fromStream(body.toStream())) { + return deserializer.read(reader); + } catch (XMLStreamException e) { + throw LOGGER.logExceptionAsError(new IllegalStateException(e)); + } + } + + @FunctionalInterface + private interface XmlDeserializer { + T read(XmlReader reader) throws XMLStreamException; + } + + public static Response uploadRangeHeadersToShareFileInfo(Response response) { + FilesUploadRangeHeaders headers = new FilesUploadRangeHeaders(response.getHeaders()); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); byte[] contentMD5 = headers.getContentMD5(); @@ -549,8 +623,8 @@ public static Response mapGetStatisticsResponse(Response - mapUploadRangeFromUrlResponse(final ResponseBase response) { - FilesUploadRangeFromURLHeaders headers = response.getDeserializedHeaders(); + mapUploadRangeFromUrlResponse(final Response response) { + FilesUploadRangeFromURLHeaders headers = new FilesUploadRangeFromURLHeaders(response.getHeaders()); String eTag = headers.getETag(); OffsetDateTime lastModified = headers.getLastModified(); Boolean isServerEncrypted = headers.isXMsRequestServerEncrypted(); @@ -559,19 +633,23 @@ public static Response mapGetStatisticsResponse(Response(response, shareFileUploadRangeFromUrlInfo); } - public static Response - mapCreateSnapshotResponse(ResponseBase response) { - SharesCreateSnapshotHeaders headers = response.getDeserializedHeaders(); - ShareSnapshotInfo snapshotInfo - = new ShareSnapshotInfo(headers.getXMsSnapshot(), headers.getETag(), headers.getLastModified()); + private static final HttpHeaderName X_MS_SNAPSHOT = HttpHeaderName.fromString("x-ms-snapshot"); + + public static Response mapCreateSnapshotResponse(Response response) { + HttpHeaders headers = response.getHeaders(); + String lastModifiedString = headers.getValue(HttpHeaderName.LAST_MODIFIED); + OffsetDateTime lastModified + = lastModifiedString == null ? null : new DateTimeRfc1123(lastModifiedString).getDateTime(); + ShareSnapshotInfo snapshotInfo = new ShareSnapshotInfo(headers.getValue(X_MS_SNAPSHOT), + headers.getValue(HttpHeaderName.ETAG), lastModified); return new SimpleResponse<>(response, snapshotInfo); } - public static Response - mapShareDirectoryInfo(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); + public static Response mapShareDirectoryInfo(final Response response) { + DirectoriesCreateHeaders headers = new DirectoriesCreateHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareDirectoryInfo shareDirectoryInfo @@ -579,12 +657,12 @@ public static Response mapGetStatisticsResponse(Response(response, shareDirectoryInfo); } - public static Response - mapShareDirectoryPropertiesResponse(ResponseBase response) { - Map metadata = response.getDeserializedHeaders().getXMsMeta(); - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime offsetDateTime = response.getDeserializedHeaders().getLastModified(); - boolean isServerEncrypted = response.getDeserializedHeaders().isXMsServerEncrypted(); + public static Response mapShareDirectoryPropertiesResponse(Response response) { + DirectoriesGetPropertiesHeaders headers = new DirectoriesGetPropertiesHeaders(response.getHeaders()); + Map metadata = headers.getXMsMeta(); + String eTag = headers.getETag(); + OffsetDateTime offsetDateTime = headers.getLastModified(); + boolean isServerEncrypted = headers.isXMsServerEncrypted(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareDirectoryProperties shareDirectoryProperties = ShareDirectoryPropertiesHelper.create(metadata, eTag, @@ -592,10 +670,10 @@ public static Response mapGetStatisticsResponse(Response(response, shareDirectoryProperties); } - public static Response - mapSetPropertiesResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); + public static Response mapSetPropertiesResponse(final Response response) { + DirectoriesSetPropertiesHeaders headers = new DirectoriesSetPropertiesHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareDirectoryInfo shareDirectoryInfo @@ -604,21 +682,90 @@ public static Response mapGetStatisticsResponse(Response - setShareDirectoryMetadataResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - boolean isServerEncrypted = response.getDeserializedHeaders().isXMsRequestServerEncrypted(); + setShareDirectoryMetadataResponse(final Response response) { + DirectoriesSetMetadataHeaders headers = new DirectoriesSetMetadataHeaders(response.getHeaders()); + String eTag = headers.getETag(); + boolean isServerEncrypted = headers.isXMsRequestServerEncrypted(); ShareDirectorySetMetadataInfo shareDirectorySetMetadataInfo = new ShareDirectorySetMetadataInfo(eTag, isServerEncrypted); return new SimpleResponse<>(response, shareDirectorySetMetadataInfo); } + /** Deserializes a List Files And Directories Segment response into a {@link PagedResponse} of {@link ShareFileItem}. */ + public static PagedResponse mapListFilesAndDirectoriesResponse(Response response) { + ListFilesAndDirectoriesSegmentResponse segment + = deserializeXml(response.getValue(), ListFilesAndDirectoriesSegmentResponse::fromXml); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + convertResponseAndGetNumOfResults(segment), segment.getNextMarker(), null); + } + + /** Deserializes a directory List Handles response into a {@link PagedResponse} of {@link HandleItem}. */ + public static PagedResponse mapDirectoryListHandlesResponse(Response response) { + ListHandlesResponse listHandlesResponse = deserializeXml(response.getValue(), ListHandlesResponse::fromXml); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + transformHandleItems(listHandlesResponse.getHandleList()), listHandlesResponse.getNextMarker(), + new DirectoriesListHandlesHeaders(response.getHeaders())); + } + + /** Maps a directory Force Close Handles response into the closed/failed handle counts. */ + public static Response mapDirectoryForceCloseHandlesResponse(Response response) { + DirectoriesForceCloseHandlesHeaders headers = new DirectoriesForceCloseHandlesHeaders(response.getHeaders()); + return new SimpleResponse<>(response, + new CloseHandlesInfo(headers.getXMsNumberOfHandlesClosed(), headers.getXMsNumberOfHandlesFailed())); + } + + /** Maps a directory Force Close Handles response into a paged result carrying the continuation marker. */ + public static PagedResponse mapDirectoryForceCloseHandlesPagedResponse(Response response) { + DirectoriesForceCloseHandlesHeaders headers = new DirectoriesForceCloseHandlesHeaders(response.getHeaders()); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + Collections.singletonList( + new CloseHandlesInfo(headers.getXMsNumberOfHandlesClosed(), headers.getXMsNumberOfHandlesFailed())), + headers.getXMsMarker(), headers); + } + + /** Deserializes a file List Handles response into a {@link PagedResponse} of {@link HandleItem}. */ + public static PagedResponse mapFileListHandlesResponse(Response response) { + ListHandlesResponse listHandlesResponse = deserializeXml(response.getValue(), ListHandlesResponse::fromXml); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + transformHandleItems(listHandlesResponse.getHandleList()), listHandlesResponse.getNextMarker(), + new FilesListHandlesHeaders(response.getHeaders())); + } + + /** Deserializes a Get Range List response body into a {@link ShareFileRangeList}. */ + public static Response mapGetRangeListResponse(Response response) { + ShareFileRangeList rangeList = deserializeXml(response.getValue(), ShareFileRangeList::fromXml); + return new SimpleResponse<>(response, rangeList); + } + + private static final HttpHeaderName X_MS_LEASE_ID = HttpHeaderName.fromString("x-ms-lease-id"); + + /** Maps a lease response into the {@code x-ms-lease-id} header value. */ + public static Response mapLeaseIdResponse(Response response) { + return new SimpleResponse<>(response, response.getHeaders().getValue(X_MS_LEASE_ID)); + } + + /** Maps a file Force Close Handles response into the closed/failed handle counts. */ + public static Response mapFileForceCloseHandlesResponse(Response response) { + FilesForceCloseHandlesHeaders headers = new FilesForceCloseHandlesHeaders(response.getHeaders()); + return new SimpleResponse<>(response, + new CloseHandlesInfo(headers.getXMsNumberOfHandlesClosed(), headers.getXMsNumberOfHandlesFailed())); + } + + /** Maps a file Force Close Handles response into a paged result carrying the continuation marker. */ + public static PagedResponse mapFileForceCloseHandlesPagedResponse(Response response) { + FilesForceCloseHandlesHeaders headers = new FilesForceCloseHandlesHeaders(response.getHeaders()); + return new PagedResponseBase<>(response.getRequest(), response.getStatusCode(), response.getHeaders(), + Collections.singletonList( + new CloseHandlesInfo(headers.getXMsNumberOfHandlesClosed(), headers.getXMsNumberOfHandlesFailed())), + headers.getXMsMarker(), headers); + } + public static List - convertResponseAndGetNumOfResults(Response res) { + convertResponseAndGetNumOfResults(ListFilesAndDirectoriesSegmentResponse segmentResponse) { Set shareFileItems = new TreeSet<>(Comparator.comparing(ShareFileItem::getName)); - if (res.getValue().getSegment() != null) { + if (segmentResponse.getSegment() != null) { - res.getValue() - .getSegment() + segmentResponse.getSegment() .getDirectoryItems() .forEach(directoryItem -> shareFileItems .add(new ShareFileItem(ModelHelper.decodeName(directoryItem.getName()), true, @@ -626,8 +773,7 @@ public static Response mapGetStatisticsResponse(Response shareFileItems.add(new ShareFileItem(ModelHelper.decodeName(fileItem.getName()), false, fileItem.getFileId(), ModelHelper.transformFileProperty(fileItem.getProperties()), @@ -638,10 +784,10 @@ public static Response mapGetStatisticsResponse(Response(shareFileItems); } - public static Response - createHardLinkResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); + public static Response createHardLinkResponse(final Response response) { + FilesCreateHardLinkHeaders headers = new FilesCreateHardLinkHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareFileInfo shareFileInfo @@ -649,10 +795,10 @@ public static Response mapGetStatisticsResponse(Response(response, shareFileInfo); } - public static Response - createSymbolicLinkResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); + public static Response createSymbolicLinkResponse(final Response response) { + FilesCreateSymbolicLinkHeaders headers = new FilesCreateSymbolicLinkHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); FileSmbProperties smbProperties = FileSmbPropertiesHelper.create(response.getHeaders()); FilePosixProperties posixProperties = FilePosixPropertiesHelper.create(response.getHeaders()); ShareFileInfo shareFileInfo @@ -660,11 +806,11 @@ public static Response mapGetStatisticsResponse(Response(response, shareFileInfo); } - public static Response - getSymbolicLinkResponse(final ResponseBase response) { - String eTag = response.getDeserializedHeaders().getETag(); - OffsetDateTime lastModified = response.getDeserializedHeaders().getLastModified(); - String linkText = response.getDeserializedHeaders().getXMsLinkText(); + public static Response getSymbolicLinkResponse(final Response response) { + FilesGetSymbolicLinkHeaders headers = new FilesGetSymbolicLinkHeaders(response.getHeaders()); + String eTag = headers.getETag(); + OffsetDateTime lastModified = headers.getLastModified(); + String linkText = headers.getXMsLinkText(); ShareFileSymbolicLinkInfo shareFileSymbolicLinkInfo = ShareFileSymbolicLinkInfoHelper.create(eTag, lastModified, linkText); return new SimpleResponse<>(response, shareFileSymbolicLinkInfo); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/RequestOptionsHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/RequestOptionsHelper.java new file mode 100644 index 000000000000..383076436fb6 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/RequestOptionsHelper.java @@ -0,0 +1,771 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.file.share.implementation.util; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.storage.common.implementation.Constants; +import com.azure.storage.file.share.implementation.XmlSerializer; +import com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType; +import com.azure.storage.file.share.implementation.models.CopyFileSmbInfo; +import com.azure.storage.file.share.implementation.models.DestinationLeaseAccessConditions; +import com.azure.storage.file.share.implementation.models.ListFilesIncludeType; +import com.azure.storage.file.share.implementation.models.ListSharesIncludeType; +import com.azure.storage.file.share.implementation.models.ShareSignedIdentifierWrapper; +import com.azure.storage.file.share.implementation.models.SourceLeaseAccessConditions; +import com.azure.storage.file.share.models.FilePermissionFormat; +import com.azure.storage.file.share.models.FileLastWrittenMode; +import com.azure.storage.file.share.models.FilePosixProperties; +import com.azure.storage.file.share.models.FilePropertySemantics; +import com.azure.storage.file.share.models.ShareFileHttpHeaders; +import com.azure.storage.file.share.models.ShareSignedIdentifier; +import com.azure.storage.file.share.models.ShareSnapshotsDeleteOptionType; +import com.azure.storage.file.share.options.ShareCreateOptions; +import com.azure.storage.file.share.options.ShareSetPropertiesOptions; + +import java.util.List; +import java.util.Base64; +import java.util.Map; + +/** + * Builds the {@link RequestOptions} passed to the generated {@code implementation/*Impl} protocol methods. + *

+ * The hand-written {@code Share*} clients call the emitter's protocol {@code xxxWithResponse(RequestOptions)} methods + * (which target the account-scoped service URL and take all inputs through {@link RequestOptions}). These helpers + * translate the typed client inputs into the storage wire contract -- {@code x-ms-*} headers, query parameters, and the + * per-resource URL -- so the migration glue lives here rather than in {@code ModelHelper} (which maps responses). + */ +public final class RequestOptionsHelper { + + private static final HttpHeaderName X_MS_LEASE_ID = HttpHeaderName.fromString("x-ms-lease-id"); + private static final HttpHeaderName X_MS_LEASE_DURATION = HttpHeaderName.fromString("x-ms-lease-duration"); + private static final HttpHeaderName X_MS_PROPOSED_LEASE_ID = HttpHeaderName.fromString("x-ms-proposed-lease-id"); + private static final HttpHeaderName X_MS_LEASE_BREAK_PERIOD = HttpHeaderName.fromString("x-ms-lease-break-period"); + private static final HttpHeaderName X_MS_DELETE_SNAPSHOTS = HttpHeaderName.fromString("x-ms-delete-snapshots"); + private static final HttpHeaderName X_MS_DELETED_SHARE_NAME = HttpHeaderName.fromString("x-ms-deleted-share-name"); + private static final HttpHeaderName X_MS_DELETED_SHARE_VERSION + = HttpHeaderName.fromString("x-ms-deleted-share-version"); + private static final HttpHeaderName X_MS_FILE_PERMISSION_FORMAT + = HttpHeaderName.fromString("x-ms-file-permission-format"); + private static final HttpHeaderName X_MS_FILE_PERMISSION = HttpHeaderName.fromString("x-ms-file-permission"); + private static final HttpHeaderName X_MS_FILE_PERMISSION_KEY + = HttpHeaderName.fromString("x-ms-file-permission-key"); + private static final HttpHeaderName X_MS_FILE_ATTRIBUTES = HttpHeaderName.fromString("x-ms-file-attributes"); + private static final HttpHeaderName X_MS_FILE_CREATION_TIME = HttpHeaderName.fromString("x-ms-file-creation-time"); + private static final HttpHeaderName X_MS_FILE_LAST_WRITE_TIME + = HttpHeaderName.fromString("x-ms-file-last-write-time"); + private static final HttpHeaderName X_MS_FILE_CHANGE_TIME = HttpHeaderName.fromString("x-ms-file-change-time"); + private static final HttpHeaderName X_MS_OWNER = HttpHeaderName.fromString("x-ms-owner"); + private static final HttpHeaderName X_MS_GROUP = HttpHeaderName.fromString("x-ms-group"); + private static final HttpHeaderName X_MS_MODE = HttpHeaderName.fromString("x-ms-mode"); + private static final HttpHeaderName X_MS_CONTENT_LENGTH = HttpHeaderName.fromString("x-ms-content-length"); + private static final HttpHeaderName X_MS_CONTENT_TYPE = HttpHeaderName.fromString("x-ms-content-type"); + private static final HttpHeaderName X_MS_CONTENT_ENCODING = HttpHeaderName.fromString("x-ms-content-encoding"); + private static final HttpHeaderName X_MS_CONTENT_LANGUAGE = HttpHeaderName.fromString("x-ms-content-language"); + private static final HttpHeaderName X_MS_CACHE_CONTROL = HttpHeaderName.fromString("x-ms-cache-control"); + private static final HttpHeaderName X_MS_CONTENT_MD5 = HttpHeaderName.fromString("x-ms-content-md5"); + private static final HttpHeaderName X_MS_CONTENT_DISPOSITION + = HttpHeaderName.fromString("x-ms-content-disposition"); + private static final HttpHeaderName X_MS_FILE_FILE_TYPE = HttpHeaderName.fromString("x-ms-file-file-type"); + private static final HttpHeaderName X_MS_FILE_SUPPORT_RENAME + = HttpHeaderName.fromString("x-ms-file-support-rename"); + private static final HttpHeaderName X_MS_SOURCE_RANGE = HttpHeaderName.fromString("x-ms-source-range"); + private static final HttpHeaderName X_MS_SOURCE_CONTENT_CRC64 + = HttpHeaderName.fromString("x-ms-source-content-crc64"); + private static final HttpHeaderName X_MS_COPY_SOURCE_AUTHORIZATION + = HttpHeaderName.fromString("x-ms-copy-source-authorization"); + private static final HttpHeaderName X_MS_FILE_PERMISSION_COPY_MODE + = HttpHeaderName.fromString("x-ms-file-permission-copy-mode"); + private static final HttpHeaderName X_MS_FILE_COPY_IGNORE_READONLY + = HttpHeaderName.fromString("x-ms-file-copy-ignore-readonly"); + private static final HttpHeaderName X_MS_FILE_COPY_SET_ARCHIVE + = HttpHeaderName.fromString("x-ms-file-copy-set-archive"); + private static final HttpHeaderName X_MS_FILE_MODE_COPY_MODE + = HttpHeaderName.fromString("x-ms-file-mode-copy-mode"); + private static final HttpHeaderName X_MS_FILE_OWNER_COPY_MODE + = HttpHeaderName.fromString("x-ms-file-owner-copy-mode"); + private static final HttpHeaderName X_MS_RANGE = HttpHeaderName.fromString("x-ms-range"); + private static final HttpHeaderName X_MS_RANGE_GET_CONTENT_MD5 + = HttpHeaderName.fromString("x-ms-range-get-content-md5"); + private static final HttpHeaderName X_MS_FILE_PROPERTY_SEMANTICS + = HttpHeaderName.fromString("x-ms-file-property-semantics"); + private static final HttpHeaderName X_MS_RECURSIVE = HttpHeaderName.fromString("x-ms-recursive"); + private static final HttpHeaderName X_MS_FILE_EXTENDED_INFO = HttpHeaderName.fromString("x-ms-file-extended-info"); + private static final HttpHeaderName X_MS_FILE_RENAME_REPLACE_IF_EXISTS + = HttpHeaderName.fromString("x-ms-file-rename-replace-if-exists"); + private static final HttpHeaderName X_MS_FILE_RENAME_IGNORE_READONLY + = HttpHeaderName.fromString("x-ms-file-rename-ignore-readonly"); + private static final HttpHeaderName X_MS_SOURCE_LEASE_ID = HttpHeaderName.fromString("x-ms-source-lease-id"); + private static final HttpHeaderName X_MS_DESTINATION_LEASE_ID + = HttpHeaderName.fromString("x-ms-destination-lease-id"); + private static final HttpHeaderName X_MS_SHARE_QUOTA = HttpHeaderName.fromString("x-ms-share-quota"); + private static final HttpHeaderName X_MS_ACCESS_TIER = HttpHeaderName.fromString("x-ms-access-tier"); + private static final HttpHeaderName X_MS_ENABLED_PROTOCOLS = HttpHeaderName.fromString("x-ms-enabled-protocols"); + private static final HttpHeaderName X_MS_ROOT_SQUASH = HttpHeaderName.fromString("x-ms-root-squash"); + private static final HttpHeaderName X_MS_ENABLE_SNAPSHOT_VIRTUAL_DIRECTORY_ACCESS + = HttpHeaderName.fromString("x-ms-enable-snapshot-virtual-directory-access"); + private static final HttpHeaderName X_MS_SHARE_PAID_BURSTING_ENABLED + = HttpHeaderName.fromString("x-ms-share-paid-bursting-enabled"); + private static final HttpHeaderName X_MS_SHARE_PAID_BURSTING_MAX_IOPS + = HttpHeaderName.fromString("x-ms-share-paid-bursting-max-iops"); + private static final HttpHeaderName X_MS_SHARE_PAID_BURSTING_MAX_BANDWIDTH_MIBPS + = HttpHeaderName.fromString("x-ms-share-paid-bursting-max-bandwidth-mibps"); + private static final HttpHeaderName X_MS_SHARE_PROVISIONED_IOPS + = HttpHeaderName.fromString("x-ms-share-provisioned-iops"); + private static final HttpHeaderName X_MS_SHARE_PROVISIONED_BANDWIDTH_MIBPS + = HttpHeaderName.fromString("x-ms-share-provisioned-bandwidth-mibps"); + + private static final ObjectSerializer XML_SERIALIZER = new XmlSerializer(); + + /** + * Serializes an XML request body model (e.g. {@link com.azure.storage.file.share.models.ShareServiceProperties} or + * {@code KeyInfo}) to {@link BinaryData} for protocol methods that accept the body as an explicit parameter. + * + * @param xmlSerializable the XML-serializable model to serialize. + * @return the serialized request body. + */ + public static BinaryData serializeToXml(Object xmlSerializable) { + return BinaryData.fromObject(xmlSerializable, XML_SERIALIZER); + } + + /** + * Builds the {@link RequestOptions} for the List Shares Segment operation, wiring the {@code prefix}, + * {@code marker}, {@code maxresults} and {@code include} query parameters onto the account-scoped request. + * + * @param prefix filters results to share names beginning with this prefix; may be {@code null}. + * @param marker continuation token identifying the page to return; may be {@code null}. + * @param maxResults maximum number of shares to return per page; may be {@code null}. + * @param include datasets to include in the response; may be {@code null} or empty. + * @param context the request context. + * @return the configured request options. + */ + public static RequestOptions listSharesRequestOptions(String prefix, String marker, Integer maxResults, + List include, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (prefix != null) { + requestOptions.addQueryParam("prefix", prefix, false); + } + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + if (maxResults != null) { + requestOptions.addQueryParam("maxresults", String.valueOf(maxResults), false); + } + if (include != null && !include.isEmpty()) { + requestOptions.addQueryParam("include", + include.stream().map(ListSharesIncludeType::toString).collect(java.util.stream.Collectors.joining(",")), + false); + } + return requestOptions; + } + + /** + * The generated protocol methods target the account-scoped service URL; this appends the resource path (e.g. + * {@code "{shareName}"} or {@code "{shareName}/{filePath}"}) to the request URL while preserving the route's query + * parameters. Must be added after any {@link #addSnapshot} call so the snapshot query parameter is retained. + */ + public static void scopeRequestToResourcePath(RequestOptions requestOptions, String resourcePath) { + requestOptions.addRequestCallback(request -> { + UrlBuilder urlBuilder = UrlBuilder.parse(request.getUrl()); + urlBuilder.setPath(resourcePath); + try { + request.setUrl(urlBuilder.toUrl()); + } catch (java.net.MalformedURLException e) { + throw new IllegalStateException(e); + } + }); + } + + /** Adds the {@code x-ms-lease-id} header when a lease id is present. */ + public static void addLeaseId(RequestOptions requestOptions, String leaseId) { + if (leaseId != null) { + requestOptions.setHeader(X_MS_LEASE_ID, leaseId); + } + } + + /** Adds the {@code x-ms-file-permission-format} header when a format is present. */ + public static void addFilePermissionFormat(RequestOptions requestOptions, FilePermissionFormat format) { + if (format != null) { + requestOptions.setHeader(X_MS_FILE_PERMISSION_FORMAT, format.toString()); + } + } + + /** Adds the {@code sharesnapshot} query parameter when a snapshot is present. */ + public static void addSnapshot(RequestOptions requestOptions, String snapshot) { + if (snapshot != null) { + requestOptions.addQueryParam("sharesnapshot", snapshot); + } + } + + /** Adds the {@code x-ms-meta-*} headers for each metadata entry. */ + public static void addMetadata(RequestOptions requestOptions, Map metadata) { + if (metadata != null) { + for (Map.Entry entry : metadata.entrySet()) { + requestOptions.setHeader( + HttpHeaderName.fromString(Constants.HeaderConstants.X_MS_META + "-" + entry.getKey()), + entry.getValue()); + } + } + } + + /** Adds the {@code x-ms-delete-snapshots} header when a delete-snapshots option is present. */ + public static void addDeleteSnapshotsHeader(RequestOptions requestOptions, ShareSnapshotsDeleteOptionType option) { + DeleteSnapshotsOptionType deleteSnapshots = ModelHelper.toDeleteSnapshotsOptionType(option); + if (deleteSnapshots != null) { + requestOptions.setHeader(X_MS_DELETE_SNAPSHOTS, deleteSnapshots.toString()); + } + } + + /** + * Sets the {@code x-ms-delete-snapshots} header from the wire {@link DeleteSnapshotsOptionType} used by the + * service-level {@code deleteShare} convenience. + * + * @param requestOptions the request options to mutate. + * @param option the delete-snapshots option; a no-op when {@code null}. + */ + public static void addDeleteSnapshotsHeader(RequestOptions requestOptions, DeleteSnapshotsOptionType option) { + if (option != null) { + requestOptions.setHeader(X_MS_DELETE_SNAPSHOTS, option.toString()); + } + } + + /** + * Sets the {@code x-ms-deleted-share-name} and {@code x-ms-deleted-share-version} headers for the + * {@code undeleteShare} (restore) operation. + * + * @param requestOptions the request options to mutate. + * @param deletedShareName the name of the previously deleted share to restore. + * @param deletedShareVersion the version of the previously deleted share to restore. + */ + public static void addUndeleteShareHeaders(RequestOptions requestOptions, String deletedShareName, + String deletedShareVersion) { + requestOptions.setHeader(X_MS_DELETED_SHARE_NAME, deletedShareName); + requestOptions.setHeader(X_MS_DELETED_SHARE_VERSION, deletedShareVersion); + } + + /** + * Builds the {@link RequestOptions} for {@code Share.create}: the share-provisioning headers plus optional + * metadata, scoped to the share resource. {@code enabledProtocols} is pre-computed by the caller. + */ + public static RequestOptions createShareRequestOptions(String shareName, ShareCreateOptions options, + String enabledProtocols, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addMetadata(requestOptions, options.getMetadata()); + addHeader(requestOptions, X_MS_SHARE_QUOTA, options.getQuotaInGb()); + addHeader(requestOptions, X_MS_ACCESS_TIER, options.getAccessTier()); + addHeader(requestOptions, X_MS_ENABLED_PROTOCOLS, enabledProtocols); + addHeader(requestOptions, X_MS_ROOT_SQUASH, options.getRootSquash()); + addHeader(requestOptions, X_MS_ENABLE_SNAPSHOT_VIRTUAL_DIRECTORY_ACCESS, + options.isSnapshotVirtualDirectoryAccessEnabled()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_ENABLED, options.isPaidBurstingEnabled()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_MAX_BANDWIDTH_MIBPS, + options.getPaidBurstingMaxBandwidthMibps()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_MAX_IOPS, options.getPaidBurstingMaxIops()); + addHeader(requestOptions, X_MS_SHARE_PROVISIONED_IOPS, options.getProvisionedMaxIops()); + addHeader(requestOptions, X_MS_SHARE_PROVISIONED_BANDWIDTH_MIBPS, options.getProvisionedMaxBandwidthMibps()); + scopeRequestToResourcePath(requestOptions, shareName); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Share.setProperties}: the share-provisioning headers plus the lease + * id, scoped to the share resource. + */ + public static RequestOptions setSharePropertiesRequestOptions(String shareName, ShareSetPropertiesOptions options, + String leaseId, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_SHARE_QUOTA, options.getQuotaInGb()); + addHeader(requestOptions, X_MS_ACCESS_TIER, options.getAccessTier()); + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_ROOT_SQUASH, options.getRootSquash()); + addHeader(requestOptions, X_MS_ENABLE_SNAPSHOT_VIRTUAL_DIRECTORY_ACCESS, + options.isSnapshotVirtualDirectoryAccessEnabled()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_ENABLED, options.isPaidBurstingEnabled()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_MAX_BANDWIDTH_MIBPS, + options.getPaidBurstingMaxBandwidthMibps()); + addHeader(requestOptions, X_MS_SHARE_PAID_BURSTING_MAX_IOPS, options.getPaidBurstingMaxIops()); + addHeader(requestOptions, X_MS_SHARE_PROVISIONED_IOPS, options.getProvisionedMaxIops()); + addHeader(requestOptions, X_MS_SHARE_PROVISIONED_BANDWIDTH_MIBPS, options.getProvisionedMaxBandwidthMibps()); + scopeRequestToResourcePath(requestOptions, shareName); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Share.setAccessPolicy}: the lease id plus the signed identifiers + * serialized as the XML request body, scoped to the share resource. + */ + public static RequestOptions setAccessPolicyRequestOptions(String shareName, + List permissions, String leaseId, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addLeaseId(requestOptions, leaseId); + requestOptions.setBody(BinaryData.fromObject(new ShareSignedIdentifierWrapper(permissions), XML_SERIALIZER)); + scopeRequestToResourcePath(requestOptions, shareName); + return requestOptions; + } + + /** Adds the SMB property headers (permission key, attributes, and the creation/last-write/change times). */ + public static void addSmbProperties(RequestOptions requestOptions, String filePermissionKey, + String ntfsFileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime) { + addHeader(requestOptions, X_MS_FILE_PERMISSION_KEY, filePermissionKey); + addHeader(requestOptions, X_MS_FILE_ATTRIBUTES, ntfsFileAttributes); + addHeader(requestOptions, X_MS_FILE_CREATION_TIME, fileCreationTime); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, fileLastWriteTime); + addHeader(requestOptions, X_MS_FILE_CHANGE_TIME, fileChangeTime); + } + + /** Adds the NFS POSIX property headers (owner, group, and file mode). */ + public static void addPosixProperties(RequestOptions requestOptions, FilePosixProperties posixProperties) { + if (posixProperties != null) { + addHeader(requestOptions, X_MS_OWNER, posixProperties.getOwner()); + addHeader(requestOptions, X_MS_GROUP, posixProperties.getGroup()); + addHeader(requestOptions, X_MS_MODE, posixProperties.getFileMode()); + } + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.create}: metadata, file permission, SMB and POSIX + * properties, and the file-property semantics, scoped to the directory resource. + */ + public static RequestOptions createDirectoryRequestOptions(String resourcePath, Map metadata, + String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, + String ntfsFileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, + FilePosixProperties posixProperties, FilePropertySemantics filePropertySemantics, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addMetadata(requestOptions, metadata); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addSmbProperties(requestOptions, filePermissionKey, ntfsFileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime); + addPosixProperties(requestOptions, posixProperties); + addHeader(requestOptions, X_MS_FILE_PROPERTY_SEMANTICS, filePropertySemantics); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.setProperties}: file permission plus SMB and POSIX + * properties, scoped to the directory resource. + */ + public static RequestOptions setDirectoryPropertiesRequestOptions(String resourcePath, String filePermission, + FilePermissionFormat filePermissionFormat, String filePermissionKey, String ntfsFileAttributes, + String fileCreationTime, String fileLastWriteTime, String fileChangeTime, FilePosixProperties posixProperties, + Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addSmbProperties(requestOptions, filePermissionKey, ntfsFileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime); + addPosixProperties(requestOptions, posixProperties); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.listFilesAndDirectoriesSegment}: the prefix, snapshot, + * marker, maxresults and include query parameters plus the extended-info header, scoped to the directory resource. + */ + public static RequestOptions listFilesAndDirectoriesRequestOptions(String resourcePath, String prefix, + String snapshot, String marker, Integer maxResults, List include, + boolean includeExtendedInfo, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (prefix != null) { + requestOptions.addQueryParam("prefix", prefix, false); + } + addSnapshot(requestOptions, snapshot); + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + if (maxResults != null) { + requestOptions.addQueryParam("maxresults", String.valueOf(maxResults), false); + } + if (include != null && !include.isEmpty()) { + requestOptions.addQueryParam("include", + include.stream().map(ListFilesIncludeType::toString).collect(java.util.stream.Collectors.joining(",")), + false); + } + addHeader(requestOptions, X_MS_FILE_EXTENDED_INFO, includeExtendedInfo); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.listHandles}: the marker, maxresults and snapshot query + * parameters plus the recursive header, scoped to the directory resource. + */ + public static RequestOptions listHandlesRequestOptions(String resourcePath, String marker, Integer maxResults, + String snapshot, boolean recursive, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + if (maxResults != null) { + requestOptions.addQueryParam("maxresults", String.valueOf(maxResults), false); + } + addSnapshot(requestOptions, snapshot); + addHeader(requestOptions, X_MS_RECURSIVE, recursive); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.listHandles}: the marker, maxresults and snapshot query + * parameters, scoped to the file resource. File handle operations have no recursive header. + */ + public static RequestOptions listFileHandlesRequestOptions(String resourcePath, String marker, Integer maxResults, + String snapshot, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + if (maxResults != null) { + requestOptions.addQueryParam("maxresults", String.valueOf(maxResults), false); + } + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.forceCloseHandles}: the marker and snapshot query parameters, + * scoped to the file resource. The handle id is passed to the protocol method as an explicit parameter. + */ + public static RequestOptions forceCloseFileHandlesRequestOptions(String resourcePath, String marker, + String snapshot, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.forceCloseHandles}: the marker and snapshot query + * parameters plus the recursive header, scoped to the directory resource. The handle id is passed to the protocol + * method as an explicit parameter. + */ + public static RequestOptions forceCloseHandlesRequestOptions(String resourcePath, String marker, String snapshot, + boolean recursive, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + if (marker != null) { + requestOptions.addQueryParam("marker", marker, false); + } + addSnapshot(requestOptions, snapshot); + addHeader(requestOptions, X_MS_RECURSIVE, recursive); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code Directory.rename}: the rename flags, permission, metadata, source + * and destination lease ids, and the copy SMB info headers, scoped to the destination directory resource. The + * rename source is passed to the protocol method as an explicit parameter. + */ + public static RequestOptions renameDirectoryRequestOptions(String resourcePath, Boolean replaceIfExists, + Boolean ignoreReadOnly, String filePermission, FilePermissionFormat filePermissionFormat, + String filePermissionKey, Map metadata, SourceLeaseAccessConditions sourceConditions, + DestinationLeaseAccessConditions destinationConditions, CopyFileSmbInfo smbInfo, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_FILE_RENAME_REPLACE_IF_EXISTS, replaceIfExists); + addHeader(requestOptions, X_MS_FILE_RENAME_IGNORE_READONLY, ignoreReadOnly); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addHeader(requestOptions, X_MS_FILE_PERMISSION_KEY, filePermissionKey); + addMetadata(requestOptions, metadata); + if (sourceConditions != null) { + addHeader(requestOptions, X_MS_SOURCE_LEASE_ID, sourceConditions.getSourceLeaseId()); + } + if (destinationConditions != null) { + addHeader(requestOptions, X_MS_DESTINATION_LEASE_ID, destinationConditions.getDestinationLeaseId()); + } + if (smbInfo != null) { + addHeader(requestOptions, X_MS_FILE_ATTRIBUTES, smbInfo.getFileAttributes()); + addHeader(requestOptions, X_MS_FILE_CREATION_TIME, smbInfo.getFileCreationTime()); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, smbInfo.getFileLastWriteTime()); + addHeader(requestOptions, X_MS_FILE_CHANGE_TIME, smbInfo.getFileChangeTime()); + } + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** Builds a {@link RequestOptions} with only the lease id header, scoped to the resource. */ + public static RequestOptions addLeaseIdRequestOptions(String resourcePath, String leaseId, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addLeaseId(requestOptions, leaseId); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** Builds a {@link RequestOptions} with only the sharesnapshot query parameter, scoped to the resource. */ + public static RequestOptions snapshotRequestOptions(String resourcePath, String snapshot, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code acquireLease}: the lease-duration and proposed-lease-id headers plus + * the optional snapshot query parameter, scoped to the resource. + */ + public static RequestOptions acquireLeaseRequestOptions(String resourcePath, Integer duration, + String proposedLeaseId, String snapshot, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_LEASE_DURATION, duration); + addHeader(requestOptions, X_MS_PROPOSED_LEASE_ID, proposedLeaseId); + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code changeLease}: the proposed-lease-id header plus the optional snapshot + * query parameter, scoped to the resource. The current lease id is passed to the protocol method as an explicit + * parameter. + */ + public static RequestOptions changeLeaseRequestOptions(String resourcePath, String proposedLeaseId, String snapshot, + Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_PROPOSED_LEASE_ID, proposedLeaseId); + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code breakLease}: the lease-break-period header plus the optional snapshot + * query parameter, scoped to the resource. + */ + public static RequestOptions breakLeaseRequestOptions(String resourcePath, Integer breakPeriod, String snapshot, + Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_LEASE_BREAK_PERIOD, breakPeriod); + addSnapshot(requestOptions, snapshot); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** Adds the file HTTP content headers ({@code x-ms-content-*}, {@code x-ms-cache-control}). */ + public static void addFileHttpHeaders(RequestOptions requestOptions, ShareFileHttpHeaders httpHeaders) { + if (httpHeaders != null) { + addHeader(requestOptions, X_MS_CONTENT_TYPE, httpHeaders.getContentType()); + addHeader(requestOptions, X_MS_CONTENT_ENCODING, httpHeaders.getContentEncoding()); + addHeader(requestOptions, X_MS_CONTENT_LANGUAGE, httpHeaders.getContentLanguage()); + addHeader(requestOptions, X_MS_CACHE_CONTROL, httpHeaders.getCacheControl()); + if (httpHeaders.getContentMd5() != null) { + addHeader(requestOptions, X_MS_CONTENT_MD5, + Base64.getEncoder().encodeToString(httpHeaders.getContentMd5())); + } + addHeader(requestOptions, X_MS_CONTENT_DISPOSITION, httpHeaders.getContentDisposition()); + } + } + + /** + * Builds the {@link RequestOptions} for {@code File.setHttpHeaders}: content-length, HTTP content headers, file + * permission, SMB and POSIX properties plus lease, scoped to the file resource. + */ + public static RequestOptions setFileHttpHeadersRequestOptions(String resourcePath, Long fileContentLength, + String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, + String ntfsFileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, + String leaseId, FilePosixProperties posixProperties, ShareFileHttpHeaders httpHeaders, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_CONTENT_LENGTH, fileContentLength); + addFileHttpHeaders(requestOptions, httpHeaders); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addSmbProperties(requestOptions, filePermissionKey, ntfsFileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime); + addLeaseId(requestOptions, leaseId); + addPosixProperties(requestOptions, posixProperties); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.createSymbolicLink}: metadata, creation/last-write times, + * lease and NFS owner/group, scoped to the file resource. The link text is passed to the protocol method as an + * explicit parameter. + */ + public static RequestOptions createSymbolicLinkRequestOptions(String resourcePath, Map metadata, + String fileCreationTime, String fileLastWriteTime, String leaseId, String owner, String group, + Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addMetadata(requestOptions, metadata); + addHeader(requestOptions, X_MS_FILE_CREATION_TIME, fileCreationTime); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, fileLastWriteTime); + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_OWNER, owner); + addHeader(requestOptions, X_MS_GROUP, group); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.rename}: the directory rename headers plus the file HTTP + * content headers, scoped to the destination file resource. + */ + public static RequestOptions renameFileRequestOptions(String resourcePath, Boolean replaceIfExists, + Boolean ignoreReadOnly, String filePermission, FilePermissionFormat filePermissionFormat, + String filePermissionKey, Map metadata, SourceLeaseAccessConditions sourceConditions, + DestinationLeaseAccessConditions destinationConditions, CopyFileSmbInfo smbInfo, + ShareFileHttpHeaders httpHeaders, Context context) { + RequestOptions requestOptions = renameDirectoryRequestOptions(resourcePath, replaceIfExists, ignoreReadOnly, + filePermission, filePermissionFormat, filePermissionKey, metadata, sourceConditions, destinationConditions, + smbInfo, context); + addFileHttpHeaders(requestOptions, httpHeaders); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.getRangeList}: the snapshot/previous-snapshot query parameters, + * the range and support-rename headers plus lease, scoped to the file resource. + */ + public static RequestOptions getRangeListRequestOptions(String resourcePath, String snapshot, + String previousSnapshot, String range, String leaseId, Boolean supportRename, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addSnapshot(requestOptions, snapshot); + if (previousSnapshot != null) { + requestOptions.addQueryParam("prevsharesnapshot", previousSnapshot, false); + } + if (range != null) { + requestOptions.setHeader(HttpHeaderName.RANGE, range); + } + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_FILE_SUPPORT_RENAME, supportRename); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.uploadRangeFromUrl}: the source range, lease, copy-source + * authorization and last-written mode headers, scoped to the file resource. The destination range, copy source, + * write mode and content length are passed to the protocol method as explicit parameters. + */ + public static RequestOptions uploadRangeFromUrlRequestOptions(String resourcePath, String sourceRange, + String leaseId, String sourceAuthorization, FileLastWrittenMode lastWrittenMode, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_SOURCE_RANGE, sourceRange); + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_COPY_SOURCE_AUTHORIZATION, sourceAuthorization); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, lastWrittenMode); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.create}: content headers, metadata, file permission, SMB and + * POSIX properties, content MD5, file-property semantics and the optional request body, scoped to the file + * resource. The target file content length is passed to the protocol method as an explicit parameter. + */ + public static RequestOptions createFileRequestOptions(String resourcePath, Map metadata, + String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, + String ntfsFileAttributes, String fileCreationTime, String fileLastWriteTime, String fileChangeTime, + String leaseId, FilePosixProperties posixProperties, byte[] contentMd5, + FilePropertySemantics filePropertySemantics, ShareFileHttpHeaders httpHeaders, BinaryData data, + Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addMetadata(requestOptions, metadata); + addFileHttpHeaders(requestOptions, httpHeaders); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addSmbProperties(requestOptions, filePermissionKey, ntfsFileAttributes, fileCreationTime, fileLastWriteTime, + fileChangeTime); + addLeaseId(requestOptions, leaseId); + addPosixProperties(requestOptions, posixProperties); + if (posixProperties != null) { + addHeader(requestOptions, X_MS_FILE_FILE_TYPE, posixProperties.getFileType()); + } + if (contentMd5 != null) { + requestOptions.setHeader(HttpHeaderName.CONTENT_MD5, Base64.getEncoder().encodeToString(contentMd5)); + } + addHeader(requestOptions, X_MS_FILE_PROPERTY_SEMANTICS, filePropertySemantics); + if (data != null) { + requestOptions.setBody(data); + } + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.startCopy}: metadata, permission, lease, POSIX properties, the + * mode/owner copy modes and the copy SMB info headers, scoped to the file resource. The copy source is passed to + * the protocol method as an explicit parameter. + */ + public static RequestOptions startCopyRequestOptions(String resourcePath, Map metadata, + String filePermission, FilePermissionFormat filePermissionFormat, String filePermissionKey, String leaseId, + String owner, String group, Object fileMode, Object modeCopyMode, Object ownerCopyMode, + CopyFileSmbInfo copyFileSmbInfo, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addMetadata(requestOptions, metadata); + addHeader(requestOptions, X_MS_FILE_PERMISSION, filePermission); + addFilePermissionFormat(requestOptions, filePermissionFormat); + addHeader(requestOptions, X_MS_FILE_PERMISSION_KEY, filePermissionKey); + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_OWNER, owner); + addHeader(requestOptions, X_MS_GROUP, group); + addHeader(requestOptions, X_MS_MODE, fileMode); + addHeader(requestOptions, X_MS_FILE_MODE_COPY_MODE, modeCopyMode); + addHeader(requestOptions, X_MS_FILE_OWNER_COPY_MODE, ownerCopyMode); + if (copyFileSmbInfo != null) { + addHeader(requestOptions, X_MS_FILE_PERMISSION_COPY_MODE, copyFileSmbInfo.getFilePermissionCopyMode()); + addHeader(requestOptions, X_MS_FILE_ATTRIBUTES, copyFileSmbInfo.getFileAttributes()); + addHeader(requestOptions, X_MS_FILE_CREATION_TIME, copyFileSmbInfo.getFileCreationTime()); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, copyFileSmbInfo.getFileLastWriteTime()); + addHeader(requestOptions, X_MS_FILE_CHANGE_TIME, copyFileSmbInfo.getFileChangeTime()); + addHeader(requestOptions, X_MS_FILE_COPY_IGNORE_READONLY, copyFileSmbInfo.isIgnoreReadOnly()); + addHeader(requestOptions, X_MS_FILE_COPY_SET_ARCHIVE, copyFileSmbInfo.isSetArchiveAttribute()); + } + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.uploadRange}: the lease, last-written mode and optional content + * MD5 headers plus the request body, scoped to the file resource. The range, write mode and content length are + * passed to the protocol method as explicit parameters. + */ + public static RequestOptions uploadRangeRequestOptions(String resourcePath, String leaseId, + FileLastWrittenMode lastWrittenMode, byte[] contentMd5, BinaryData data, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addLeaseId(requestOptions, leaseId); + addHeader(requestOptions, X_MS_FILE_LAST_WRITE_TIME, lastWrittenMode); + if (contentMd5 != null) { + requestOptions.setHeader(HttpHeaderName.CONTENT_MD5, Base64.getEncoder().encodeToString(contentMd5)); + } + if (data != null) { + requestOptions.setBody(data); + } + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** + * Builds the {@link RequestOptions} for {@code File.download}: the range, range-get-content-md5 and lease headers, + * scoped to the file resource. + */ + public static RequestOptions downloadRequestOptions(String resourcePath, String range, Boolean rangeGetContentMd5, + String leaseId, Context context) { + RequestOptions requestOptions = new RequestOptions().setContext(context); + addHeader(requestOptions, X_MS_RANGE, range); + addHeader(requestOptions, X_MS_RANGE_GET_CONTENT_MD5, rangeGetContentMd5); + addLeaseId(requestOptions, leaseId); + scopeRequestToResourcePath(requestOptions, resourcePath); + return requestOptions; + } + + /** Sets {@code name} to {@code String.valueOf(value)} when {@code value} is non-null. */ + private static void addHeader(RequestOptions requestOptions, HttpHeaderName name, Object value) { + if (value != null) { + requestOptions.setHeader(name, String.valueOf(value)); + } + } + + private RequestOptionsHelper() { + } +} 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 index d3969c043497..1ed9c3a7b488 100644 --- 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 @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -14,18 +13,19 @@ import javax.xml.stream.XMLStreamException; /** - * The ClearRange model. + * A clear range. */ @Fluent public final class ClearRange implements XmlSerializable { + /* - * The Start property. + * Start of the range. */ @Generated private long start; /* - * The End property. + * End of the range. */ @Generated private long end; @@ -38,8 +38,20 @@ public ClearRange() { } /** - * Get the start property: The Start property. - * + * Creates an instance of ClearRange class. + * + * @param start the start value to set. + * @param end the end value to set. + */ + @Generated + private ClearRange(long start, long end) { + this.start = start; + this.end = end; + } + + /** + * Get the start property: Start of the range. + * * @return the start value. */ @Generated @@ -48,8 +60,8 @@ public long getStart() { } /** - * Set the start property: The Start property. - * + * Set the start property. + * * @param start the start value to set. * @return the ClearRange object itself. */ @@ -60,8 +72,8 @@ public ClearRange setStart(long start) { } /** - * Get the end property: The End property. - * + * Get the end property: End of the range. + * * @return the end value. */ @Generated @@ -70,8 +82,8 @@ public long getEnd() { } /** - * Set the end property: The End property. - * + * Set the end property. + * * @param end the end value to set. * @return the ClearRange object itself. */ @@ -99,10 +111,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of ClearRange from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ClearRange if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ClearRange. */ @Generated @@ -112,12 +125,13 @@ public static ClearRange fromXml(XmlReader xmlReader) throws XMLStreamException /** * Reads an instance of ClearRange from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of ClearRange if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ClearRange. */ @Generated @@ -125,20 +139,19 @@ public static ClearRange fromXml(XmlReader xmlReader, String rootElementName) th String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "ClearRange" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ClearRange deserializedClearRange = new ClearRange(); + long start = 0L; + long end = 0L; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Start".equals(elementName.getLocalPart())) { - deserializedClearRange.start = reader.getLongElement(); + start = reader.getLongElement(); } else if ("End".equals(elementName.getLocalPart())) { - deserializedClearRange.end = reader.getLongElement(); + end = reader.getLongElement(); } else { reader.skipElement(); } } - - return deserializedClearRange; + return new ClearRange(start, end); }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileLastWrittenMode.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileLastWrittenMode.java index 9fa71849d4ff..6a4a7266f725 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileLastWrittenMode.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FileLastWrittenMode.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for FileLastWrittenMode. + * The file last written mode. */ public enum FileLastWrittenMode { /** - * Enum value Now. + * Now. */ NOW("Now"), /** - * Enum value Preserve. + * Preserve. */ PRESERVE("Preserve"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePermissionFormat.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePermissionFormat.java index 1d27e03370b1..7dfc63cd996a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePermissionFormat.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePermissionFormat.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for FilePermissionFormat. + * The file permission format. */ public enum FilePermissionFormat { /** - * Enum value Sddl. + * Sddl. */ SDDL("Sddl"), /** - * Enum value Binary. + * Binary. */ BINARY("Binary"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePropertySemantics.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePropertySemantics.java index 09d3dbc64747..9d1c591c76c0 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePropertySemantics.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/FilePropertySemantics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,17 +9,17 @@ import java.util.Collection; /** - * Defines values for FilePropertySemantics. + * The file property semantics. */ public final class FilePropertySemantics extends ExpandableStringEnum { /** - * Static value New for FilePropertySemantics. + * New. */ @Generated public static final FilePropertySemantics NEW = fromString("New"); /** - * Static value Restore for FilePropertySemantics. + * Restore. */ @Generated public static final FilePropertySemantics RESTORE = fromString("Restore"); 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 index 879911696146..3671fa342237 100644 --- 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 @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -18,6 +17,7 @@ */ @Fluent public final class FileRange implements XmlSerializable { + /* * Start of the range. */ @@ -37,9 +37,21 @@ public final class FileRange implements XmlSerializable { public FileRange() { } + /** + * Creates an instance of FileRange class. + * + * @param start the start value to set. + * @param end the end value to set. + */ + @Generated + private FileRange(long start, long end) { + this.start = start; + this.end = end; + } + /** * Get the start property: Start of the range. - * + * * @return the start value. */ @Generated @@ -48,8 +60,8 @@ public long getStart() { } /** - * Set the start property: Start of the range. - * + * Set the start property. + * * @param start the start value to set. * @return the FileRange object itself. */ @@ -61,7 +73,7 @@ public FileRange setStart(long start) { /** * Get the end property: End of the range. - * + * * @return the end value. */ @Generated @@ -70,8 +82,8 @@ public long getEnd() { } /** - * Set the end property: End of the range. - * + * Set the end property. + * * @param end the end value to set. * @return the FileRange object itself. */ @@ -99,10 +111,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of FileRange from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of FileRange if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileRange. */ @Generated @@ -112,32 +125,32 @@ public static FileRange fromXml(XmlReader xmlReader) throws XMLStreamException { /** * Reads an instance of FileRange from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of FileRange if the XmlReader was pointing to an instance of it, or null if it was pointing * to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the FileRange. */ @Generated public static FileRange fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Range" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - FileRange deserializedFileRange = new FileRange(); + long start = 0L; + long end = 0L; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Start".equals(elementName.getLocalPart())) { - deserializedFileRange.start = reader.getLongElement(); + start = reader.getLongElement(); } else if ("End".equals(elementName.getLocalPart())) { - deserializedFileRange.end = reader.getLongElement(); + end = reader.getLongElement(); } else { reader.skipElement(); } } - - return deserializedFileRange; + return new FileRange(start, end); }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseDurationType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseDurationType.java index b065e6d5b08a..39c3bed0ce9c 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseDurationType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseDurationType.java @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * When a share is leased, specifies whether the lease is of infinite or fixed duration. + * When a share is leased, specifies whether the lease is of infinite or fixed + * duration. */ public enum LeaseDurationType { /** - * Enum value infinite. + * infinite. */ INFINITE("infinite"), /** - * Enum value fixed. + * fixed. */ FIXED("fixed"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStateType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStateType.java index e00c467b6e96..ed07b186ac83 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStateType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStateType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,27 +9,27 @@ */ public enum LeaseStateType { /** - * Enum value available. + * available. */ AVAILABLE("available"), /** - * Enum value leased. + * leased. */ LEASED("leased"), /** - * Enum value expired. + * expired. */ EXPIRED("expired"), /** - * Enum value breaking. + * breaking. */ BREAKING("breaking"), /** - * Enum value broken. + * broken. */ BROKEN("broken"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStatusType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStatusType.java index 872d8e77c233..4c62a6487679 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStatusType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/LeaseStatusType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,12 +9,12 @@ */ public enum LeaseStatusType { /** - * Enum value locked. + * locked. */ LOCKED("locked"), /** - * Enum value unlocked. + * unlocked. */ UNLOCKED("unlocked"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ModeCopyMode.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ModeCopyMode.java index e9908d9bdc1b..d16f9defb9d3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ModeCopyMode.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ModeCopyMode.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for ModeCopyMode. + * The mode copy mode. */ public enum ModeCopyMode { /** - * Enum value source. + * source. */ SOURCE("source"), /** - * Enum value override. + * override. */ OVERRIDE("override"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java index 42d241442282..dc2f39d7b581 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,30 +9,30 @@ import java.util.Collection; /** - * Defines values for NfsFileType. + * The NFS file type. */ public final class NfsFileType extends ExpandableStringEnum { /** - * Static value Regular for NfsFileType. + * Regular. */ @Generated public static final NfsFileType REGULAR = fromString("Regular"); /** - * Static value Directory for NfsFileType. + * Directory. */ @Generated public static final NfsFileType DIRECTORY = fromString("Directory"); /** - * Static value SymLink for NfsFileType. + * SymLink. */ @Generated public static final NfsFileType SYM_LINK = fromString("SymLink"); /** * Creates a new instance of NfsFileType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -42,7 +42,7 @@ public NfsFileType() { /** * Creates or finds a NfsFileType from its string representation. - * + * * @param name a name to look for. * @return the corresponding NfsFileType. */ @@ -53,7 +53,7 @@ public static NfsFileType fromString(String name) { /** * Gets known NfsFileType values. - * + * * @return known NfsFileType values. */ @Generated diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/OwnerCopyMode.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/OwnerCopyMode.java index 657a96030d45..37c1f0a4c988 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/OwnerCopyMode.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/OwnerCopyMode.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for OwnerCopyMode. + * The owner copy mode. */ public enum OwnerCopyMode { /** - * Enum value source. + * source. */ SOURCE("source"), /** - * Enum value override. + * override. */ OVERRIDE("override"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/PermissionCopyModeType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/PermissionCopyModeType.java index bc14fbda053f..1d5387362489 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/PermissionCopyModeType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/PermissionCopyModeType.java @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for PermissionCopyModeType. + * The permission copy mode type. */ public enum PermissionCopyModeType { /** - * Enum value source. + * source. */ SOURCE("source"), /** - * Enum value override. + * override. */ OVERRIDE("override"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessPolicy.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessPolicy.java index 1e42a446e87f..95b33932bb23 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessPolicy.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -121,7 +121,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ShareAccessPolicy" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "AccessPolicy" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeStringElement("Start", this.startsOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startsOn)); @@ -157,7 +157,7 @@ public static ShareAccessPolicy fromXml(XmlReader xmlReader) throws XMLStreamExc @Generated public static ShareAccessPolicy fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "ShareAccessPolicy" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "AccessPolicy" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { ShareAccessPolicy deserializedShareAccessPolicy = new ShareAccessPolicy(); while (reader.nextElement() != XmlToken.END_ELEMENT) { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessTier.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessTier.java index 9db1dce97296..a6a200f202cb 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessTier.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareAccessTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,29 +9,29 @@ import java.util.Collection; /** - * Defines values for ShareAccessTier. + * The access tier of the share. */ public final class ShareAccessTier extends ExpandableStringEnum { /** - * Static value TransactionOptimized for ShareAccessTier. + * TransactionOptimized. */ @Generated public static final ShareAccessTier TRANSACTION_OPTIMIZED = fromString("TransactionOptimized"); /** - * Static value Hot for ShareAccessTier. + * Hot. */ @Generated public static final ShareAccessTier HOT = fromString("Hot"); /** - * Static value Cool for ShareAccessTier. + * Cool. */ @Generated public static final ShareAccessTier COOL = fromString("Cool"); /** - * Static value Premium for ShareAccessTier. + * Premium. */ @Generated public static final ShareAccessTier PREMIUM = fromString("Premium"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareCorsRule.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareCorsRule.java index 78bd5058d79f..f255e0f4e3ba 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareCorsRule.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareCorsRule.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -14,24 +13,28 @@ import javax.xml.stream.XMLStreamException; /** - * CORS is an HTTP feature that enables a web application running under one domain to access resources in another - * domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from - * calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs - * in another domain. + * CORS is an HTTP feature that enables a web application running under one domain + * to access resources in another domain. Web browsers implement a security + * restriction known as same-origin policy that prevents a web page from calling + * APIs in a different domain; CORS provides a secure way to allow one domain (the + * origin domain) to call APIs in another domain. */ @Fluent public final class ShareCorsRule implements XmlSerializable { + /* - * The origin domains that are permitted to make a request against the storage service via CORS. The origin domain - * is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with - * the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all - * origin domains to make requests via CORS. + * The origin domains that are permitted to make a request against the storage + * service via CORS. The origin domain is the domain from which the request + * originates. Note that the origin must be an exact case-sensitive match with the + * origin that the user age sends to the service. You can also use the wildcard + * character '*' to allow all origin domains to make requests via CORS. */ @Generated private String allowedOrigins; /* - * The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) + * The methods (HTTP request verbs) that the origin domain may use for a CORS + * request. (comma separated) */ @Generated private String allowedMethods; @@ -43,14 +46,15 @@ public final class ShareCorsRule implements XmlSerializable { private String allowedHeaders; /* - * The response headers that may be sent in the response to the CORS request and exposed by the browser to the - * request issuer. + * The response headers that may be sent in the response to the CORS request and + * exposed by the browser to the request issuer. */ @Generated private String exposedHeaders; /* - * The maximum amount time that a browser should cache the preflight OPTIONS request. + * The maximum amount time that a browser should cache the preflight OPTIONS + * request. */ @Generated private int maxAgeInSeconds; @@ -62,12 +66,32 @@ public final class ShareCorsRule implements XmlSerializable { public ShareCorsRule() { } + /** + * Creates an instance of ShareCorsRule class. + * + * @param allowedOrigins the allowedOrigins value to set. + * @param allowedMethods the allowedMethods value to set. + * @param allowedHeaders the allowedHeaders value to set. + * @param exposedHeaders the exposedHeaders value to set. + * @param maxAgeInSeconds the maxAgeInSeconds value to set. + */ + @Generated + public ShareCorsRule(String allowedOrigins, String allowedMethods, String allowedHeaders, String exposedHeaders, + int maxAgeInSeconds) { + this.allowedOrigins = allowedOrigins; + this.allowedMethods = allowedMethods; + this.allowedHeaders = allowedHeaders; + this.exposedHeaders = exposedHeaders; + this.maxAgeInSeconds = maxAgeInSeconds; + } + /** * Get the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. - * + * service via CORS. The origin domain is the domain from which the request + * originates. Note that the origin must be an exact case-sensitive match with the + * origin that the user age sends to the service. You can also use the wildcard + * character '*' to allow all origin domains to make requests via CORS. + * * @return the allowedOrigins value. */ @Generated @@ -76,11 +100,8 @@ public String getAllowedOrigins() { } /** - * Set the allowedOrigins property: The origin domains that are permitted to make a request against the storage - * service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be - * an exact case-sensitive match with the origin that the user age sends to the service. You can also use the - * wildcard character '*' to allow all origin domains to make requests via CORS. - * + * Set the allowedOrigins property. + * * @param allowedOrigins the allowedOrigins value to set. * @return the ShareCorsRule object itself. */ @@ -93,7 +114,7 @@ public ShareCorsRule setAllowedOrigins(String allowedOrigins) { /** * Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS * request. (comma separated). - * + * * @return the allowedMethods value. */ @Generated @@ -102,9 +123,8 @@ public String getAllowedMethods() { } /** - * Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS - * request. (comma separated). - * + * Set the allowedMethods property. + * * @param allowedMethods the allowedMethods value to set. * @return the ShareCorsRule object itself. */ @@ -116,7 +136,7 @@ public ShareCorsRule setAllowedMethods(String allowedMethods) { /** * Get the allowedHeaders property: The request headers that the origin domain may specify on the CORS request. - * + * * @return the allowedHeaders value. */ @Generated @@ -125,8 +145,8 @@ public String getAllowedHeaders() { } /** - * Set the allowedHeaders property: The request headers that the origin domain may specify on the CORS request. - * + * Set the allowedHeaders property. + * * @param allowedHeaders the allowedHeaders value to set. * @return the ShareCorsRule object itself. */ @@ -139,7 +159,7 @@ public ShareCorsRule setAllowedHeaders(String allowedHeaders) { /** * Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and * exposed by the browser to the request issuer. - * + * * @return the exposedHeaders value. */ @Generated @@ -148,9 +168,8 @@ public String getExposedHeaders() { } /** - * Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and - * exposed by the browser to the request issuer. - * + * Set the exposedHeaders property. + * * @param exposedHeaders the exposedHeaders value to set. * @return the ShareCorsRule object itself. */ @@ -163,7 +182,7 @@ public ShareCorsRule setExposedHeaders(String exposedHeaders) { /** * Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS * request. - * + * * @return the maxAgeInSeconds value. */ @Generated @@ -172,9 +191,8 @@ public int getMaxAgeInSeconds() { } /** - * Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS - * request. - * + * Set the maxAgeInSeconds property. + * * @param maxAgeInSeconds the maxAgeInSeconds value to set. * @return the ShareCorsRule object itself. */ @@ -205,10 +223,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of ShareCorsRule from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ShareCorsRule if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareCorsRule. */ @Generated @@ -218,12 +237,13 @@ public static ShareCorsRule fromXml(XmlReader xmlReader) throws XMLStreamExcepti /** * Reads an instance of ShareCorsRule from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of ShareCorsRule if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareCorsRule. */ @Generated @@ -231,26 +251,28 @@ public static ShareCorsRule fromXml(XmlReader xmlReader, String rootElementName) String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "CorsRule" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ShareCorsRule deserializedShareCorsRule = new ShareCorsRule(); + String allowedOrigins = null; + String allowedMethods = null; + String allowedHeaders = null; + String exposedHeaders = null; + int maxAgeInSeconds = 0; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("AllowedOrigins".equals(elementName.getLocalPart())) { - deserializedShareCorsRule.allowedOrigins = reader.getStringElement(); + allowedOrigins = reader.getStringElement(); } else if ("AllowedMethods".equals(elementName.getLocalPart())) { - deserializedShareCorsRule.allowedMethods = reader.getStringElement(); + allowedMethods = reader.getStringElement(); } else if ("AllowedHeaders".equals(elementName.getLocalPart())) { - deserializedShareCorsRule.allowedHeaders = reader.getStringElement(); + allowedHeaders = reader.getStringElement(); } else if ("ExposedHeaders".equals(elementName.getLocalPart())) { - deserializedShareCorsRule.exposedHeaders = reader.getStringElement(); + exposedHeaders = reader.getStringElement(); } else if ("MaxAgeInSeconds".equals(elementName.getLocalPart())) { - deserializedShareCorsRule.maxAgeInSeconds = reader.getIntElement(); + maxAgeInSeconds = reader.getIntElement(); } else { reader.skipElement(); } } - - return deserializedShareCorsRule; + return new ShareCorsRule(allowedOrigins, allowedMethods, allowedHeaders, exposedHeaders, maxAgeInSeconds); }); } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileHandleAccessRights.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileHandleAccessRights.java index 6941120c8d2f..6fb5a1f25366 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileHandleAccessRights.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileHandleAccessRights.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -9,17 +9,17 @@ */ public enum ShareFileHandleAccessRights { /** - * Enum value Read. + * Read. */ READ("Read"), /** - * Enum value Write. + * Write. */ WRITE("Write"), /** - * Enum value Delete. + * Delete. */ DELETE("Delete"); 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 17df7e78798a..0d0443808903 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 @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -20,24 +19,19 @@ */ @Fluent public final class ShareFileRangeList implements XmlSerializable { + /* - * The Ranges property. + * The file ranges. */ @Generated private List ranges = new ArrayList<>(); /* - * The ClearRanges property. + * The clear ranges. */ @Generated private List clearRanges = new ArrayList<>(); - /* - * The NextMarker property. - */ - @Generated - private String nextMarker; - /** * Creates an instance of ShareFileRangeList class. */ @@ -46,8 +40,8 @@ public ShareFileRangeList() { } /** - * Get the ranges property: The Ranges property. - * + * Get the ranges property: The file ranges. + * * @return the ranges value. */ @Generated @@ -56,8 +50,8 @@ public List getRanges() { } /** - * Set the ranges property: The Ranges property. - * + * Set the ranges property. + * * @param ranges the ranges value to set. * @return the ShareFileRangeList object itself. */ @@ -68,8 +62,8 @@ public ShareFileRangeList setRanges(List ranges) { } /** - * Get the clearRanges property: The ClearRanges property. - * + * Get the clearRanges property: The clear ranges. + * * @return the clearRanges value. */ @Generated @@ -78,8 +72,8 @@ public List getClearRanges() { } /** - * Set the clearRanges property: The ClearRanges property. - * + * Set the clearRanges property. + * * @param clearRanges the clearRanges value to set. * @return the ShareFileRangeList object itself. */ @@ -89,28 +83,6 @@ 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 { @@ -132,13 +104,12 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeXml(element, "ClearRange"); } } - xmlWriter.writeStringElement("NextMarker", this.nextMarker); return xmlWriter.writeEndElement(); } /** * Reads an instance of ShareFileRangeList from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ShareFileRangeList if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. @@ -151,7 +122,7 @@ public static ShareFileRangeList fromXml(XmlReader xmlReader) throws XMLStreamEx /** * Reads an instance of ShareFileRangeList from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. @@ -166,18 +137,14 @@ public static ShareFileRangeList fromXml(XmlReader xmlReader, String rootElement ShareFileRangeList deserializedShareFileRangeList = new ShareFileRangeList(); while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Range".equals(elementName.getLocalPart())) { 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(); } } - return deserializedShareFileRangeList; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareMetrics.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareMetrics.java index 718d61119d36..9646e9757a48 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareMetrics.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareMetrics.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -18,6 +17,7 @@ */ @Fluent public final class ShareMetrics implements XmlSerializable { + /* * The version of Storage Analytics to configure. */ @@ -31,7 +31,8 @@ public final class ShareMetrics implements XmlSerializable { private boolean enabled; /* - * Indicates whether metrics should generate summary statistics for called API operations. + * Indicates whether metrics should generate summary statistics for called API + * operations. */ @Generated private Boolean includeApis; @@ -49,9 +50,21 @@ public final class ShareMetrics implements XmlSerializable { public ShareMetrics() { } + /** + * Creates an instance of ShareMetrics class. + * + * @param version the version value to set. + * @param enabled the enabled value to set. + */ + @Generated + public ShareMetrics(String version, boolean enabled) { + this.version = version; + this.enabled = enabled; + } + /** * Get the version property: The version of Storage Analytics to configure. - * + * * @return the version value. */ @Generated @@ -60,8 +73,8 @@ public String getVersion() { } /** - * Set the version property: The version of Storage Analytics to configure. - * + * Set the version property. + * * @param version the version value to set. * @return the ShareMetrics object itself. */ @@ -73,7 +86,7 @@ public ShareMetrics setVersion(String version) { /** * Get the enabled property: Indicates whether metrics are enabled for the File service. - * + * * @return the enabled value. */ @Generated @@ -82,8 +95,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether metrics are enabled for the File service. - * + * Set the enabled property. + * * @param enabled the enabled value to set. * @return the ShareMetrics object itself. */ @@ -96,7 +109,7 @@ public ShareMetrics setEnabled(boolean enabled) { /** * Get the includeApis property: Indicates whether metrics should generate summary statistics for called API * operations. - * + * * @return the includeApis value. */ @Generated @@ -107,7 +120,7 @@ public Boolean isIncludeApis() { /** * Set the includeApis property: Indicates whether metrics should generate summary statistics for called API * operations. - * + * * @param includeApis the includeApis value to set. * @return the ShareMetrics object itself. */ @@ -119,7 +132,7 @@ public ShareMetrics setIncludeApis(Boolean includeApis) { /** * Get the retentionPolicy property: The retention policy. - * + * * @return the retentionPolicy value. */ @Generated @@ -129,7 +142,7 @@ public ShareRetentionPolicy getRetentionPolicy() { /** * Set the retentionPolicy property: The retention policy. - * + * * @param retentionPolicy the retentionPolicy value to set. * @return the ShareMetrics object itself. */ @@ -148,7 +161,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "ShareMetrics" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Metrics" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeStringElement("Version", this.version); xmlWriter.writeBooleanElement("Enabled", this.enabled); @@ -159,10 +172,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of ShareMetrics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ShareMetrics if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareMetrics. */ @Generated @@ -172,36 +186,41 @@ public static ShareMetrics fromXml(XmlReader xmlReader) throws XMLStreamExceptio /** * Reads an instance of ShareMetrics from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of ShareMetrics if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareMetrics. */ @Generated public static ShareMetrics fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "ShareMetrics" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "Metrics" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ShareMetrics deserializedShareMetrics = new ShareMetrics(); + String version = null; + boolean enabled = false; + Boolean includeApis = null; + ShareRetentionPolicy retentionPolicy = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Version".equals(elementName.getLocalPart())) { - deserializedShareMetrics.version = reader.getStringElement(); + version = reader.getStringElement(); } else if ("Enabled".equals(elementName.getLocalPart())) { - deserializedShareMetrics.enabled = reader.getBooleanElement(); + enabled = reader.getBooleanElement(); } else if ("IncludeAPIs".equals(elementName.getLocalPart())) { - deserializedShareMetrics.includeApis = reader.getNullableElement(Boolean::parseBoolean); + includeApis = reader.getNullableElement(Boolean::parseBoolean); } else if ("RetentionPolicy".equals(elementName.getLocalPart())) { - deserializedShareMetrics.retentionPolicy = ShareRetentionPolicy.fromXml(reader, "RetentionPolicy"); + retentionPolicy = ShareRetentionPolicy.fromXml(reader, "RetentionPolicy"); } else { reader.skipElement(); } } - + ShareMetrics deserializedShareMetrics = new ShareMetrics(version, enabled); + deserializedShareMetrics.includeApis = includeApis; + deserializedShareMetrics.retentionPolicy = retentionPolicy; return deserializedShareMetrics; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettings.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettings.java index 73a774a63d08..6b02de8d7607 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettings.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -14,7 +14,7 @@ import javax.xml.stream.XMLStreamException; /** - * Settings for SMB protocol. + * Settings for NFS protocol. */ @Fluent public final class ShareNfsSettings implements XmlSerializable { diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettingsEncryptionInTransit.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettingsEncryptionInTransit.java index 3ab4d10f37a2..43bcac5227cc 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettingsEncryptionInTransit.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareNfsSettingsEncryptionInTransit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProtocolSettings.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProtocolSettings.java index 31dc752c64ad..c4d639121c45 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProtocolSettings.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProtocolSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRetentionPolicy.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRetentionPolicy.java index 0783d2157471..b4691c332d49 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRetentionPolicy.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRetentionPolicy.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -18,16 +17,18 @@ */ @Fluent public final class ShareRetentionPolicy implements XmlSerializable { + /* - * Indicates whether a retention policy is enabled for the File service. If false, metrics data is retained, and the - * user is responsible for deleting it. + * Indicates whether a retention policy is enabled for the File service. If false, + * metrics data is retained, and the user is responsible for deleting it. */ @Generated private boolean enabled; /* - * Indicates the number of days that metrics data should be retained. All data older than this value will be - * deleted. Metrics data is deleted on a best-effort basis after the retention period expires. + * Indicates the number of days that metrics data should be retained. All data + * older than this value will be deleted. Metrics data is deleted on a best-effort + * basis after the retention period expires. */ @Generated private Integer days; @@ -40,9 +41,19 @@ public ShareRetentionPolicy() { } /** - * Get the enabled property: Indicates whether a retention policy is enabled for the File service. If false, metrics - * data is retained, and the user is responsible for deleting it. - * + * Creates an instance of ShareRetentionPolicy class. + * + * @param enabled the enabled value to set. + */ + @Generated + public ShareRetentionPolicy(boolean enabled) { + this.enabled = enabled; + } + + /** + * Get the enabled property: Indicates whether a retention policy is enabled for the File service. If false, + * metrics data is retained, and the user is responsible for deleting it. + * * @return the enabled value. */ @Generated @@ -51,9 +62,8 @@ public boolean isEnabled() { } /** - * Set the enabled property: Indicates whether a retention policy is enabled for the File service. If false, metrics - * data is retained, and the user is responsible for deleting it. - * + * Set the enabled property. + * * @param enabled the enabled value to set. * @return the ShareRetentionPolicy object itself. */ @@ -64,9 +74,10 @@ public ShareRetentionPolicy setEnabled(boolean enabled) { } /** - * Get the days property: Indicates the number of days that metrics data should be retained. All data older than - * this value will be deleted. Metrics data is deleted on a best-effort basis after the retention period expires. - * + * Get the days property: Indicates the number of days that metrics data should be retained. All data + * older than this value will be deleted. Metrics data is deleted on a best-effort + * basis after the retention period expires. + * * @return the days value. */ @Generated @@ -75,9 +86,10 @@ public Integer getDays() { } /** - * Set the days property: Indicates the number of days that metrics data should be retained. All data older than - * this value will be deleted. Metrics data is deleted on a best-effort basis after the retention period expires. - * + * Set the days property: Indicates the number of days that metrics data should be retained. All data + * older than this value will be deleted. Metrics data is deleted on a best-effort + * basis after the retention period expires. + * * @param days the days value to set. * @return the ShareRetentionPolicy object itself. */ @@ -96,8 +108,7 @@ public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName - = rootElementName == null || rootElementName.isEmpty() ? "ShareRetentionPolicy" : rootElementName; + rootElementName = rootElementName == null || rootElementName.isEmpty() ? "RetentionPolicy" : rootElementName; xmlWriter.writeStartElement(rootElementName); xmlWriter.writeBooleanElement("Enabled", this.enabled); xmlWriter.writeNumberElement("Days", this.days); @@ -106,10 +117,11 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt /** * Reads an instance of ShareRetentionPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @return An instance of ShareRetentionPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareRetentionPolicy. */ @Generated @@ -119,32 +131,34 @@ public static ShareRetentionPolicy fromXml(XmlReader xmlReader) throws XMLStream /** * Reads an instance of ShareRetentionPolicy from the XmlReader. - * + * * @param xmlReader The XmlReader being read. * @param rootElementName Optional root element name to override the default defined by the model. Used to support * cases where the model can deserialize from different root element names. * @return An instance of ShareRetentionPolicy if the XmlReader was pointing to an instance of it, or null if it was * pointing to XML null. + * @throws IllegalStateException If the deserialized XML object was missing any required properties. * @throws XMLStreamException If an error occurs while reading the ShareRetentionPolicy. */ @Generated public static ShareRetentionPolicy fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "ShareRetentionPolicy" : rootElementName; + = rootElementName == null || rootElementName.isEmpty() ? "RetentionPolicy" : rootElementName; return xmlReader.readObject(finalRootElementName, reader -> { - ShareRetentionPolicy deserializedShareRetentionPolicy = new ShareRetentionPolicy(); + boolean enabled = false; + Integer days = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Enabled".equals(elementName.getLocalPart())) { - deserializedShareRetentionPolicy.enabled = reader.getBooleanElement(); + enabled = reader.getBooleanElement(); } else if ("Days".equals(elementName.getLocalPart())) { - deserializedShareRetentionPolicy.days = reader.getNullableElement(Integer::parseInt); + days = reader.getNullableElement(Integer::parseInt); } else { reader.skipElement(); } } - + ShareRetentionPolicy deserializedShareRetentionPolicy = new ShareRetentionPolicy(enabled); + deserializedShareRetentionPolicy.days = days; return deserializedShareRetentionPolicy; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRootSquash.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRootSquash.java index 84b022714b9e..78c6e122f7ac 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRootSquash.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareRootSquash.java @@ -1,25 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; /** - * Defines values for ShareRootSquash. + * The root squash setting for the share. */ public enum ShareRootSquash { /** - * Enum value NoRootSquash. + * NoRootSquash. */ NO_ROOT_SQUASH("NoRootSquash"), /** - * Enum value RootSquash. + * RootSquash. */ ROOT_SQUASH("RootSquash"), /** - * Enum value AllSquash. + * AllSquash. */ ALL_SQUASH("AllSquash"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareServiceProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareServiceProperties.java index 300369a662cc..ad65f177ca83 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareServiceProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareServiceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; @@ -33,16 +33,16 @@ public final class ShareServiceProperties implements XmlSerializable cors; + private ShareProtocolSettings protocol; /* - * Protocol settings + * The set of CORS rules. */ @Generated - private ShareProtocolSettings protocol; + private List cors; /** * Creates an instance of ShareServiceProperties class. @@ -96,49 +96,49 @@ public ShareServiceProperties setMinuteMetrics(ShareMetrics minuteMetrics) { } /** - * Get the cors property: The set of CORS rules. + * Get the protocol property: Protocol settings. * - * @return the cors value. + * @return the protocol value. */ @Generated - public List getCors() { - if (this.cors == null) { - this.cors = new ArrayList<>(); - } - return this.cors; + public ShareProtocolSettings getProtocol() { + return this.protocol; } /** - * Set the cors property: The set of CORS rules. + * Set the protocol property: Protocol settings. * - * @param cors the cors value to set. + * @param protocol the protocol value to set. * @return the ShareServiceProperties object itself. */ @Generated - public ShareServiceProperties setCors(List cors) { - this.cors = cors; + public ShareServiceProperties setProtocol(ShareProtocolSettings protocol) { + this.protocol = protocol; return this; } /** - * Get the protocol property: Protocol settings. + * Get the cors property: The set of CORS rules. * - * @return the protocol value. + * @return the cors value. */ @Generated - public ShareProtocolSettings getProtocol() { - return this.protocol; + public List getCors() { + if (this.cors == null) { + this.cors = new ArrayList<>(); + } + return this.cors; } /** - * Set the protocol property: Protocol settings. + * Set the cors property: The set of CORS rules. * - * @param protocol the protocol value to set. + * @param cors the cors value to set. * @return the ShareServiceProperties object itself. */ @Generated - public ShareServiceProperties setProtocol(ShareProtocolSettings protocol) { - this.protocol = protocol; + public ShareServiceProperties setCors(List cors) { + this.cors = cors; return this; } @@ -156,6 +156,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeStartElement(rootElementName); xmlWriter.writeXml(this.hourMetrics, "HourMetrics"); xmlWriter.writeXml(this.minuteMetrics, "MinuteMetrics"); + xmlWriter.writeXml(this.protocol, "ProtocolSettings"); if (this.cors != null) { xmlWriter.writeStartElement("Cors"); for (ShareCorsRule element : this.cors) { @@ -163,7 +164,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt } xmlWriter.writeEndElement(); } - xmlWriter.writeXml(this.protocol, "ProtocolSettings"); return xmlWriter.writeEndElement(); } @@ -204,6 +204,9 @@ public static ShareServiceProperties fromXml(XmlReader xmlReader, String rootEle deserializedShareServiceProperties.hourMetrics = ShareMetrics.fromXml(reader, "HourMetrics"); } else if ("MinuteMetrics".equals(elementName.getLocalPart())) { deserializedShareServiceProperties.minuteMetrics = ShareMetrics.fromXml(reader, "MinuteMetrics"); + } else if ("ProtocolSettings".equals(elementName.getLocalPart())) { + deserializedShareServiceProperties.protocol + = ShareProtocolSettings.fromXml(reader, "ProtocolSettings"); } else if ("Cors".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { elementName = reader.getElementName(); @@ -216,9 +219,6 @@ public static ShareServiceProperties fromXml(XmlReader xmlReader, String rootEle reader.skipElement(); } } - } else if ("ProtocolSettings".equals(elementName.getLocalPart())) { - deserializedShareServiceProperties.protocol - = ShareProtocolSettings.fromXml(reader, "ProtocolSettings"); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSignedIdentifier.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSignedIdentifier.java index a002cb98e5fe..1fc17530e5b2 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSignedIdentifier.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSignedIdentifier.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -18,6 +17,7 @@ */ @Fluent public final class ShareSignedIdentifier implements XmlSerializable { + /* * A unique id. */ @@ -37,9 +37,19 @@ public final class ShareSignedIdentifier implements XmlSerializable { - ShareSignedIdentifier deserializedShareSignedIdentifier = new ShareSignedIdentifier(); + String id = null; + ShareAccessPolicy accessPolicy = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Id".equals(elementName.getLocalPart())) { - deserializedShareSignedIdentifier.id = reader.getStringElement(); + id = reader.getStringElement(); } else if ("AccessPolicy".equals(elementName.getLocalPart())) { - deserializedShareSignedIdentifier.accessPolicy = ShareAccessPolicy.fromXml(reader, "AccessPolicy"); + accessPolicy = ShareAccessPolicy.fromXml(reader, "AccessPolicy"); } else { reader.skipElement(); } } - + ShareSignedIdentifier deserializedShareSignedIdentifier = new ShareSignedIdentifier(id); + deserializedShareSignedIdentifier.accessPolicy = accessPolicy; return deserializedShareSignedIdentifier; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettings.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettings.java index db2f5a1ece99..068b8bb48054 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettings.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettingsEncryptionInTransit.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettingsEncryptionInTransit.java index 64e46a883d22..c4d8ece32f27 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettingsEncryptionInTransit.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareSmbSettingsEncryptionInTransit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareTokenIntent.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareTokenIntent.java index f1a5f8d3791f..11d41cd8120c 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareTokenIntent.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareTokenIntent.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Generated; @@ -14,7 +14,7 @@ public final class ShareTokenIntent extends ExpandableStringEnum { /** - * Static value backup for ShareTokenIntent. + * backup. */ @Generated public static final ShareTokenIntent BACKUP = fromString("backup"); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/SmbMultichannel.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/SmbMultichannel.java index 77783c2023c4..901b5d4fb903 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/SmbMultichannel.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/SmbMultichannel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/UserDelegationKey.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/UserDelegationKey.java index a7dde992c297..7506c093a84b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/UserDelegationKey.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/UserDelegationKey.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.storage.file.share.models; import com.azure.core.annotation.Fluent; @@ -21,6 +20,7 @@ */ @Fluent public final class UserDelegationKey implements XmlSerializable { + /* * The Azure Active Directory object ID in GUID format. */ @@ -58,7 +58,8 @@ public final class UserDelegationKey implements XmlSerializable { - UserDelegationKey deserializedUserDelegationKey = new UserDelegationKey(); + String signedObjectId = null; + String signedTenantId = null; + OffsetDateTime signedStart = null; + OffsetDateTime signedExpiry = null; + String signedService = null; + String signedVersion = null; + String signedDelegatedUserTenantId = null; + String value = null; while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("SignedOid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedObjectId = reader.getStringElement(); + signedObjectId = reader.getStringElement(); } else if ("SignedTid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedTenantId = reader.getStringElement(); + signedTenantId = reader.getStringElement(); } else if ("SignedStart".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedStart + signedStart = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("SignedExpiry".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedExpiry + signedExpiry = reader.getNullableElement(dateString -> CoreUtils.parseBestOffsetDateTime(dateString)); } else if ("SignedService".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedService = reader.getStringElement(); + signedService = reader.getStringElement(); } else if ("SignedVersion".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedVersion = reader.getStringElement(); + signedVersion = reader.getStringElement(); } else if ("SignedDelegatedUserTid".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.signedDelegatedUserTenantId = reader.getStringElement(); + signedDelegatedUserTenantId = reader.getStringElement(); } else if ("Value".equals(elementName.getLocalPart())) { - deserializedUserDelegationKey.value = reader.getStringElement(); + value = reader.getStringElement(); } else { reader.skipElement(); } } - + UserDelegationKey deserializedUserDelegationKey = new UserDelegationKey(signedObjectId, signedTenantId, + signedStart, signedExpiry, signedService, signedVersion, value); + deserializedUserDelegationKey.signedDelegatedUserTenantId = signedDelegatedUserTenantId; return deserializedUserDelegationKey; }); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java index a0b0e8cbeee5..2ed740cb5c2f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseAsyncClient.java @@ -7,13 +7,17 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.HttpPipeline; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.file.share.ShareFileAsyncClient; +import com.azure.storage.file.share.ShareServiceVersion; import com.azure.storage.file.share.implementation.AzureFileStorageImpl; +import com.azure.storage.file.share.implementation.util.ModelHelper; +import com.azure.storage.file.share.implementation.util.RequestOptionsHelper; import com.azure.storage.file.share.models.ShareTokenIntent; import com.azure.storage.file.share.options.ShareAcquireLeaseOptions; import com.azure.storage.file.share.options.ShareBreakLeaseOptions; @@ -59,12 +63,13 @@ public final class ShareLeaseAsyncClient { private volatile String leaseId; ShareLeaseAsyncClient(HttpPipeline pipeline, String url, String shareName, String shareSnapshot, - String resourcePath, String leaseId, boolean isShareFile, String accountName, String serviceVersion, - boolean allowTrailingDot, boolean allowSourceTrailingDot, ShareTokenIntent shareTokenIntent) { + String resourcePath, String leaseId, boolean isShareFile, String accountName, + ShareServiceVersion serviceVersion, boolean allowTrailingDot, boolean allowSourceTrailingDot, + ShareTokenIntent shareTokenIntent) { this.isShareFile = isShareFile; this.leaseId = leaseId; - this.client = new AzureFileStorageImpl(pipeline, serviceVersion, shareTokenIntent, url, allowTrailingDot, - allowSourceTrailingDot); + this.client = new AzureFileStorageImpl(pipeline, url, shareTokenIntent, allowTrailingDot, + allowSourceTrailingDot, serviceVersion); this.accountName = accountName; this.shareName = shareName; this.shareSnapshot = shareSnapshot; @@ -177,14 +182,14 @@ Mono> acquireLeaseWithResponse(ShareAcquireLeaseOptions options Mono> response; if (this.isShareFile) { response = this.client.getFiles() - .acquireLeaseWithResponseAsync(shareName, resourcePath, null, options.getDuration(), this.leaseId, null, - context) - .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); + .acquireLeaseWithResponseAsync(RequestOptionsHelper.acquireLeaseRequestOptions( + shareName + "/" + resourcePath, options.getDuration(), this.leaseId, null, context)) + .map(ModelHelper::mapLeaseIdResponse); } else { response = this.client.getShares() - .acquireLeaseWithResponseAsync(shareName, null, options.getDuration(), this.leaseId, shareSnapshot, - null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); + .acquireLeaseWithResponseAsync(RequestOptionsHelper.acquireLeaseRequestOptions(shareName, + options.getDuration(), this.leaseId, shareSnapshot, context)) + .map(ModelHelper::mapLeaseIdResponse); } response = response.doOnSuccess(r -> this.leaseId = r.getValue()); @@ -236,12 +241,12 @@ Mono> releaseLeaseWithResponse(Context context) { context = context == null ? Context.NONE : context; if (this.isShareFile) { return this.client.getFiles() - .releaseLeaseNoCustomHeadersWithResponseAsync(shareName, resourcePath, this.leaseId, null, null, - context); + .releaseLeaseWithResponseAsync(this.leaseId, + RequestOptionsHelper.snapshotRequestOptions(shareName + "/" + resourcePath, null, context)); } else { return this.client.getShares() - .releaseLeaseNoCustomHeadersWithResponseAsync(shareName, this.leaseId, null, shareSnapshot, null, - context); + .releaseLeaseWithResponseAsync(this.leaseId, + RequestOptionsHelper.snapshotRequestOptions(shareName, shareSnapshot, context)); } } @@ -318,11 +323,12 @@ Mono> breakLeaseWithResponse(ShareBreakLeaseOptions options, Cont = options.getBreakPeriod() == null ? null : Math.toIntExact(options.getBreakPeriod().getSeconds()); if (this.isShareFile) { return this.client.getFiles() - .breakLeaseNoCustomHeadersWithResponseAsync(shareName, resourcePath, null, null, null, context); + .breakLeaseWithResponseAsync( + RequestOptionsHelper.breakLeaseRequestOptions(shareName + "/" + resourcePath, null, null, context)); } else { return this.client.getShares() - .breakLeaseNoCustomHeadersWithResponseAsync(shareName, null, breakPeriod, null, null, shareSnapshot, - context); + .breakLeaseWithResponseAsync( + RequestOptionsHelper.breakLeaseRequestOptions(shareName, breakPeriod, shareSnapshot, context)); } } @@ -375,12 +381,15 @@ Mono> changeLeaseWithResponse(String proposedId, Context contex Mono> response; if (this.isShareFile) { response = this.client.getFiles() - .changeLeaseWithResponseAsync(shareName, resourcePath, this.leaseId, null, proposedId, null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); + .changeLeaseWithResponseAsync(this.leaseId, + RequestOptionsHelper.changeLeaseRequestOptions(shareName + "/" + resourcePath, proposedId, null, + context)) + .map(ModelHelper::mapLeaseIdResponse); } else { response = this.client.getShares() - .changeLeaseWithResponseAsync(shareName, this.leaseId, null, proposedId, shareSnapshot, null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); + .changeLeaseWithResponseAsync(this.leaseId, + RequestOptionsHelper.changeLeaseRequestOptions(shareName, proposedId, shareSnapshot, context)) + .map(ModelHelper::mapLeaseIdResponse); } response = response.doOnSuccess(r -> this.leaseId = r.getValue()); @@ -437,8 +446,9 @@ Mono> renewLeaseWithResponse(Context context) { .logExceptionAsError(new UnsupportedOperationException("Cannot renew a lease on a share file.")); } else { response = this.client.getShares() - .renewLeaseWithResponseAsync(shareName, this.leaseId, null, shareSnapshot, null, context) - .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsLeaseId())); + .renewLeaseWithResponseAsync(this.leaseId, + RequestOptionsHelper.snapshotRequestOptions(shareName, shareSnapshot, context)) + .map(ModelHelper::mapLeaseIdResponse); } response = response.doOnSuccess(r -> this.leaseId = r.getValue()); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java index 7d7d79930360..1c6e781bc95b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/specialized/ShareLeaseClientBuilder.java @@ -109,7 +109,7 @@ public ShareLeaseClient buildClient() { public ShareLeaseAsyncClient buildAsyncClient() { ShareServiceVersion version = (serviceVersion == null) ? ShareServiceVersion.getLatest() : serviceVersion; return new ShareLeaseAsyncClient(pipeline, url, shareName, shareSnapshot, resourcePath, getLeaseId(), - isShareFile, accountName, version.getVersion(), allowTrailingDot, allowSourceTrailingDot, shareTokenIntent); + isShareFile, accountName, version, allowTrailingDot, allowSourceTrailingDot, shareTokenIntent); } /** diff --git a/sdk/storage/azure-storage-file-share/src/main/resources/META-INF/azure-storage-file-share_metadata.json b/sdk/storage/azure-storage-file-share/src/main/resources/META-INF/azure-storage-file-share_metadata.json new file mode 100644 index 000000000000..0e919fe66ef0 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/src/main/resources/META-INF/azure-storage-file-share_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Storage.File":"2026-12-06"},"crossLanguagePackageId":"Storage.File","crossLanguageVersion":"5d929a4c3464","crossLanguageDefinitions":{"com.azure.storage.file.share.AzureFileStorageBuilder":"Storage.File","com.azure.storage.file.share.DirectoryAsyncClient":"Storage.File.Directory","com.azure.storage.file.share.DirectoryAsyncClient.create":"Storage.File.Directory.create","com.azure.storage.file.share.DirectoryAsyncClient.createWithResponse":"Storage.File.Directory.create","com.azure.storage.file.share.DirectoryAsyncClient.delete":"Storage.File.Directory.delete","com.azure.storage.file.share.DirectoryAsyncClient.deleteWithResponse":"Storage.File.Directory.delete","com.azure.storage.file.share.DirectoryAsyncClient.forceCloseHandles":"Storage.File.Directory.forceCloseHandles","com.azure.storage.file.share.DirectoryAsyncClient.forceCloseHandlesWithResponse":"Storage.File.Directory.forceCloseHandles","com.azure.storage.file.share.DirectoryAsyncClient.getProperties":"Storage.File.Directory.getProperties","com.azure.storage.file.share.DirectoryAsyncClient.getPropertiesWithResponse":"Storage.File.Directory.getProperties","com.azure.storage.file.share.DirectoryAsyncClient.listFilesAndDirectoriesSegment":"Storage.File.Directory.listFilesAndDirectoriesSegment","com.azure.storage.file.share.DirectoryAsyncClient.listFilesAndDirectoriesSegmentWithResponse":"Storage.File.Directory.listFilesAndDirectoriesSegment","com.azure.storage.file.share.DirectoryAsyncClient.listHandles":"Storage.File.Directory.listHandles","com.azure.storage.file.share.DirectoryAsyncClient.rename":"Storage.File.Directory.rename","com.azure.storage.file.share.DirectoryAsyncClient.renameWithResponse":"Storage.File.Directory.rename","com.azure.storage.file.share.DirectoryAsyncClient.setMetadata":"Storage.File.Directory.setMetadata","com.azure.storage.file.share.DirectoryAsyncClient.setMetadataWithResponse":"Storage.File.Directory.setMetadata","com.azure.storage.file.share.DirectoryAsyncClient.setProperties":"Storage.File.Directory.setProperties","com.azure.storage.file.share.DirectoryAsyncClient.setPropertiesWithResponse":"Storage.File.Directory.setProperties","com.azure.storage.file.share.DirectoryClient":"Storage.File.Directory","com.azure.storage.file.share.DirectoryClient.create":"Storage.File.Directory.create","com.azure.storage.file.share.DirectoryClient.createWithResponse":"Storage.File.Directory.create","com.azure.storage.file.share.DirectoryClient.delete":"Storage.File.Directory.delete","com.azure.storage.file.share.DirectoryClient.deleteWithResponse":"Storage.File.Directory.delete","com.azure.storage.file.share.DirectoryClient.forceCloseHandles":"Storage.File.Directory.forceCloseHandles","com.azure.storage.file.share.DirectoryClient.forceCloseHandlesWithResponse":"Storage.File.Directory.forceCloseHandles","com.azure.storage.file.share.DirectoryClient.getProperties":"Storage.File.Directory.getProperties","com.azure.storage.file.share.DirectoryClient.getPropertiesWithResponse":"Storage.File.Directory.getProperties","com.azure.storage.file.share.DirectoryClient.listFilesAndDirectoriesSegment":"Storage.File.Directory.listFilesAndDirectoriesSegment","com.azure.storage.file.share.DirectoryClient.listFilesAndDirectoriesSegmentWithResponse":"Storage.File.Directory.listFilesAndDirectoriesSegment","com.azure.storage.file.share.DirectoryClient.listHandles":"Storage.File.Directory.listHandles","com.azure.storage.file.share.DirectoryClient.rename":"Storage.File.Directory.rename","com.azure.storage.file.share.DirectoryClient.renameWithResponse":"Storage.File.Directory.rename","com.azure.storage.file.share.DirectoryClient.setMetadata":"Storage.File.Directory.setMetadata","com.azure.storage.file.share.DirectoryClient.setMetadataWithResponse":"Storage.File.Directory.setMetadata","com.azure.storage.file.share.DirectoryClient.setProperties":"Storage.File.Directory.setProperties","com.azure.storage.file.share.DirectoryClient.setPropertiesWithResponse":"Storage.File.Directory.setProperties","com.azure.storage.file.share.FileAsyncClient":"Storage.File.File","com.azure.storage.file.share.FileAsyncClient.abortCopy":"Storage.File.File.abortCopy","com.azure.storage.file.share.FileAsyncClient.abortCopyWithResponse":"Storage.File.File.abortCopy","com.azure.storage.file.share.FileAsyncClient.acquireLease":"Storage.File.File.acquireLease","com.azure.storage.file.share.FileAsyncClient.acquireLeaseWithResponse":"Storage.File.File.acquireLease","com.azure.storage.file.share.FileAsyncClient.breakLease":"Storage.File.File.breakLease","com.azure.storage.file.share.FileAsyncClient.breakLeaseWithResponse":"Storage.File.File.breakLease","com.azure.storage.file.share.FileAsyncClient.changeLease":"Storage.File.File.changeLease","com.azure.storage.file.share.FileAsyncClient.changeLeaseWithResponse":"Storage.File.File.changeLease","com.azure.storage.file.share.FileAsyncClient.create":"Storage.File.File.create","com.azure.storage.file.share.FileAsyncClient.createHardLink":"Storage.File.File.createHardLink","com.azure.storage.file.share.FileAsyncClient.createHardLinkWithResponse":"Storage.File.File.createHardLink","com.azure.storage.file.share.FileAsyncClient.createSymbolicLink":"Storage.File.File.createSymbolicLink","com.azure.storage.file.share.FileAsyncClient.createSymbolicLinkWithResponse":"Storage.File.File.createSymbolicLink","com.azure.storage.file.share.FileAsyncClient.createWithResponse":"Storage.File.File.create","com.azure.storage.file.share.FileAsyncClient.delete":"Storage.File.File.delete","com.azure.storage.file.share.FileAsyncClient.deleteWithResponse":"Storage.File.File.delete","com.azure.storage.file.share.FileAsyncClient.download":"Storage.File.File.download","com.azure.storage.file.share.FileAsyncClient.downloadWithResponse":"Storage.File.File.download","com.azure.storage.file.share.FileAsyncClient.forceCloseHandles":"Storage.File.File.forceCloseHandles","com.azure.storage.file.share.FileAsyncClient.forceCloseHandlesWithResponse":"Storage.File.File.forceCloseHandles","com.azure.storage.file.share.FileAsyncClient.getProperties":"Storage.File.File.getProperties","com.azure.storage.file.share.FileAsyncClient.getPropertiesWithResponse":"Storage.File.File.getProperties","com.azure.storage.file.share.FileAsyncClient.getRangeList":"Storage.File.File.getRangeList","com.azure.storage.file.share.FileAsyncClient.getRangeListWithResponse":"Storage.File.File.getRangeList","com.azure.storage.file.share.FileAsyncClient.getSymbolicLink":"Storage.File.File.getSymbolicLink","com.azure.storage.file.share.FileAsyncClient.getSymbolicLinkWithResponse":"Storage.File.File.getSymbolicLink","com.azure.storage.file.share.FileAsyncClient.listAllRanges":"Storage.File.File.listAllRanges","com.azure.storage.file.share.FileAsyncClient.listHandles":"Storage.File.File.listHandles","com.azure.storage.file.share.FileAsyncClient.releaseLease":"Storage.File.File.releaseLease","com.azure.storage.file.share.FileAsyncClient.releaseLeaseWithResponse":"Storage.File.File.releaseLease","com.azure.storage.file.share.FileAsyncClient.rename":"Storage.File.File.rename","com.azure.storage.file.share.FileAsyncClient.renameWithResponse":"Storage.File.File.rename","com.azure.storage.file.share.FileAsyncClient.setHttpHeaders":"Storage.File.File.setHttpHeaders","com.azure.storage.file.share.FileAsyncClient.setHttpHeadersWithResponse":"Storage.File.File.setHttpHeaders","com.azure.storage.file.share.FileAsyncClient.setMetadata":"Storage.File.File.setMetadata","com.azure.storage.file.share.FileAsyncClient.setMetadataWithResponse":"Storage.File.File.setMetadata","com.azure.storage.file.share.FileAsyncClient.startCopy":"Storage.File.File.startCopy","com.azure.storage.file.share.FileAsyncClient.startCopyWithResponse":"Storage.File.File.startCopy","com.azure.storage.file.share.FileAsyncClient.uploadRange":"Storage.File.File.uploadRange","com.azure.storage.file.share.FileAsyncClient.uploadRangeFromUrl":"Storage.File.File.uploadRangeFromUrl","com.azure.storage.file.share.FileAsyncClient.uploadRangeFromUrlWithResponse":"Storage.File.File.uploadRangeFromUrl","com.azure.storage.file.share.FileAsyncClient.uploadRangeWithResponse":"Storage.File.File.uploadRange","com.azure.storage.file.share.FileClient":"Storage.File.File","com.azure.storage.file.share.FileClient.abortCopy":"Storage.File.File.abortCopy","com.azure.storage.file.share.FileClient.abortCopyWithResponse":"Storage.File.File.abortCopy","com.azure.storage.file.share.FileClient.acquireLease":"Storage.File.File.acquireLease","com.azure.storage.file.share.FileClient.acquireLeaseWithResponse":"Storage.File.File.acquireLease","com.azure.storage.file.share.FileClient.breakLease":"Storage.File.File.breakLease","com.azure.storage.file.share.FileClient.breakLeaseWithResponse":"Storage.File.File.breakLease","com.azure.storage.file.share.FileClient.changeLease":"Storage.File.File.changeLease","com.azure.storage.file.share.FileClient.changeLeaseWithResponse":"Storage.File.File.changeLease","com.azure.storage.file.share.FileClient.create":"Storage.File.File.create","com.azure.storage.file.share.FileClient.createHardLink":"Storage.File.File.createHardLink","com.azure.storage.file.share.FileClient.createHardLinkWithResponse":"Storage.File.File.createHardLink","com.azure.storage.file.share.FileClient.createSymbolicLink":"Storage.File.File.createSymbolicLink","com.azure.storage.file.share.FileClient.createSymbolicLinkWithResponse":"Storage.File.File.createSymbolicLink","com.azure.storage.file.share.FileClient.createWithResponse":"Storage.File.File.create","com.azure.storage.file.share.FileClient.delete":"Storage.File.File.delete","com.azure.storage.file.share.FileClient.deleteWithResponse":"Storage.File.File.delete","com.azure.storage.file.share.FileClient.download":"Storage.File.File.download","com.azure.storage.file.share.FileClient.downloadWithResponse":"Storage.File.File.download","com.azure.storage.file.share.FileClient.forceCloseHandles":"Storage.File.File.forceCloseHandles","com.azure.storage.file.share.FileClient.forceCloseHandlesWithResponse":"Storage.File.File.forceCloseHandles","com.azure.storage.file.share.FileClient.getProperties":"Storage.File.File.getProperties","com.azure.storage.file.share.FileClient.getPropertiesWithResponse":"Storage.File.File.getProperties","com.azure.storage.file.share.FileClient.getRangeList":"Storage.File.File.getRangeList","com.azure.storage.file.share.FileClient.getRangeListWithResponse":"Storage.File.File.getRangeList","com.azure.storage.file.share.FileClient.getSymbolicLink":"Storage.File.File.getSymbolicLink","com.azure.storage.file.share.FileClient.getSymbolicLinkWithResponse":"Storage.File.File.getSymbolicLink","com.azure.storage.file.share.FileClient.listAllRanges":"Storage.File.File.listAllRanges","com.azure.storage.file.share.FileClient.listHandles":"Storage.File.File.listHandles","com.azure.storage.file.share.FileClient.releaseLease":"Storage.File.File.releaseLease","com.azure.storage.file.share.FileClient.releaseLeaseWithResponse":"Storage.File.File.releaseLease","com.azure.storage.file.share.FileClient.rename":"Storage.File.File.rename","com.azure.storage.file.share.FileClient.renameWithResponse":"Storage.File.File.rename","com.azure.storage.file.share.FileClient.setHttpHeaders":"Storage.File.File.setHttpHeaders","com.azure.storage.file.share.FileClient.setHttpHeadersWithResponse":"Storage.File.File.setHttpHeaders","com.azure.storage.file.share.FileClient.setMetadata":"Storage.File.File.setMetadata","com.azure.storage.file.share.FileClient.setMetadataWithResponse":"Storage.File.File.setMetadata","com.azure.storage.file.share.FileClient.startCopy":"Storage.File.File.startCopy","com.azure.storage.file.share.FileClient.startCopyWithResponse":"Storage.File.File.startCopy","com.azure.storage.file.share.FileClient.uploadRange":"Storage.File.File.uploadRange","com.azure.storage.file.share.FileClient.uploadRangeFromUrl":"Storage.File.File.uploadRangeFromUrl","com.azure.storage.file.share.FileClient.uploadRangeFromUrlWithResponse":"Storage.File.File.uploadRangeFromUrl","com.azure.storage.file.share.FileClient.uploadRangeWithResponse":"Storage.File.File.uploadRange","com.azure.storage.file.share.ServiceAsyncClient":"Storage.File.Service","com.azure.storage.file.share.ServiceAsyncClient.getProperties":"Storage.File.Service.getProperties","com.azure.storage.file.share.ServiceAsyncClient.getPropertiesWithResponse":"Storage.File.Service.getProperties","com.azure.storage.file.share.ServiceAsyncClient.getUserDelegationKey":"Storage.File.Service.getUserDelegationKey","com.azure.storage.file.share.ServiceAsyncClient.getUserDelegationKeyWithResponse":"Storage.File.Service.getUserDelegationKey","com.azure.storage.file.share.ServiceAsyncClient.listSharesSegment":"Storage.File.Service.listSharesSegment","com.azure.storage.file.share.ServiceAsyncClient.setProperties":"Storage.File.Service.setProperties","com.azure.storage.file.share.ServiceAsyncClient.setPropertiesWithResponse":"Storage.File.Service.setProperties","com.azure.storage.file.share.ServiceClient":"Storage.File.Service","com.azure.storage.file.share.ServiceClient.getProperties":"Storage.File.Service.getProperties","com.azure.storage.file.share.ServiceClient.getPropertiesWithResponse":"Storage.File.Service.getProperties","com.azure.storage.file.share.ServiceClient.getUserDelegationKey":"Storage.File.Service.getUserDelegationKey","com.azure.storage.file.share.ServiceClient.getUserDelegationKeyWithResponse":"Storage.File.Service.getUserDelegationKey","com.azure.storage.file.share.ServiceClient.listSharesSegment":"Storage.File.Service.listSharesSegment","com.azure.storage.file.share.ServiceClient.setProperties":"Storage.File.Service.setProperties","com.azure.storage.file.share.ServiceClient.setPropertiesWithResponse":"Storage.File.Service.setProperties","com.azure.storage.file.share.ShareAsyncClient":"Storage.File.Share","com.azure.storage.file.share.ShareAsyncClient.acquireLease":"Storage.File.Share.acquireLease","com.azure.storage.file.share.ShareAsyncClient.acquireLeaseWithResponse":"Storage.File.Share.acquireLease","com.azure.storage.file.share.ShareAsyncClient.breakLease":"Storage.File.Share.breakLease","com.azure.storage.file.share.ShareAsyncClient.breakLeaseWithResponse":"Storage.File.Share.breakLease","com.azure.storage.file.share.ShareAsyncClient.changeLease":"Storage.File.Share.changeLease","com.azure.storage.file.share.ShareAsyncClient.changeLeaseWithResponse":"Storage.File.Share.changeLease","com.azure.storage.file.share.ShareAsyncClient.create":"Storage.File.Share.create","com.azure.storage.file.share.ShareAsyncClient.createPermission":"Storage.File.Share.createPermission","com.azure.storage.file.share.ShareAsyncClient.createPermissionWithResponse":"Storage.File.Share.createPermission","com.azure.storage.file.share.ShareAsyncClient.createSnapshot":"Storage.File.Share.createSnapshot","com.azure.storage.file.share.ShareAsyncClient.createSnapshotWithResponse":"Storage.File.Share.createSnapshot","com.azure.storage.file.share.ShareAsyncClient.createWithResponse":"Storage.File.Share.create","com.azure.storage.file.share.ShareAsyncClient.delete":"Storage.File.Share.delete","com.azure.storage.file.share.ShareAsyncClient.deleteWithResponse":"Storage.File.Share.delete","com.azure.storage.file.share.ShareAsyncClient.getAccessPolicy":"Storage.File.Share.getAccessPolicy","com.azure.storage.file.share.ShareAsyncClient.getAccessPolicyWithResponse":"Storage.File.Share.getAccessPolicy","com.azure.storage.file.share.ShareAsyncClient.getPermission":"Storage.File.Share.getPermission","com.azure.storage.file.share.ShareAsyncClient.getPermissionWithResponse":"Storage.File.Share.getPermission","com.azure.storage.file.share.ShareAsyncClient.getProperties":"Storage.File.Share.getProperties","com.azure.storage.file.share.ShareAsyncClient.getPropertiesWithResponse":"Storage.File.Share.getProperties","com.azure.storage.file.share.ShareAsyncClient.getStatistics":"Storage.File.Share.getStatistics","com.azure.storage.file.share.ShareAsyncClient.getStatisticsWithResponse":"Storage.File.Share.getStatistics","com.azure.storage.file.share.ShareAsyncClient.releaseLease":"Storage.File.Share.releaseLease","com.azure.storage.file.share.ShareAsyncClient.releaseLeaseWithResponse":"Storage.File.Share.releaseLease","com.azure.storage.file.share.ShareAsyncClient.renewLease":"Storage.File.Share.renewLease","com.azure.storage.file.share.ShareAsyncClient.renewLeaseWithResponse":"Storage.File.Share.renewLease","com.azure.storage.file.share.ShareAsyncClient.restore":"Storage.File.Share.restore","com.azure.storage.file.share.ShareAsyncClient.restoreWithResponse":"Storage.File.Share.restore","com.azure.storage.file.share.ShareAsyncClient.setAccessPolicy":"Storage.File.Share.setAccessPolicy","com.azure.storage.file.share.ShareAsyncClient.setAccessPolicyWithResponse":"Storage.File.Share.setAccessPolicy","com.azure.storage.file.share.ShareAsyncClient.setMetadata":"Storage.File.Share.setMetadata","com.azure.storage.file.share.ShareAsyncClient.setMetadataWithResponse":"Storage.File.Share.setMetadata","com.azure.storage.file.share.ShareAsyncClient.setProperties":"Storage.File.Share.setProperties","com.azure.storage.file.share.ShareAsyncClient.setPropertiesWithResponse":"Storage.File.Share.setProperties","com.azure.storage.file.share.ShareClient":"Storage.File.Share","com.azure.storage.file.share.ShareClient.acquireLease":"Storage.File.Share.acquireLease","com.azure.storage.file.share.ShareClient.acquireLeaseWithResponse":"Storage.File.Share.acquireLease","com.azure.storage.file.share.ShareClient.breakLease":"Storage.File.Share.breakLease","com.azure.storage.file.share.ShareClient.breakLeaseWithResponse":"Storage.File.Share.breakLease","com.azure.storage.file.share.ShareClient.changeLease":"Storage.File.Share.changeLease","com.azure.storage.file.share.ShareClient.changeLeaseWithResponse":"Storage.File.Share.changeLease","com.azure.storage.file.share.ShareClient.create":"Storage.File.Share.create","com.azure.storage.file.share.ShareClient.createPermission":"Storage.File.Share.createPermission","com.azure.storage.file.share.ShareClient.createPermissionWithResponse":"Storage.File.Share.createPermission","com.azure.storage.file.share.ShareClient.createSnapshot":"Storage.File.Share.createSnapshot","com.azure.storage.file.share.ShareClient.createSnapshotWithResponse":"Storage.File.Share.createSnapshot","com.azure.storage.file.share.ShareClient.createWithResponse":"Storage.File.Share.create","com.azure.storage.file.share.ShareClient.delete":"Storage.File.Share.delete","com.azure.storage.file.share.ShareClient.deleteWithResponse":"Storage.File.Share.delete","com.azure.storage.file.share.ShareClient.getAccessPolicy":"Storage.File.Share.getAccessPolicy","com.azure.storage.file.share.ShareClient.getAccessPolicyWithResponse":"Storage.File.Share.getAccessPolicy","com.azure.storage.file.share.ShareClient.getPermission":"Storage.File.Share.getPermission","com.azure.storage.file.share.ShareClient.getPermissionWithResponse":"Storage.File.Share.getPermission","com.azure.storage.file.share.ShareClient.getProperties":"Storage.File.Share.getProperties","com.azure.storage.file.share.ShareClient.getPropertiesWithResponse":"Storage.File.Share.getProperties","com.azure.storage.file.share.ShareClient.getStatistics":"Storage.File.Share.getStatistics","com.azure.storage.file.share.ShareClient.getStatisticsWithResponse":"Storage.File.Share.getStatistics","com.azure.storage.file.share.ShareClient.releaseLease":"Storage.File.Share.releaseLease","com.azure.storage.file.share.ShareClient.releaseLeaseWithResponse":"Storage.File.Share.releaseLease","com.azure.storage.file.share.ShareClient.renewLease":"Storage.File.Share.renewLease","com.azure.storage.file.share.ShareClient.renewLeaseWithResponse":"Storage.File.Share.renewLease","com.azure.storage.file.share.ShareClient.restore":"Storage.File.Share.restore","com.azure.storage.file.share.ShareClient.restoreWithResponse":"Storage.File.Share.restore","com.azure.storage.file.share.ShareClient.setAccessPolicy":"Storage.File.Share.setAccessPolicy","com.azure.storage.file.share.ShareClient.setAccessPolicyWithResponse":"Storage.File.Share.setAccessPolicy","com.azure.storage.file.share.ShareClient.setMetadata":"Storage.File.Share.setMetadata","com.azure.storage.file.share.ShareClient.setMetadataWithResponse":"Storage.File.Share.setMetadata","com.azure.storage.file.share.ShareClient.setProperties":"Storage.File.Share.setProperties","com.azure.storage.file.share.ShareClient.setPropertiesWithResponse":"Storage.File.Share.setProperties","com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType":"Storage.File.DeleteSnapshotsOptionType","com.azure.storage.file.share.implementation.models.DirectoryItem":"Storage.File.DirectoryItem","com.azure.storage.file.share.implementation.models.FileItem":"Storage.File.FileItem","com.azure.storage.file.share.implementation.models.FileProperty":"Storage.File.FileProperty","com.azure.storage.file.share.implementation.models.FilesAndDirectoriesListSegment":"Storage.File.FilesAndDirectoriesListSegment","com.azure.storage.file.share.implementation.models.HandleItem":"Storage.File.HandleItem","com.azure.storage.file.share.implementation.models.KeyInfo":"Storage.File.KeyInfo","com.azure.storage.file.share.implementation.models.ListFilesAndDirectoriesSegmentResponse":"Storage.File.ListFilesAndDirectoriesSegmentResponse","com.azure.storage.file.share.implementation.models.ListFilesIncludeType":"Storage.File.ListFilesIncludeType","com.azure.storage.file.share.implementation.models.ListSharesIncludeType":"Storage.File.ListSharesIncludeType","com.azure.storage.file.share.implementation.models.ShareFileRangeWriteFromUrlType":"Storage.File.FileRangeWriteFromUrlType","com.azure.storage.file.share.implementation.models.ShareFileRangeWriteType":"Storage.File.FileRangeWriteType","com.azure.storage.file.share.implementation.models.ShareItemInternal":"Storage.File.ShareItemInternal","com.azure.storage.file.share.implementation.models.SharePermission":"Storage.File.SharePermission","com.azure.storage.file.share.implementation.models.SharePropertiesInternal":"Storage.File.SharePropertiesInternal","com.azure.storage.file.share.implementation.models.ShareSignedIdentifierWrapper":"Storage.File.SignedIdentifiers","com.azure.storage.file.share.implementation.models.ShareStats":"Storage.File.ShareStats","com.azure.storage.file.share.implementation.models.StringEncoded":"Storage.File.StringEncoded","com.azure.storage.file.share.models.ClearRange":"Storage.File.ClearRange","com.azure.storage.file.share.models.FileLastWrittenMode":"Storage.File.FileLastWrittenMode","com.azure.storage.file.share.models.FilePermissionFormat":"Storage.File.FilePermissionFormat","com.azure.storage.file.share.models.FilePropertySemantics":"Storage.File.FilePropertySemantics","com.azure.storage.file.share.models.FileRange":"Storage.File.FileRange","com.azure.storage.file.share.models.LeaseDurationType":"Storage.File.LeaseDurationType","com.azure.storage.file.share.models.LeaseStateType":"Storage.File.LeaseStateType","com.azure.storage.file.share.models.LeaseStatusType":"Storage.File.LeaseStatusType","com.azure.storage.file.share.models.ModeCopyMode":"Storage.File.ModeCopyMode","com.azure.storage.file.share.models.NfsFileType":"Storage.File.NfsFileType","com.azure.storage.file.share.models.OwnerCopyMode":"Storage.File.OwnerCopyMode","com.azure.storage.file.share.models.PermissionCopyModeType":"Storage.File.PermissionCopyModeType","com.azure.storage.file.share.models.ShareAccessPolicy":"Storage.File.AccessPolicy","com.azure.storage.file.share.models.ShareAccessTier":"Storage.File.ShareAccessTier","com.azure.storage.file.share.models.ShareCorsRule":"Storage.File.CorsRule","com.azure.storage.file.share.models.ShareFileHandleAccessRights":"Storage.File.AccessRight","com.azure.storage.file.share.models.ShareFileRangeList":"Storage.File.ShareFileRangeList","com.azure.storage.file.share.models.ShareMetrics":"Storage.File.Metrics","com.azure.storage.file.share.models.ShareNfsSettings":"Storage.File.ShareNfsSettings","com.azure.storage.file.share.models.ShareNfsSettingsEncryptionInTransit":"Storage.File.ShareNfsSettingsEncryptionInTransit","com.azure.storage.file.share.models.ShareProtocolSettings":"Storage.File.ShareProtocolSettings","com.azure.storage.file.share.models.ShareRetentionPolicy":"Storage.File.RetentionPolicy","com.azure.storage.file.share.models.ShareRootSquash":"Storage.File.ShareRootSquash","com.azure.storage.file.share.models.ShareServiceProperties":"Storage.File.StorageServiceProperties","com.azure.storage.file.share.models.ShareSignedIdentifier":"Storage.File.SignedIdentifier","com.azure.storage.file.share.models.ShareSmbSettings":"Storage.File.ShareSmbSettings","com.azure.storage.file.share.models.ShareSmbSettingsEncryptionInTransit":"Storage.File.ShareSmbSettingsEncryptionInTransit","com.azure.storage.file.share.models.ShareTokenIntent":"Storage.File.ShareTokenIntent","com.azure.storage.file.share.models.SmbMultichannel":"Storage.File.SmbMultichannel","com.azure.storage.file.share.models.UserDelegationKey":"Storage.File.UserDelegationKey"},"generatedFiles":["src/main/java/com/azure/storage/file/share/AzureFileStorageBuilder.java","src/main/java/com/azure/storage/file/share/DirectoryAsyncClient.java","src/main/java/com/azure/storage/file/share/DirectoryClient.java","src/main/java/com/azure/storage/file/share/FileAsyncClient.java","src/main/java/com/azure/storage/file/share/FileClient.java","src/main/java/com/azure/storage/file/share/FileServiceVersion.java","src/main/java/com/azure/storage/file/share/ServiceAsyncClient.java","src/main/java/com/azure/storage/file/share/ServiceClient.java","src/main/java/com/azure/storage/file/share/ShareAsyncClient.java","src/main/java/com/azure/storage/file/share/ShareClient.java","src/main/java/com/azure/storage/file/share/implementation/AzureFileStorageImpl.java","src/main/java/com/azure/storage/file/share/implementation/DirectoriesImpl.java","src/main/java/com/azure/storage/file/share/implementation/FilesImpl.java","src/main/java/com/azure/storage/file/share/implementation/ServicesImpl.java","src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java","src/main/java/com/azure/storage/file/share/implementation/XmlSerializer.java","src/main/java/com/azure/storage/file/share/implementation/XmlSerializerProviders.java","src/main/java/com/azure/storage/file/share/implementation/models/DeleteSnapshotsOptionType.java","src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java","src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java","src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java","src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java","src/main/java/com/azure/storage/file/share/implementation/models/HandleItem.java","src/main/java/com/azure/storage/file/share/implementation/models/KeyInfo.java","src/main/java/com/azure/storage/file/share/implementation/models/ListFilesAndDirectoriesSegmentResponse.java","src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java","src/main/java/com/azure/storage/file/share/implementation/models/ListSharesIncludeType.java","src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteFromUrlType.java","src/main/java/com/azure/storage/file/share/implementation/models/ShareFileRangeWriteType.java","src/main/java/com/azure/storage/file/share/implementation/models/ShareItemInternal.java","src/main/java/com/azure/storage/file/share/implementation/models/SharePermission.java","src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java","src/main/java/com/azure/storage/file/share/implementation/models/ShareSignedIdentifierWrapper.java","src/main/java/com/azure/storage/file/share/implementation/models/ShareStats.java","src/main/java/com/azure/storage/file/share/implementation/models/StringEncoded.java","src/main/java/com/azure/storage/file/share/implementation/models/package-info.java","src/main/java/com/azure/storage/file/share/implementation/package-info.java","src/main/java/com/azure/storage/file/share/models/ClearRange.java","src/main/java/com/azure/storage/file/share/models/FileLastWrittenMode.java","src/main/java/com/azure/storage/file/share/models/FilePermissionFormat.java","src/main/java/com/azure/storage/file/share/models/FilePropertySemantics.java","src/main/java/com/azure/storage/file/share/models/FileRange.java","src/main/java/com/azure/storage/file/share/models/LeaseDurationType.java","src/main/java/com/azure/storage/file/share/models/LeaseStateType.java","src/main/java/com/azure/storage/file/share/models/LeaseStatusType.java","src/main/java/com/azure/storage/file/share/models/ModeCopyMode.java","src/main/java/com/azure/storage/file/share/models/NfsFileType.java","src/main/java/com/azure/storage/file/share/models/OwnerCopyMode.java","src/main/java/com/azure/storage/file/share/models/PermissionCopyModeType.java","src/main/java/com/azure/storage/file/share/models/ShareAccessPolicy.java","src/main/java/com/azure/storage/file/share/models/ShareAccessTier.java","src/main/java/com/azure/storage/file/share/models/ShareCorsRule.java","src/main/java/com/azure/storage/file/share/models/ShareFileHandleAccessRights.java","src/main/java/com/azure/storage/file/share/models/ShareFileRangeList.java","src/main/java/com/azure/storage/file/share/models/ShareMetrics.java","src/main/java/com/azure/storage/file/share/models/ShareNfsSettings.java","src/main/java/com/azure/storage/file/share/models/ShareNfsSettingsEncryptionInTransit.java","src/main/java/com/azure/storage/file/share/models/ShareProtocolSettings.java","src/main/java/com/azure/storage/file/share/models/ShareRetentionPolicy.java","src/main/java/com/azure/storage/file/share/models/ShareRootSquash.java","src/main/java/com/azure/storage/file/share/models/ShareServiceProperties.java","src/main/java/com/azure/storage/file/share/models/ShareSignedIdentifier.java","src/main/java/com/azure/storage/file/share/models/ShareSmbSettings.java","src/main/java/com/azure/storage/file/share/models/ShareSmbSettingsEncryptionInTransit.java","src/main/java/com/azure/storage/file/share/models/ShareTokenIntent.java","src/main/java/com/azure/storage/file/share/models/SmbMultichannel.java","src/main/java/com/azure/storage/file/share/models/UserDelegationKey.java","src/main/java/com/azure/storage/file/share/models/package-info.java","src/main/java/com/azure/storage/file/share/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java index d7438c0d4b94..43b91d1b949e 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileReadBehaviorTests.java @@ -72,7 +72,7 @@ public void readCallsToClientCorrectly(int offset, ShareRequestConditions condit ByteBuffer buffer = ByteBuffer.allocate(Constants.KB); AtomicInteger downloadCallCount = new AtomicInteger(0); ShareFileClient client - = new ShareFileClient(null, new AzureFileStorageImpl(null, null, "fakeurl", false, false), "testshare", + = new ShareFileClient(null, new AzureFileStorageImpl(null, "fakeurl", null, false, false, null), "testshare", "testpath", null, null, null, null) { @Override public ShareFileDownloadResponse downloadWithResponse(OutputStream stream, diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileWriteBehaviorTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileWriteBehaviorTests.java index c72817383bf2..7c3aa36b90de 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileWriteBehaviorTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/StorageSeekableByteChannelShareFileWriteBehaviorTests.java @@ -46,7 +46,7 @@ public void writeBehaviorWriteCallsToClientCorrectly(int offset, ShareRequestCon AtomicInteger uploadRangeCallCount = new AtomicInteger(0); ShareFileClient client - = new ShareFileClient(null, new AzureFileStorageImpl(null, null, "fakeurl", false, false), "testshare", + = new ShareFileClient(null, new AzureFileStorageImpl(null, "fakeurl", null, false, false, null), "testshare", "testpath", null, null, null, null) { @Override public Response uploadRangeWithResponse(ShareFileUploadRangeOptions options, @@ -96,7 +96,7 @@ private static Stream writeBehaviorWriteCallsToClientCorrectlySupplie public void writeBehaviorCanSeekAnywhereInFileRange(long fileSize, int position) { AtomicInteger getPropertiesCallCount = new AtomicInteger(0); ShareFileClient client - = new ShareFileClient(null, new AzureFileStorageImpl(null, null, "fakeurl", false, false), "testshare", + = new ShareFileClient(null, new AzureFileStorageImpl(null, "fakeurl", null, false, false, null), "testshare", "testpath", null, null, null, null) { @Override public ShareFileProperties getProperties() { @@ -122,7 +122,7 @@ private static Stream writeBehaviorCanSeekAnywhereInFileRangeSupplier public void writeBehaviorThrowsWhenSeekingBeyondRange(long fileSize, int position) { AtomicInteger getPropertiesCallCount = new AtomicInteger(0); ShareFileClient client - = new ShareFileClient(null, new AzureFileStorageImpl(null, null, "fakeurl", false, false), "testshare", + = new ShareFileClient(null, new AzureFileStorageImpl(null, "fakeurl", null, false, false, null), "testshare", "testpath", null, null, null, null) { @Override public ShareFileProperties getProperties() { @@ -146,7 +146,7 @@ private static Stream writeBehaviorThrowsWhenSeekingBeyondRangeSuppli @Test public void writeBehaviorTruncateUnsupported() { ShareFileClient client - = new ShareFileClient(null, new AzureFileStorageImpl(null, null, "fakeurl", false, false), "testshare", + = new ShareFileClient(null, new AzureFileStorageImpl(null, "fakeurl", null, false, false, null), "testshare", "testpath", null, null, null, null); StorageSeekableByteChannelShareFileWriteBehavior behavior = new StorageSeekableByteChannelShareFileWriteBehavior(client, null, null); diff --git a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java index 74f8922fbf89..aabc36d41185 100644 --- a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java +++ b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java @@ -2,19 +2,28 @@ // Licensed under the MIT License. import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.Editor; import com.azure.autorest.customization.LibraryCustomization; import com.azure.autorest.customization.PackageCustomization; import com.github.javaparser.ParseProblemException; import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.Modifier; import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.BodyDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; import com.github.javaparser.ast.body.MethodDeclaration; import com.github.javaparser.ast.body.Parameter; +import com.github.javaparser.ast.body.VariableDeclarator; +import com.github.javaparser.ast.expr.ArrayInitializerExpr; +import com.github.javaparser.ast.expr.StringLiteralExpr; import com.github.javaparser.ast.stmt.BlockStmt; import com.github.javaparser.ast.stmt.CatchClause; import com.github.javaparser.ast.stmt.Statement; import com.github.javaparser.ast.stmt.TryStmt; import com.github.javaparser.ast.type.ClassOrInterfaceType; import com.github.javaparser.ast.type.Type; +import com.github.javaparser.javadoc.Javadoc; +import com.github.javaparser.javadoc.description.JavadocDescription; import org.slf4j.Logger; import java.util.Arrays; @@ -24,8 +33,62 @@ * Customization class for File Share Storage. */ public class ShareStorageCustomization extends Customization { + private static final String PKG_ROOT = "src/main/java/com/azure/storage/file/share/"; + + private static final String MODELS_PACKAGE = "com.azure.storage.file.share.models"; + + // Models that shipped as @Fluent (public no-arg ctor + setters) before the TypeSpec migration. With + // required-fields-as-ctor-args:true (which must stay true so new models keep required params on the ctor) these + // regenerate as @Immutable with a required-args ctor and no setters -- a breaking change. FluentModelRestorer + // restores the shipped fluent shape per-model. Expand this list from the RevApi "method removed" report. + private static final List FLUENT_MODELS_TO_RESTORE = Arrays.asList( + "FileRange", "ClearRange", "ShareCorsRule", "ShareFileRangeList", "ShareMetrics", "ShareRetentionPolicy", + "ShareSignedIdentifier", "UserDelegationKey"); + + // Generated convenience clients + builders emitted by typespec-java on top of the + // implementation/*Impl operation layer. The public surface is the hand-written Share*-prefixed + // clients, so delete the generated ones. + private static final List GENERATED_CLIENTS_TO_REMOVE = Arrays.asList( + "ServiceClient", "ServiceAsyncClient", + "DirectoryClient", "DirectoryAsyncClient", + "FileClient", "FileAsyncClient", + "ShareClient", "ShareAsyncClient", + // Main service-client public surface — the impl (AzureFileStorageImpl) is kept; only the + // public client/async-client/builder are removed. Both naming variants are listed because + // removeFile is a no-op when absent. + "FileClientBuilder", + "AzureFileStorageClient", "AzureFileStorageAsyncClient", "AzureFileStorageClientBuilder", + "AzureFileStorageBuilder", + // The hand-written ShareServiceVersion is authoritative; the generated enum is discarded and new service + // versions are added by hand. To instead generate it, remove this entry and restore the @clientApiVersions + // block in client.tsp + the FileServiceVersion->ShareServiceVersion rename customization. + "FileServiceVersion"); + + private static final List GENERATED_DESCRIPTOR_FILES_TO_REMOVE = Arrays.asList( + "src/main/java/module-info.java", + "src/main/java/com/azure/storage/file/share/package-info.java", + "src/main/java/com/azure/storage/file/share/models/package-info.java", + "src/main/java/com/azure/storage/file/share/implementation/package-info.java"); + + // Generated implementation classes typed to the generated FileServiceVersion enum, which is deleted (above) in + // favor of the hand-written public ShareServiceVersion. These are retyped to ShareServiceVersion after generation. + private static final List IMPLS_USING_SERVICE_VERSION + = Arrays.asList("AzureFileStorageImpl", "DirectoriesImpl", "FilesImpl", "ServicesImpl", "SharesImpl"); + @Override public void customize(LibraryCustomization customization, Logger logger) { + removeGeneratedConvenienceClients(customization, logger); + + retypeServiceVersionToShareServiceVersion(customization, logger); + + exposeRawListSharesSegment(customization, logger); + + exposeRawListHandles(customization, logger); + + fixXmlSerializerRedundantCast(customization, logger); + + restoreFluentModels(customization, logger); + customization.getClass("com.azure.storage.file.share.models", "ShareTokenIntent") .customizeAst(ast -> ast.getClassByName("ShareTokenIntent").ifPresent(clazz -> clazz.setJavadocComment( "The request intent specifies requests that are intended for backup/admin type operations, meaning " @@ -35,6 +98,265 @@ public void customize(LibraryCustomization customization, Logger logger) { updateImplToMapInternalException(customization.getPackage("com.azure.storage.file.share.implementation")); } + /** + * Deletes the generated convenience clients / builder / service version so the shipped public + * surface is limited to the hand-written Share*-prefixed clients. The generated + * {@code implementation/*Impl} operation layer is retained and continues to be wrapped by the + * hand-written clients. + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void removeGeneratedConvenienceClients(LibraryCustomization customization, Logger logger) { + for (String className : GENERATED_CLIENTS_TO_REMOVE) { + String path = PKG_ROOT + className + ".java"; + customization.getRawEditor().removeFile(path); + logger.info("Removed generated client file: {}", path); + } + for (String path : GENERATED_DESCRIPTOR_FILES_TO_REMOVE) { + customization.getRawEditor().removeFile(path); + logger.info("Removed generated descriptor file (hand-written version preserved): {}", path); + } + } + + /** + * Retypes the generated {@code implementation/*Impl} classes from the generated {@code FileServiceVersion} enum + * (deleted by {@link #removeGeneratedConvenienceClients}) to the hand-written public + * {@code com.azure.storage.file.share.ShareServiceVersion}. Both enums live in {@code com.azure.storage.file.share} + * and share the same shape ({@code implements ServiceVersion}, {@code getVersion()}, {@code getLatest()}), so + * replacing the type token is safe; it also aligns the impl constructors with the {@code ShareServiceVersion} the + * hand-written builders pass. + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void retypeServiceVersionToShareServiceVersion(LibraryCustomization customization, Logger logger) { + Editor editor = customization.getRawEditor(); + for (String implName : IMPLS_USING_SERVICE_VERSION) { + String path = PKG_ROOT + "implementation/" + implName + ".java"; + String content = editor.getFileContent(path); + if (content.contains("FileServiceVersion")) { + editor.replaceFile(path, content.replace("FileServiceVersion", "ShareServiceVersion")); + logger.info("Retyped FileServiceVersion -> ShareServiceVersion in {}", path); + } + } + } + + /** + * Relaxes the javac "redundant cast" lint for the single {@code (Class)} cast the emitter generates in + * {@code XmlSerializer.deserialize}. The current azure-core {@code TypeReference#getJavaClass()} already returns + * {@code Class}, so the cast is redundant and fails the {@code -Werror} build; this adds {@code "cast"} to the + * method's existing {@code @SuppressWarnings}. + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void fixXmlSerializerRedundantCast(LibraryCustomization customization, Logger logger) { + customization.getClass("com.azure.storage.file.share.implementation", "XmlSerializer") + .customizeAst(ast -> ast.getClassByName("XmlSerializer").ifPresent(clazz -> { + clazz.getMethodsByName("deserialize") + .forEach(method -> method.getAnnotationByName("SuppressWarnings") + .filter(annotation -> annotation.isSingleMemberAnnotationExpr()) + .ifPresent(annotation -> annotation.asSingleMemberAnnotationExpr() + .setMemberValue(new ArrayInitializerExpr(new NodeList<>( + new StringLiteralExpr("unchecked"), new StringLiteralExpr("cast")))))); + logger.info("Suppressed redundant-cast warning on XmlSerializer.deserialize"); + })); + } + + /** + * Exposes raw {@code Response} accessors for the List Shares Segment operation. The generated + * {@code listSharesSegmentSinglePage} paging helpers deserialize only the per-item {@code ShareItemInternal} + * elements and discard the {@code NextMarker} from the XML envelope, but the hand-written + * {@code ShareServiceClient#listShares} manages continuation itself. These methods return the full response body so + * the client can deserialize {@code ListSharesResponse} (items + {@code NextMarker}). + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void exposeRawListSharesSegment(LibraryCustomization customization, Logger logger) { + customization.getClass("com.azure.storage.file.share.implementation", "ServicesImpl") + .customizeAst(ast -> ast.getClassByName("ServicesImpl").ifPresent(clazz -> { + if (!clazz.getMethodsByName("listSharesSegmentWithResponse").isEmpty()) { + return; + } + // Bodies are intentionally left without ShareStorageExceptionInternal mapping; + // updateImplToMapInternalException (run later) wraps every class-returning method exactly once. + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "public Response listSharesSegmentWithResponse(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return service.listSharesSegmentSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(),\n" + + " this.client.getFileRequestIntent(), accept, requestOptions, Context.NONE);\n" + + "}")); + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "public Mono> listSharesSegmentWithResponseAsync(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return FluxUtil.withContext(context -> service.listSharesSegment(this.client.getUrl(),\n" + + " this.client.getServiceVersion().getVersion(), this.client.getFileRequestIntent(), accept,\n" + + " requestOptions, context));\n" + + "}")); + logger.info("Exposed raw listSharesSegmentWithResponse methods in ServicesImpl"); + })); + } + + /** + * Exposes raw {@code Response} accessors for the Directory List Handles operation. Like + * {@code listSharesSegment}, the generated paging helpers discard the {@code NextMarker} from the XML envelope, + * but the hand-written {@code ShareDirectoryClient#listHandles} manages continuation itself, so these methods + * return the full response body for the client to deserialize {@code ListHandlesResponse}. + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void exposeRawListHandles(LibraryCustomization customization, Logger logger) { + for (String implName : Arrays.asList("DirectoriesImpl", "FilesImpl")) { + customization.getClass("com.azure.storage.file.share.implementation", implName) + .customizeAst(ast -> ast.getClassByName(implName).ifPresent(clazz -> { + if (!clazz.getMethodsByName("listHandlesWithResponse").isEmpty()) { + return; + } + // Bodies are intentionally left without ShareStorageExceptionInternal mapping; + // updateImplToMapInternalException (run later) wraps every class-returning method exactly once. + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "public Response listHandlesWithResponse(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return service.listHandlesSync(this.client.getUrl(), this.client.getServiceVersion().getVersion(),\n" + + " this.client.isAllowTrailingDot(), this.client.getFileRequestIntent(), accept, requestOptions,\n" + + " Context.NONE);\n" + + "}")); + clazz.addMember(StaticJavaParser.parseMethodDeclaration( + "public Mono> listHandlesWithResponseAsync(RequestOptions requestOptions) {\n" + + " final String accept = \"application/xml\";\n" + + " return FluxUtil.withContext(context -> service.listHandles(this.client.getUrl(),\n" + + " this.client.getServiceVersion().getVersion(), this.client.isAllowTrailingDot(),\n" + + " this.client.getFileRequestIntent(), accept, requestOptions, context));\n" + + "}")); + logger.info("Exposed raw listHandlesWithResponse methods in {}", implName); + })); + } + } + + /** + * Restores the "fluent" shape of models that shipped as {@code @Fluent} (public no-arg constructor + setters) + * before the TypeSpec migration. With {@code required-fields-as-ctor-args: true} (which must stay true so new + * models keep required parameters on their constructor) these regenerate as {@code @Immutable} with a + * required-args constructor and no setters -- a breaking change. Each named model is converted back purely via the + * JavaParser AST (no string replacement): {@code @Immutable} becomes {@code @Fluent}, {@code final} is removed from + * instance fields, a public no-arg constructor is added, and a public fluent setter is added for each field. The + * generated required-args constructor and {@code fromXml}/{@code fromJson} deserialization are left untouched. + * + * @param customization The library customization. + * @param logger The logger. + */ + private static void restoreFluentModels(LibraryCustomization customization, Logger logger) { + PackageCustomization models = customization.getPackage(MODELS_PACKAGE); + for (String modelName : FLUENT_MODELS_TO_RESTORE) { + restoreFluentModel(models, modelName, logger); + } + } + + private static void restoreFluentModel(PackageCustomization models, String modelName, Logger logger) { + models.getClass(modelName).customizeAst(ast -> { + ast.addImport("com.azure.core.annotation.Fluent"); + ast.addImport("com.azure.core.annotation.Generated"); + ast.getClassByName(modelName).ifPresent(clazz -> { + // @Immutable -> @Fluent + clazz.getAnnotationByName("Immutable").ifPresent(annotation -> annotation.remove()); + if (!clazz.isAnnotationPresent("Fluent")) { + clazz.addMarkerAnnotation("Fluent"); + } + + NodeList> members = clazz.getMembers(); + + // Ensure a public no-arg constructor exists, positioned as the first constructor (right after the + // fields) to match the shipped layout. Widen an existing private no-arg ctor in place, otherwise + // insert a new one ahead of the generated required-args constructor. + boolean hasNoArgConstructor = clazz.getConstructors().stream() + .anyMatch(ctor -> ctor.getParameters().isEmpty()); + if (hasNoArgConstructor) { + clazz.getConstructors().stream() + .filter(ctor -> ctor.getParameters().isEmpty()) + .forEach(ctor -> ctor.setModifiers(Modifier.Keyword.PUBLIC)); + } else { + ConstructorDeclaration noArgConstructor = new ConstructorDeclaration(); + noArgConstructor.setName(modelName); + noArgConstructor.setModifiers(Modifier.Keyword.PUBLIC); + noArgConstructor.setBody(StaticJavaParser.parseBlock("{}")); + noArgConstructor.addMarkerAnnotation("Generated"); + noArgConstructor.setJavadocComment(new Javadoc( + JavadocDescription.parseText("Creates an instance of " + modelName + " class."))); + int firstConstructorIndex = indexOfFirstConstructor(members); + if (firstConstructorIndex >= 0) { + members.add(firstConstructorIndex, noArgConstructor); + } else { + members.add(noArgConstructor); + } + } + + // Un-finalize instance fields and add a fluent setter immediately after each field's getter, so the + // getter/setter pairs sit together as they did in the shipped model. + clazz.getFields().stream() + .filter(field -> !field.isStatic()) + .forEach(field -> { + field.removeModifier(Modifier.Keyword.FINAL); + VariableDeclarator variable = field.getVariable(0); + String fieldName = variable.getNameAsString(); + String setterName + = "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); + if (!clazz.getMethodsByName(setterName).isEmpty()) { + return; + } + + MethodDeclaration setter = new MethodDeclaration(); + setter.setName(setterName); + setter.setModifiers(Modifier.Keyword.PUBLIC); + setter.setType(modelName); + setter.addParameter(variable.getTypeAsString(), fieldName); + setter.setBody(StaticJavaParser.parseBlock( + "{ this." + fieldName + " = " + fieldName + "; return this; }")); + setter.addMarkerAnnotation("Generated"); + setter.setJavadocComment(new Javadoc( + JavadocDescription.parseText("Set the " + fieldName + " property.")) + .addBlockTag("param", fieldName, "the " + fieldName + " value to set.") + .addBlockTag("return", "the " + modelName + " object itself.")); + + int getterIndex = indexOfGetter(members, fieldName); + if (getterIndex >= 0) { + members.add(getterIndex + 1, setter); + } else { + members.add(setter); + } + }); + }); + logger.info("Restored fluent shape for model: {}", modelName); + }); + } + + private static int indexOfFirstConstructor(NodeList> members) { + for (int i = 0; i < members.size(); i++) { + if (members.get(i) instanceof ConstructorDeclaration) { + return i; + } + } + return -1; + } + + private static int indexOfGetter(NodeList> members, String fieldName) { + String capitalized = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); + String getterName = "get" + capitalized; + String booleanGetterName = "is" + capitalized; + for (int i = 0; i < members.size(); i++) { + BodyDeclaration member = members.get(i); + if (member instanceof MethodDeclaration) { + String name = ((MethodDeclaration) member).getNameAsString(); + if (name.equals(getterName) || name.equals(booleanGetterName)) { + return i; + } + } + } + return -1; + } + /** * Customizes the implementation classes that will perform calls to the service. The following logic is used: *

diff --git a/sdk/storage/azure-storage-file-share/tsp-location.yaml b/sdk/storage/azure-storage-file-share/tsp-location.yaml new file mode 100644 index 000000000000..1a710edd36c7 --- /dev/null +++ b/sdk/storage/azure-storage-file-share/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/storage/data-plane/FileStorage +commit: +repo: +additionalDirectories: