Skip to content

Commit

Permalink
Restored preview default Share Delete behavior (#15989)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcc-msft authored Oct 16, 2020
1 parent 2c4d0e1 commit 7c54b1b
Show file tree
Hide file tree
Showing 22 changed files with 483 additions and 480 deletions.
1 change: 1 addition & 0 deletions sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Fixed bug where ShareDirectoryClient.Exists() and ShareFileClient.Exists() would thrown an exception when the directory or file's parent directory didn't exist.
- Added seekability to ShareFileClient.OpenRead().
- Renamed ShareClient.SetTier() -> ShareClient.SetProperties(). SetProperties() can be used to set both Share Tier and Share Quota.
- Changed ShareDeleteOptions.IncludeSnapshots -> .ShareSnapshotsDeleteOption, and added option to also delete Share Snapshots that have been leased.

## 12.5.0-preview.1 (2020-09-30)
- Added support for service version 2020-02-10.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ public ShareClient(System.Uri shareUri, Azure.Storage.StorageSharedKeyCredential
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.PermissionInfo>> CreatePermissionAsync(string permission, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Storage.Files.Shares.Models.ShareSnapshotInfo> CreateSnapshot(System.Collections.Generic.IDictionary<string, string> metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareSnapshotInfo>> CreateSnapshotAsync(System.Collections.Generic.IDictionary<string, string> metadata = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response Delete(bool includeSnapshots, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteAsync(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response Delete(bool includeSnapshots = true, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteAsync(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteAsync(bool includeSnapshots, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteAsync(bool includeSnapshots = true, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response DeleteDirectory(string directoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDirectoryAsync(string directoryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<bool> DeleteIfExists(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<bool> DeleteIfExists(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual Azure.Response<bool> DeleteIfExists(bool includeSnapshots, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteIfExistsAsync(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<bool> DeleteIfExists(bool includeSnapshots = true, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteIfExistsAsync(Azure.Storage.Files.Shares.Models.ShareDeleteOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteIfExistsAsync(bool includeSnapshots, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteIfExistsAsync(bool includeSnapshots = true, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<bool> Exists(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> ExistsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<System.Collections.Generic.IEnumerable<Azure.Storage.Files.Shares.Models.ShareSignedIdentifier>> GetAccessPolicy(Azure.Storage.Files.Shares.Models.ShareFileRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,5 @@ public class ShareDeleteOptions
/// on deleting the share.
/// </summary>
public ShareFileRequestConditions Conditions { get; set; }

/// <summary>
/// Constructor.
/// </summary>
public ShareDeleteOptions()
{
ShareSnapshotsDeleteOption = Models.ShareSnapshotsDeleteOption.Include;
}
}
}
20 changes: 10 additions & 10 deletions sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ private async Task<Response<bool>> ExistsInternal(
/// a failure occurs.
/// </remarks>
public virtual Response<bool> DeleteIfExists(
ShareDeleteOptions options = default,
ShareDeleteOptions options,
CancellationToken cancellationToken = default) =>
DeleteIfExistsInternal(
includeSnapshots: default,
Expand Down Expand Up @@ -936,7 +936,7 @@ public virtual Response<bool> DeleteIfExists(
/// a failure occurs.
/// </remarks>
public virtual async Task<Response<bool>> DeleteIfExistsAsync(
ShareDeleteOptions options = default,
ShareDeleteOptions options,
CancellationToken cancellationToken = default) =>
await DeleteIfExistsInternal(
includeSnapshots: default,
Expand Down Expand Up @@ -971,8 +971,8 @@ await DeleteIfExistsInternal(
#pragma warning disable AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.
public virtual Response<bool> DeleteIfExists(
#pragma warning restore AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.
bool includeSnapshots,
CancellationToken cancellationToken) =>
bool includeSnapshots = true,
CancellationToken cancellationToken = default) =>
DeleteIfExistsInternal(
includeSnapshots,
shareSnapshotsDeleteOption: default,
Expand Down Expand Up @@ -1006,8 +1006,8 @@ public virtual Response<bool> DeleteIfExists(
#pragma warning disable AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.
public virtual async Task<Response<bool>> DeleteIfExistsAsync(
#pragma warning restore AZC0002 // DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.
bool includeSnapshots,
CancellationToken cancellationToken) =>
bool includeSnapshots = true,
CancellationToken cancellationToken = default) =>
await DeleteIfExistsInternal(
includeSnapshots,
shareSnapshotsDeleteOption: default,
Expand Down Expand Up @@ -1238,7 +1238,7 @@ private async Task<Response<ShareSnapshotInfo>> CreateSnapshotInternal(
/// a failure occurs.
/// </remarks>
public virtual Response Delete(
ShareDeleteOptions options = default,
ShareDeleteOptions options,
CancellationToken cancellationToken = default) =>
DeleteInternal(
includeSnapshots: default,
Expand Down Expand Up @@ -1271,7 +1271,7 @@ public virtual Response Delete(
/// a failure occurs.
/// </remarks>
public virtual async Task<Response> DeleteAsync(
ShareDeleteOptions options = default,
ShareDeleteOptions options,
CancellationToken cancellationToken = default) =>
await DeleteInternal(
includeSnapshots: default,
Expand Down Expand Up @@ -1306,7 +1306,7 @@ await DeleteInternal(
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response Delete(
bool includeSnapshots,
bool includeSnapshots = true,
CancellationToken cancellationToken = default) =>
DeleteInternal(
includeSnapshots,
Expand Down Expand Up @@ -1341,7 +1341,7 @@ public virtual Response Delete(
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual async Task<Response> DeleteAsync(
bool includeSnapshots,
bool includeSnapshots = true,
CancellationToken cancellationToken = default) =>
await DeleteInternal(
includeSnapshots,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c54b1b

Please sign in to comment.