File tree Expand file tree Collapse file tree
sdk/storage/Azure.Storage.Files.Shares Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
815815 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareNotFound { get { throw null ; } }
816816 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotCountExceeded { get { throw null ; } }
817817 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotInProgress { get { throw null ; } }
818+ public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotNotFound { get { throw null ; } }
818819 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null ; } }
819820 public static Azure . Storage . Files . Shares . Models . ShareErrorCode SharingViolation { get { throw null ; } }
820821 public static Azure . Storage . Files . Shares . Models . ShareErrorCode UnsupportedHeader { get { throw null ; } }
Original file line number Diff line number Diff line change @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
815815 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareNotFound { get { throw null ; } }
816816 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotCountExceeded { get { throw null ; } }
817817 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotInProgress { get { throw null ; } }
818+ public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotNotFound { get { throw null ; } }
818819 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null ; } }
819820 public static Azure . Storage . Files . Shares . Models . ShareErrorCode SharingViolation { get { throw null ; } }
820821 public static Azure . Storage . Files . Shares . Models . ShareErrorCode UnsupportedHeader { get { throw null ; } }
Original file line number Diff line number Diff line change @@ -815,6 +815,7 @@ public ShareDirectorySetHttpHeadersOptions() { }
815815 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareNotFound { get { throw null ; } }
816816 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotCountExceeded { get { throw null ; } }
817817 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotInProgress { get { throw null ; } }
818+ public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotNotFound { get { throw null ; } }
818819 public static Azure . Storage . Files . Shares . Models . ShareErrorCode ShareSnapshotOperationNotSupported { get { throw null ; } }
819820 public static Azure . Storage . Files . Shares . Models . ShareErrorCode SharingViolation { get { throw null ; } }
820821 public static Azure . Storage . Files . Shares . Models . ShareErrorCode UnsupportedHeader { get { throw null ; } }
Original file line number Diff line number Diff line change 22 "AssetsRepo" : " Azure/azure-sdk-assets" ,
33 "AssetsRepoPrefixPath" : " net" ,
44 "TagPrefix" : " net/storage/Azure.Storage.Files.Shares" ,
5- "Tag" : " net/storage/Azure.Storage.Files.Shares_2664069888 "
5+ "Tag" : " net/storage/Azure.Storage.Files.Shares_8e80a47735 "
66}
Original file line number Diff line number Diff line change @@ -1423,7 +1423,8 @@ private async Task<Response<bool>> DeleteIfExistsInternal(
14231423 return Response . FromValue ( true , response ) ;
14241424 }
14251425 catch ( RequestFailedException storageRequestFailedException )
1426- when ( storageRequestFailedException . ErrorCode == ShareErrorCode . ShareNotFound )
1426+ when ( storageRequestFailedException . ErrorCode == ShareErrorCode . ShareNotFound
1427+ || storageRequestFailedException . ErrorCode == ShareErrorCode . ShareSnapshotNotFound )
14271428 {
14281429 return Response . FromValue ( false , default ) ;
14291430 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code.
44
55``` yaml
66input-file :
7- - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7dcad34e88d292bc09c89b279a77d6330f5a04f8 /specification/storage/data-plane/Microsoft.FileStorage/stable/2025-11-05/file.json
7+ - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3946d872fb96fe085acd629c213b21794c756b71 /specification/storage/data-plane/Microsoft.FileStorage/stable/2025-11-05/file.json
88generation1-convenience-client : true
99# https://github.com/Azure/autorest/issues/4075
1010skip-semantics-validation : true
Original file line number Diff line number Diff line change @@ -945,6 +945,23 @@ public async Task DeleteIfExistsAsync_NotExists()
945945 Assert . IsFalse ( response . Value ) ;
946946 }
947947
948+ [ RecordedTest ]
949+ public async Task DeleteIfExistsAsync_SnapshotNotFound ( )
950+ {
951+ // Arrange
952+ var shareName = GetNewShareName ( ) ;
953+ ShareServiceClient service = SharesClientBuilder . GetServiceClient_SharedKey ( ) ;
954+ ShareClient share = InstrumentClient ( service . GetShareClient ( shareName ) ) ;
955+ await share . CreateIfNotExistsAsync ( ) ;
956+ ShareClient shareWithSnapshot = share . WithSnapshot ( "2025-02-04T10:17:47.0000000Z" ) ;
957+
958+ // Act
959+ Response < bool > response = await shareWithSnapshot . DeleteIfExistsAsync ( ) ;
960+
961+ // Assert
962+ Assert . IsFalse ( response . Value ) ;
963+ }
964+
948965 [ RecordedTest ]
949966 public async Task DeleteIfExistsAsync_Error ( )
950967 {
You can’t perform that action at this time.
0 commit comments