Exemplo n.º 1
0
        public ResponseWithHeaders <QueueGetPropertiesHeaders> GetProperties(int?timeout = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateGetPropertiesRequest(timeout);
            _pipeline.Send(message, cancellationToken);
            var headers = new QueueGetPropertiesHeaders(message.Response);

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

            default:
                throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
Exemplo n.º 2
0
        public async Task <ResponseWithHeaders <QueueGetPropertiesHeaders> > GetPropertiesAsync(int?timeout = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateGetPropertiesRequest(timeout);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            var headers = new QueueGetPropertiesHeaders(message.Response);

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

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