Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sdk/storage/Azure.Storage.Blobs.Batching/src/BlobBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ private void SetBatchOperationType(BlobBatchOperationType operationType)

#region DeleteBlob
/// <summary>
/// The <see cref="DeleteBlob(string, string, DeleteSnapshotsOption?, BlobAccessConditions?)"/>
/// The <see cref="DeleteBlob(string, string, DeleteSnapshotsOption, BlobAccessConditions?)"/>
/// operation marks the specified blob or snapshot for deletion. The
/// blob is later deleted during garbage collection.
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see
/// <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
Expand All @@ -116,7 +116,7 @@ private void SetBatchOperationType(BlobBatchOperationType operationType)
/// <param name="blobName">
/// The name of the blob to delete.
/// </param>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -131,7 +131,7 @@ private void SetBatchOperationType(BlobBatchOperationType operationType)
public virtual Response DeleteBlob(
string blobContainerName,
string blobName,
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default)
{
var blobUri = new BlobUriBuilder(_client.Uri)
Expand All @@ -141,26 +141,26 @@ public virtual Response DeleteBlob(
};
return DeleteBlob(
blobUri.ToUri(),
deleteOptions,
snapshotsOption,
accessConditions);
}

/// <summary>
/// The <see cref="DeleteBlob(Uri, DeleteSnapshotsOption?, BlobAccessConditions?)"/>
/// The <see cref="DeleteBlob(Uri, DeleteSnapshotsOption, BlobAccessConditions?)"/>
/// operation marks the specified blob or snapshot for deletion. The
/// blob is later deleted during garbage collection.
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see
/// <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="blobUri">
/// The blob to delete's primary <see cref="Uri"/> endpoint.
/// </param>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -174,14 +174,14 @@ public virtual Response DeleteBlob(
/// </returns>
public virtual Response DeleteBlob(
Uri blobUri,
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default)
{
SetBatchOperationType(BlobBatchOperationType.Delete);
HttpMessage message = BlobRestClient.Blob.DeleteAsync_CreateMessage(
_client.BatchOperationPipeline,
blobUri,
deleteSnapshots: deleteOptions,
deleteSnapshots: snapshotsOption == DeleteSnapshotsOption.None ? null : (DeleteSnapshotsOption?)snapshotsOption,
leaseId: accessConditions?.LeaseAccessConditions?.LeaseId,
ifModifiedSince: accessConditions?.HttpAccessConditions?.IfModifiedSince,
ifUnmodifiedSince: accessConditions?.HttpAccessConditions?.IfUnmodifiedSince,
Expand Down
18 changes: 9 additions & 9 deletions sdk/storage/Azure.Storage.Blobs.Batching/src/BlobBatchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private static async Task UpdateOperationResponses(
/// that the operation should be cancelled.
/// </param>
/// <param name="blobUris">URIs of the blobs to delete.</param>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <returns>
Expand All @@ -455,11 +455,11 @@ private static async Task UpdateOperationResponses(
[ForwardsClientCalls]
public virtual Response[] DeleteBlobs(
IEnumerable<Uri> blobUris,
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
CancellationToken cancellationToken = default) =>
DeleteBlobsInteral(
blobUris,
deleteOptions,
snapshotsOption,
false, // async
cancellationToken)
.EnsureCompleted();
Expand All @@ -474,7 +474,7 @@ public virtual Response[] DeleteBlobs(
/// that the operation should be cancelled.
/// </param>
/// <param name="blobUris">URIs of the blobs to delete.</param>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <returns>
Expand All @@ -488,11 +488,11 @@ public virtual Response[] DeleteBlobs(
[ForwardsClientCalls]
public virtual async Task<Response[]> DeleteBlobsAsync(
IEnumerable<Uri> blobUris,
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
CancellationToken cancellationToken = default) =>
await DeleteBlobsInteral(
blobUris,
deleteOptions,
snapshotsOption,
true, // async
cancellationToken)
.ConfigureAwait(false);
Expand All @@ -503,7 +503,7 @@ await DeleteBlobsInteral(
/// All of the deletions are sent as a single batched request.
/// </summary>
/// <param name="blobUris">URIs of the blobs to delete.</param>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="async">
Expand All @@ -523,7 +523,7 @@ await DeleteBlobsInteral(
/// </remarks>
internal async Task<Response[]> DeleteBlobsInteral(
IEnumerable<Uri> blobUris,
DeleteSnapshotsOption? deleteOptions,
DeleteSnapshotsOption snapshotsOption,
bool async,
CancellationToken cancellationToken)
{
Expand All @@ -534,7 +534,7 @@ internal async Task<Response[]> DeleteBlobsInteral(
BlobBatch batch = CreateBatch();
foreach (Uri uri in blobUris)
{
responses.Add(batch.DeleteBlob(uri, deleteOptions));
responses.Add(batch.DeleteBlob(uri, snapshotsOption));
}

// Submit the batch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void FineGrainedBatching()
// Create a batch with three deletes
BlobBatchClient batchClient = service.GetBlobBatchClient();
BlobBatch batch = batchClient.CreateBatch();
Response fooResponse = batch.DeleteBlob(foo.Uri, DeleteSnapshotsOption.Include);
Response fooResponse = batch.DeleteBlob(foo.Uri, DeleteSnapshotsOption.IncludeSnapshots);
Response barResponse = batch.DeleteBlob(bar.Uri);
Response bazResponse = batch.DeleteBlob(baz.Uri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public async Task FineGrainedBatchingAsync()
// Create a batch with three deletes
BlobBatchClient batchClient = service.GetBlobBatchClient();
BlobBatch batch = batchClient.CreateBatch();
Response fooResponse = batch.DeleteBlob(foo.Uri, DeleteSnapshotsOption.Include);
Response fooResponse = batch.DeleteBlob(foo.Uri, DeleteSnapshotsOption.IncludeSnapshots);
Response barResponse = batch.DeleteBlob(bar.Uri);
Response bazResponse = batch.DeleteBlob(baz.Uri);

Expand Down
50 changes: 25 additions & 25 deletions sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1780,11 +1780,11 @@ private async Task<Response> AbortCopyFromUriInternal(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -1803,11 +1803,11 @@ private async Task<Response> AbortCopyFromUriInternal(
/// a failure occurs.
/// </remarks>
public virtual Response Delete(
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default,
CancellationToken cancellationToken = default) =>
DeleteInternal(
deleteOptions,
snapshotsOption,
accessConditions,
false, // async
cancellationToken)
Expand All @@ -1820,11 +1820,11 @@ public virtual Response Delete(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -1843,11 +1843,11 @@ public virtual Response Delete(
/// a failure occurs.
/// </remarks>
public virtual async Task<Response> DeleteAsync(
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default,
CancellationToken cancellationToken = default) =>
await DeleteInternal(
deleteOptions,
snapshotsOption,
accessConditions,
true, // async
cancellationToken)
Expand All @@ -1860,11 +1860,11 @@ await DeleteInternal(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -1883,11 +1883,11 @@ await DeleteInternal(
/// a failure occurs.
/// </remarks>
public virtual Response<bool> DeleteIfExists(
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default,
CancellationToken cancellationToken = default) =>
DeleteIfExistsInternal(
deleteOptions,
snapshotsOption,
accessConditions ?? default,
false, // async
cancellationToken)
Expand All @@ -1900,11 +1900,11 @@ public virtual Response<bool> DeleteIfExists(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -1923,11 +1923,11 @@ public virtual Response<bool> DeleteIfExists(
/// a failure occurs.
/// </remarks>
public virtual async Task<Response<bool>> DeleteIfExistsAsync(
DeleteSnapshotsOption? deleteOptions = default,
DeleteSnapshotsOption snapshotsOption = default,
BlobAccessConditions? accessConditions = default,
CancellationToken cancellationToken = default) =>
await DeleteIfExistsInternal(
deleteOptions,
snapshotsOption,
accessConditions ?? default,
true, // async
cancellationToken)
Expand All @@ -1940,11 +1940,11 @@ await DeleteIfExistsInternal(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -1966,15 +1966,15 @@ await DeleteIfExistsInternal(
/// a failure occurs.
/// </remarks>
private async Task<Response<bool>> DeleteIfExistsInternal(
DeleteSnapshotsOption? deleteOptions,
DeleteSnapshotsOption snapshotsOption,
BlobAccessConditions accessConditions,
bool async,
CancellationToken cancellationToken)
{
try
{
Response response = await DeleteInternal(
deleteOptions,
snapshotsOption,
accessConditions,
async,
cancellationToken,
Expand All @@ -1996,11 +1996,11 @@ private async Task<Response<bool>> DeleteIfExistsInternal(
///
/// Note that in order to delete a blob, you must delete all of its
/// snapshots. You can delete both at the same time using
/// <see cref="DeleteSnapshotsOption.Include"/>.
/// <see cref="DeleteSnapshotsOption.IncludeSnapshots"/>.
///
/// For more information, see <see href="https://docs.microsoft.com/rest/api/storageservices/delete-blob" />.
/// </summary>
/// <param name="deleteOptions">
/// <param name="snapshotsOption">
/// Specifies options for deleting blob snapshots.
/// </param>
/// <param name="accessConditions">
Expand All @@ -2025,7 +2025,7 @@ private async Task<Response<bool>> DeleteIfExistsInternal(
/// a failure occurs.
/// </remarks>
private async Task<Response> DeleteInternal(
DeleteSnapshotsOption? deleteOptions,
DeleteSnapshotsOption snapshotsOption,
BlobAccessConditions? accessConditions,
bool async,
CancellationToken cancellationToken,
Expand All @@ -2037,7 +2037,7 @@ private async Task<Response> DeleteInternal(
nameof(BlobBaseClient),
message:
$"{nameof(Uri)}: {Uri}\n" +
$"{nameof(deleteOptions)}: {deleteOptions}\n" +
$"{nameof(snapshotsOption)}: {snapshotsOption}\n" +
$"{nameof(accessConditions)}: {accessConditions}");
try
{
Expand All @@ -2046,7 +2046,7 @@ private async Task<Response> DeleteInternal(
Pipeline,
Uri,
leaseId: accessConditions?.LeaseAccessConditions?.LeaseId,
deleteSnapshots: deleteOptions,
deleteSnapshots: snapshotsOption == DeleteSnapshotsOption.None ? null : (DeleteSnapshotsOption?)snapshotsOption,
ifModifiedSince: accessConditions?.HttpAccessConditions?.IfModifiedSince,
ifUnmodifiedSince: accessConditions?.HttpAccessConditions?.IfUnmodifiedSince,
ifMatch: accessConditions?.HttpAccessConditions?.IfMatch,
Expand Down
Loading