> response = client.setMetadataWithResponse(metadata, context);
+ return setMetadataWithResponse(new ShareSetMetadataOptions().setMetadata(metadata), timeout, context);
+ }
+
+ /**
+ * Sets the user-defined metadata to associate to the share.
+ *
+ * If {@code null} is passed for the metadata it will clear the metadata associated to the share.
+ *
+ * Code Samples
+ *
+ * Set the metadata to "share:updatedMetadata"
+ *
+ * {@codesnippet com.azure.storage.file.share.ShareClient.setMetadataWithResponse#ShareSetMetadataOptions-Duration-Context}
+ *
+ * For more information, see the
+ * Azure Docs.
+ *
+ * @param options {@link ShareSetMetadataOptions}
+ * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout
+ * concludes a {@link RuntimeException} will be thrown.
+ * @param context Additional context that is passed through the Http pipeline during the service call.
+ * @return A response containing {@link ShareProperties properties of the share} with response status code
+ * @throws ShareStorageException If the share doesn't exist or the metadata contains invalid keys
+ * @throws RuntimeException if the operation doesn't complete before the timeout concludes.
+ */
+ public Response setMetadataWithResponse(ShareSetMetadataOptions options, Duration timeout,
+ Context context) {
+ Mono> response = client.setMetadataWithResponse(options, context);
return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
}
@@ -440,7 +559,27 @@ public Response setMetadataWithResponse(Map metadata,
* @throws ShareStorageException If the share doesn't exist
*/
public PagedIterable getAccessPolicy() {
- return new PagedIterable<>(client.getAccessPolicy());
+ return getAccessPolicy(new ShareGetAccessPolicyOptions());
+ }
+
+ /**
+ * Retrieves stored access policies specified for the share.
+ *
+ * Code Samples
+ *
+ * List the stored access policies
+ *
+ * {@codesnippet com.azure.storage.file.share.ShareClient.getAccessPolicy#ShareGetAccessPolicyOptions}
+ *
+ * For more information, see the
+ * Azure Docs.
+ *
+ * @param options {@link ShareGetAccessPolicyOptions}
+ * @return The stored access policies specified on the queue.
+ * @throws ShareStorageException If the share doesn't exist
+ */
+ public PagedIterable getAccessPolicy(ShareGetAccessPolicyOptions options) {
+ return new PagedIterable<>(client.getAccessPolicy(options));
}
/**
@@ -488,7 +627,35 @@ public ShareInfo setAccessPolicy(List permissions) {
*/
public Response setAccessPolicyWithResponse(List permissions, Duration timeout,
Context context) {
- Mono> response = client.setAccessPolicyWithResponse(permissions, context);
+ return setAccessPolicyWithResponse(new ShareSetAccessPolicyOptions().setPermissions(permissions), timeout,
+ context);
+ }
+
+ /**
+ * Sets stored access policies for the share.
+ *
+ * Code Samples
+ *
+ * Set a read only stored access policy
+ *
+ * {@codesnippet com.azure.storage.file.share.ShareClient.setAccessPolicyWithResponse#ShareSetAccessPolicyOptions-Duration-Context}
+ *
+ * For more information, see the
+ * Azure Docs.
+ *
+ * @param options {@link ShareSetAccessPolicyOptions}
+ * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout
+ * concludes a {@link RuntimeException} will be thrown.
+ * @param context Additional context that is passed through the Http pipeline during the service call.
+ * @return A response containing the {@link ShareInfo information of the share} with headers and response status
+ * code
+ * @throws ShareStorageException If the share doesn't exist, a stored access policy doesn't have all fields filled
+ * out, or the share will have more than five policies.
+ * @throws RuntimeException if the operation doesn't complete before the timeout concludes.
+ */
+ public Response setAccessPolicyWithResponse(ShareSetAccessPolicyOptions options, Duration timeout,
+ Context context) {
+ Mono> response = client.setAccessPolicyWithResponse(options, context);
return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
}
@@ -529,7 +696,31 @@ public ShareStatistics getStatistics() {
* @throws RuntimeException if the operation doesn't complete before the timeout concludes.
*/
public Response getStatisticsWithResponse(Duration timeout, Context context) {
- Mono> response = client.getStatisticsWithResponse(context);
+ return getStatisticsWithResponse(new ShareGetStatisticsOptions(), timeout, context);
+ }
+
+ /**
+ * Retrieves storage statistics about the share.
+ *
+ * Code Samples
+ *
+ * Retrieve the storage statistics
+ *
+ * {@codesnippet com.azure.storage.file.share.ShareClient.getStatisticsWithResponse#ShareGetStatisticsOptions-Duration-Context}
+ *
+ * For more information, see the
+ * Azure Docs.
+ *
+ * @param options {@link ShareGetStatisticsOptions}
+ * @param timeout An optional timeout applied to the operation. If a response is not returned before the timeout
+ * concludes a {@link RuntimeException} will be thrown.
+ * @param context Additional context that is passed through the Http pipeline during the service call.
+ * @return A response containing the {@link ShareStatistics statistics of the share}
+ * @throws RuntimeException if the operation doesn't complete before the timeout concludes.
+ */
+ public Response getStatisticsWithResponse(ShareGetStatisticsOptions options, Duration timeout,
+ Context context) {
+ Mono> response = client.getStatisticsWithResponse(options, context);
return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
}
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 6385b4a03ea81..71cb8782c6a23 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
@@ -20,8 +20,8 @@
import com.azure.storage.common.implementation.StorageImplUtils;
import com.azure.storage.common.sas.AccountSasSignatureValues;
import com.azure.storage.file.share.implementation.AzureFileStorageImpl;
-import com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType;
import com.azure.storage.file.share.implementation.models.ListSharesIncludeType;
+import com.azure.storage.file.share.models.DeleteSnapshotsOptionType;
import com.azure.storage.file.share.models.ShareCorsRule;
import com.azure.storage.file.share.models.ShareServiceProperties;
import com.azure.storage.file.share.models.ShareStorageException;
@@ -498,7 +498,7 @@ Mono> deleteShareWithResponse(String shareName, String snapshot,
}
context = context == null ? Context.NONE : context;
return azureFileStorageClient.shares()
- .deleteWithRestResponseAsync(shareName, snapshot, null, deleteSnapshots,
+ .deleteWithRestResponseAsync(shareName, snapshot, null, deleteSnapshots, null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(response -> new SimpleResponse<>(response, null));
}
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 751ab05dd3c14..080715b1d8d23 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
@@ -20,8 +20,10 @@
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.Context;
-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.SharesAcquireLeaseResponse;
+import com.azure.storage.file.share.implementation.models.SharesBreakLeaseResponse;
+import com.azure.storage.file.share.implementation.models.SharesChangeLeaseResponse;
import com.azure.storage.file.share.implementation.models.SharesCreatePermissionResponse;
import com.azure.storage.file.share.implementation.models.SharesCreateResponse;
import com.azure.storage.file.share.implementation.models.SharesCreateSnapshotResponse;
@@ -30,11 +32,14 @@
import com.azure.storage.file.share.implementation.models.SharesGetPermissionResponse;
import com.azure.storage.file.share.implementation.models.SharesGetPropertiesResponse;
import com.azure.storage.file.share.implementation.models.SharesGetStatisticsResponse;
+import com.azure.storage.file.share.implementation.models.SharesReleaseLeaseResponse;
+import com.azure.storage.file.share.implementation.models.SharesRenewLeaseResponse;
import com.azure.storage.file.share.implementation.models.SharesRestoreResponse;
import com.azure.storage.file.share.implementation.models.SharesSetAccessPolicyResponse;
import com.azure.storage.file.share.implementation.models.SharesSetMetadataResponse;
import com.azure.storage.file.share.implementation.models.SharesSetQuotaResponse;
import com.azure.storage.file.share.models.ShareStorageException;
+import com.azure.storage.file.share.models.DeleteSnapshotsOptionType;
import com.azure.storage.file.share.models.ShareSignedIdentifier;
import java.util.List;
import java.util.Map;
@@ -80,12 +85,37 @@ private interface SharesService {
@Get("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono getProperties(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, Context context);
+ Mono getProperties(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, Context context);
@Delete("{shareName}")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono delete(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("sharesnapshot") String sharesnapshot, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots, @QueryParam("restype") String restype, Context context);
+ Mono delete(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("restype") String restype, Context context);
+
+ @Put("{shareName}")
+ @ExpectedResponses({201})
+ @UnexpectedResponseExceptionType(ShareStorageException.class)
+ Mono acquireLease(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, Context context);
+
+ @Put("{shareName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ShareStorageException.class)
+ Mono releaseLease(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, Context context);
+
+ @Put("{shareName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ShareStorageException.class)
+ Mono changeLease(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, Context context);
+
+ @Put("{shareName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ShareStorageException.class)
+ Mono renewLease(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, Context context);
+
+ @Put("{shareName}")
+ @ExpectedResponses({202})
+ @UnexpectedResponseExceptionType(ShareStorageException.class)
+ Mono breakLease(@PathParam("shareName") String shareName, @HostParam("url") String url, @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, @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action, @QueryParam("restype") String restype, Context context);
@Put("{shareName}")
@ExpectedResponses({201})
@@ -105,27 +135,27 @@ private interface SharesService {
@Put("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono setQuota(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
+ Mono setQuota(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-share-quota") Integer quota, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
@Put("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono setMetadata(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
+ Mono setMetadata(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
@Get("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono getAccessPolicy(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
+ Mono getAccessPolicy(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
@Put("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono setAccessPolicy(@PathParam("shareName") String shareName, @HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifiersWrapper shareAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
+ Mono setAccessPolicy(@PathParam("shareName") String shareName, @HostParam("url") String url, @BodyParam("application/xml; charset=utf-8") SignedIdentifiersWrapper shareAcl, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
@Get("{shareName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ShareStorageException.class)
- Mono getStatistics(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
+ Mono getStatistics(@PathParam("shareName") String shareName, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @QueryParam("restype") String restype, @QueryParam("comp") String comp, Context context);
@Put("{shareName}")
@ExpectedResponses({201})
@@ -179,8 +209,9 @@ public Mono createWithRestResponseAsync(String shareName,
public Mono getPropertiesWithRestResponseAsync(String shareName, Context context) {
final String sharesnapshot = null;
final Integer timeout = null;
+ final String leaseId = null;
final String restype = "share";
- return service.getProperties(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), restype, context);
+ return service.getProperties(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), leaseId, restype, context);
}
/**
@@ -189,14 +220,15 @@ public Mono getPropertiesWithRestResponseAsync(Stri
* @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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getPropertiesWithRestResponseAsync(String shareName, String sharesnapshot, Integer timeout, Context context) {
+ public Mono getPropertiesWithRestResponseAsync(String shareName, String sharesnapshot, Integer timeout, String leaseId, Context context) {
final String restype = "share";
- return service.getProperties(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), restype, context);
+ return service.getProperties(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), leaseId, restype, context);
}
/**
@@ -212,8 +244,9 @@ public Mono deleteWithRestResponseAsync(String shareName,
final String sharesnapshot = null;
final Integer timeout = null;
final DeleteSnapshotsOptionType deleteSnapshots = null;
+ final String leaseId = null;
final String restype = "share";
- return service.delete(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, restype, context);
+ return service.delete(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, leaseId, restype, context);
}
/**
@@ -223,14 +256,221 @@ public Mono deleteWithRestResponseAsync(String shareName,
* @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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting Timeouts for File Service Operations.</a>.
* @param deleteSnapshots Specifies the option include to delete the base share and all of its snapshots. Possible values include: 'include'.
+ * @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.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteWithRestResponseAsync(String shareName, String sharesnapshot, Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, String leaseId, Context context) {
+ final String restype = "share";
+ return service.delete(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, leaseId, restype, context);
+ }
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono acquireLeaseWithRestResponseAsync(String shareName, Context context) {
+ final Integer timeout = null;
+ final Integer duration = null;
+ final String proposedLeaseId = null;
+ final String sharesnapshot = null;
+ final String requestId = null;
+ final String comp = "lease";
+ final String action = "acquire";
+ final String restype = "share";
+ return service.acquireLease(shareName, this.client.getUrl(), timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono acquireLeaseWithRestResponseAsync(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";
+ return service.acquireLease(shareName, this.client.getUrl(), timeout, duration, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono releaseLeaseWithRestResponseAsync(String shareName, String leaseId, Context context) {
+ final Integer timeout = null;
+ final String sharesnapshot = null;
+ final String requestId = null;
+ final String comp = "lease";
+ final String action = "release";
+ final String restype = "share";
+ return service.releaseLease(shareName, this.client.getUrl(), timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono releaseLeaseWithRestResponseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) {
+ final String comp = "lease";
+ final String action = "release";
+ final String restype = "share";
+ return service.releaseLease(shareName, this.client.getUrl(), timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono changeLeaseWithRestResponseAsync(String shareName, String leaseId, Context context) {
+ final Integer timeout = null;
+ final String proposedLeaseId = null;
+ final String sharesnapshot = null;
+ final String requestId = null;
+ final String comp = "lease";
+ final String action = "change";
+ final String restype = "share";
+ return service.changeLease(shareName, this.client.getUrl(), timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono changeLeaseWithRestResponseAsync(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";
+ return service.changeLease(shareName, this.client.getUrl(), timeout, leaseId, proposedLeaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono renewLeaseWithRestResponseAsync(String shareName, String leaseId, Context context) {
+ final Integer timeout = null;
+ final String sharesnapshot = null;
+ final String requestId = null;
+ final String comp = "lease";
+ final String action = "renew";
+ final String restype = "share";
+ return service.renewLease(shareName, this.client.getUrl(), timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono renewLeaseWithRestResponseAsync(String shareName, String leaseId, Integer timeout, String sharesnapshot, String requestId, Context context) {
+ final String comp = "lease";
+ final String action = "renew";
+ final String restype = "share";
+ return service.renewLease(shareName, this.client.getUrl(), timeout, leaseId, this.client.getVersion(), sharesnapshot, requestId, comp, action, restype, context);
+ }
+
+ /**
+ * 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 context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @return a Mono which performs the network request upon subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono breakLeaseWithRestResponseAsync(String shareName, Context context) {
+ final Integer timeout = null;
+ final Integer breakPeriod = null;
+ final String leaseId = null;
+ final String requestId = null;
+ final String sharesnapshot = null;
+ final String comp = "lease";
+ final String action = "break";
+ final String restype = "share";
+ return service.breakLease(shareName, this.client.getUrl(), timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, comp, action, restype, context);
+ }
+
+ /**
+ * 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://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">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.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono deleteWithRestResponseAsync(String shareName, String sharesnapshot, Integer timeout, DeleteSnapshotsOptionType deleteSnapshots, Context context) {
+ public Mono breakLeaseWithRestResponseAsync(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";
- return service.delete(shareName, this.client.getUrl(), sharesnapshot, timeout, this.client.getVersion(), deleteSnapshots, restype, context);
+ return service.breakLease(shareName, this.client.getUrl(), timeout, breakPeriod, leaseId, this.client.getVersion(), requestId, sharesnapshot, comp, action, restype, context);
}
/**
@@ -347,9 +587,10 @@ public Mono