예제 #1
0
 public async Task UpdateEndpointAsync(string endpointId,
                                       [FromBody][Required] EndpointRegistrationUpdateApiModel request)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     await _endpoints.UpdateEndpointAsync(endpointId,
                                          request.ToServiceModel());
 }
예제 #2
0
        /// <inheritdoc/>
        public async Task UpdateEndpointAsync(string endpointId,
                                              EndpointRegistrationUpdateApiModel content, CancellationToken ct)
        {
            if (content == null)
            {
                throw new ArgumentNullException(nameof(content));
            }
            if (string.IsNullOrEmpty(endpointId))
            {
                throw new ArgumentNullException(nameof(endpointId));
            }
            var request = _httpClient.NewRequest($"{_serviceUri}/v2/endpoints/{endpointId}",
                                                 _resourceId);

            request.SetContent(content);
            var response = await _httpClient.PatchAsync(request, ct).ConfigureAwait(false);

            response.Validate();
        }