in src/Microsoft.Azure.NotificationHubs/NotificationHubClient.cs [1261:1293]
public async Task PatchInstallationAsync(string installationId, IList<PartialUpdateOperation> operations, CancellationToken cancellationToken)
{
if (string.IsNullOrWhiteSpace(installationId))
{
throw new ArgumentNullException(nameof(installationId));
}
if (operations == null)
{
throw new ArgumentNullException(nameof(operations));
}
if (operations.Count == 0)
{
throw new InvalidOperationException($"{nameof(operations)} list is empty");
}
var requestUri = GetGenericRequestUriBuilder();
requestUri.Path += $"installations/{installationId}";
await _retryPolicy.RunOperation(async (ct) =>
{
using (var request = CreateHttpRequest(new HttpMethod("PATCH"), requestUri.Uri, out var trackingId))
{
request.Content = new StringContent(operations.ToJson(), Encoding.UTF8, "application/json-patch+json");
using (var response = await SendRequestAsync(request, trackingId, HttpStatusCode.OK, ct).ConfigureAwait(false))
{
return true;
}
}
}, cancellationToken);
}