public ResponseWithHeaders <QueueDeleteHeaders> Delete(int?timeout = null, CancellationToken cancellationToken = default) { using var message = CreateDeleteRequest(timeout); _pipeline.Send(message, cancellationToken); var headers = new QueueDeleteHeaders(message.Response); switch (message.Response.Status) { case 204: return(ResponseWithHeaders.FromValue(headers, message.Response)); default: throw _clientDiagnostics.CreateRequestFailedException(message.Response); } }
public async Task <ResponseWithHeaders <QueueDeleteHeaders> > DeleteAsync(int?timeout = null, CancellationToken cancellationToken = default) { using var message = CreateDeleteRequest(timeout); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); var headers = new QueueDeleteHeaders(message.Response); switch (message.Response.Status) { case 204: return(ResponseWithHeaders.FromValue(headers, message.Response)); default: throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); } }