<PackageReference Include="Azure.Storage.Blobs" Version="12.25.0-beta.1" />

NoBodyResponse<T>

class NoBodyResponse<T> : Response<T>
NOTE: This type should not be used going forward. Use NoValueResponse{T} instead.
using System; using System.Runtime.CompilerServices; namespace Azure { internal class NoBodyResponse<T> { private class ResponseBodyNotFoundException : Exception { public int Status { get; } public ResponseBodyNotFoundException(int status, string message) : base(message) { Status = status; } } private readonly Response _response; public override bool HasValue => false; public override T Value { get { throw new ResponseBodyNotFoundException(_response.get_Status(), _response.get_ReasonPhrase()); } } public NoBodyResponse(Response response) { _response = response; } public override Response GetRawResponse() { return _response; } public override string ToString() { DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(37, 1); defaultInterpolatedStringHandler.AppendLiteral("Status: "); defaultInterpolatedStringHandler.AppendFormatted<int>(this.GetRawResponse().get_Status()); defaultInterpolatedStringHandler.AppendLiteral(", Service returned no content"); return defaultInterpolatedStringHandler.ToStringAndClear(); } } }