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
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotCountExceeded { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotInProgress { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode SharingViolation { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedHeader { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotCountExceeded { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotInProgress { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode SharingViolation { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedHeader { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotCountExceeded { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotInProgress { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotNotFound { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode SharingViolation { get { throw null; } }
public static Azure.Storage.Files.Shares.Models.ShareErrorCode UnsupportedHeader { get { throw null; } }
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Files.Shares/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/storage/Azure.Storage.Files.Shares",
"Tag": "net/storage/Azure.Storage.Files.Shares_2664069888"
"Tag": "net/storage/Azure.Storage.Files.Shares_8e80a47735"
}

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

3 changes: 2 additions & 1 deletion sdk/storage/Azure.Storage.Files.Shares/src/ShareClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,8 @@ private async Task<Response<bool>> DeleteIfExistsInternal(
return Response.FromValue(true, response);
}
catch (RequestFailedException storageRequestFailedException)
when (storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound)
when (storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound
|| storageRequestFailedException.ErrorCode == ShareErrorCode.ShareSnapshotNotFound)
{
return Response.FromValue(false, default);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/Azure.Storage.Files.Shares/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code.

``` yaml
input-file:
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dcad34e88d292bc09c89b279a77d6330f5a04f8/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-11-05/file.json
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3946d872fb96fe085acd629c213b21794c756b71/specification/storage/data-plane/Microsoft.FileStorage/stable/2025-11-05/file.json
generation1-convenience-client: true
# https://github.com/Azure/autorest/issues/4075
skip-semantics-validation: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,23 @@ public async Task DeleteIfExistsAsync_NotExists()
Assert.IsFalse(response.Value);
}

[RecordedTest]
public async Task DeleteIfExistsAsync_SnapshotNotFound()
{
// Arrange
var shareName = GetNewShareName();
ShareServiceClient service = SharesClientBuilder.GetServiceClient_SharedKey();
ShareClient share = InstrumentClient(service.GetShareClient(shareName));
await share.CreateIfNotExistsAsync();
ShareClient shareWithSnapshot = share.WithSnapshot("2025-02-04T10:17:47.0000000Z");

// Act
Response<bool> response = await shareWithSnapshot.DeleteIfExistsAsync();

// Assert
Assert.IsFalse(response.Value);
}

[RecordedTest]
public async Task DeleteIfExistsAsync_Error()
{
Expand Down