public UpdateExtendedQueryTagRequest(string tagPath, UpdateExtendedQueryTagEntry newValue)
 {
     TagPath  = EnsureArg.IsNotNull(tagPath, nameof(tagPath));
     NewValue = EnsureArg.IsNotNull(newValue, nameof(newValue));
 }
Exemplo n.º 2
0
        public async Task <GetExtendedQueryTagEntry> UpdateExtendedQueryTagAsync(string tagPath, UpdateExtendedQueryTagEntry newValue, CancellationToken cancellationToken = default)
        {
            EnsureArg.IsNotNull(tagPath, nameof(tagPath));

            var response = await _dicomWebClient.UpdateExtendedQueryTagAsync(tagPath, newValue, cancellationToken);

            return(await response.GetValueAsync());
        }
Exemplo n.º 3
0
 public static Task <UpdateExtendedQueryTagResponse> UpdateExtendedQueryTagAsync(
     this IMediator mediator, string tagPath, UpdateExtendedQueryTagEntry newValue, CancellationToken cancellationToken)
 {
     EnsureArg.IsNotNull(mediator, nameof(mediator));
     return(mediator.Send(new UpdateExtendedQueryTagRequest(tagPath, newValue), cancellationToken));
 }
        public async Task <DicomWebResponse <GetExtendedQueryTagEntry> > UpdateExtendedQueryTagAsync(string tagPath, UpdateExtendedQueryTagEntry newValue, CancellationToken cancellationToken)
        {
            EnsureArg.IsNotNullOrWhiteSpace(tagPath, nameof(tagPath));
            EnsureArg.IsNotNull(newValue, nameof(newValue));
            EnsureArg.EnumIsDefined(newValue.QueryStatus, nameof(newValue));
            string jsonString = JsonSerializer.Serialize(newValue, _jsonSerializerOptions);
            var    uri        = new Uri($"/{_apiVersion}{DicomWebConstants.BaseExtendedQueryTagUri}/{tagPath}", UriKind.Relative);

            using var request = new HttpRequestMessage(HttpMethod.Patch, uri);
            {
                request.Content = new StringContent(jsonString);
                request.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(DicomWebConstants.ApplicationJsonMediaType);
            }

            HttpResponseMessage response = await HttpClient.SendAsync(request, cancellationToken).ConfigureAwait(false);

            await EnsureSuccessStatusCodeAsync(response).ConfigureAwait(false);

            return(new DicomWebResponse <GetExtendedQueryTagEntry>(response, ValueFactory <GetExtendedQueryTagEntry>));
        }