/// <summary>
        /// Converts a <see cref="AzureDevOpsPullRequestCommentThread"/> from Azure DevOps to a <see cref="IPullRequestDiscussionThread"/> as used in this addin.
        /// </summary>
        /// <param name="thread">Azure DevOps thread to convert.</param>
        /// <returns>Converted thread.</returns>
        public static IPullRequestDiscussionThread ToPullRequestDiscussionThread(this AzureDevOpsPullRequestCommentThread thread)
        {
            thread.NotNull(nameof(thread));

            return(new PullRequestDiscussionThread(
                       thread.Id,
                       thread.Status.ToPullRequestDiscussionStatus(),
                       thread.FilePath,
                       thread.Comments.Select(x => x.ToPullRequestDiscussionComment()))
            {
                CommentSource = thread.GetCommentSource(),
                CommentIdentifier = thread.GetCommentIdentifier(),
                ProviderType = thread.GetProviderType(),
                Resolution = thread.Status.ToPullRequestDiscussionResolution(),
            });
        }