Ejemplo n.º 1
0
        public ResponseWithHeaders <QueueSetMetadataHeaders> SetMetadata(int?timeout = null, IDictionary <string, string> metadata = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateSetMetadataRequest(timeout, metadata);
            _pipeline.Send(message, cancellationToken);
            var headers = new QueueSetMetadataHeaders(message.Response);

            switch (message.Response.Status)
            {
            case 204:
                return(ResponseWithHeaders.FromValue(headers, message.Response));

            default:
                throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
        public async Task <ResponseWithHeaders <QueueSetMetadataHeaders> > SetMetadataAsync(int?timeout = null, IDictionary <string, string> metadata = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateSetMetadataRequest(timeout, metadata);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            var headers = new QueueSetMetadataHeaders(message.Response);

            switch (message.Response.Status)
            {
            case 204:
                return(ResponseWithHeaders.FromValue(headers, message.Response));

            default:
                throw await ClientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }