/// <summary> /// Cancel a running translation operation. /// </summary> /// <param name="cancellationToken">A <see cref="CancellationToken"/> used for the service call.</param> public virtual void Cancel(CancellationToken cancellationToken) { using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(DocumentTranslationOperation)}.{nameof(Cancel)}"); scope.Start(); try { Response <TranslationStatusResult> response = _serviceClient.CancelOperation(new Guid(Id), cancellationToken); _response = response.GetRawResponse(); } catch (Exception e) { scope.Failed(e); throw; } }