Files
octokit.net/Octokit/Models/Response/CommitComment.cs
Martin Scholz 72e30a7f90 Add reactions to issue, commit comment and review payload (#1405)
* add reactions to issue response payload

* add reactions to commit comment payload

* add reactions to review comment payload

* create tests for issue client

* tests for commitcomment client

* tests for pull request review comment

* change observable tests

* simplify strings

* remove unnecessary clients

* change integration tests to retrieve all reaction types

* create integration test for issue comment client

* fix merge conflicts

* fix merge conflicts

* gets tests passing again

* fix some reaction integration tests

* Fixup unit tests wth preview accepts header
Also applied preview header to a couple of repositoryId based calls that were added by another PR

* Fixup unit tests wth preview accepts header
Also applied preview header to a couple of repositoryId based calls that were added by another PR

* Rework reaction payload tests for IssueComments to handle Get, GetAllForIssue and GetAllForRepository calls

* [WIP] reaction payload tests

* Rework reaction payload tests for IssueComments to handle Get, GetAllForIssue and GetAllForRepository calls

* Rework reaction payload tests for Issues client

* Rework reaction payload tests for PullRequestReviews client

* Rework reaction payload tests for CommitComments client

* Revert "[WIP] reaction payload tests"

This reverts commit a6179b0f21a3ddfe36bfd3ae5eafae0e69b52252.
2016-07-08 20:29:08 +10:00

93 lines
2.6 KiB
C#

using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CommitComment
{
public CommitComment() { }
public CommitComment(int id, Uri url, Uri htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
{
Id = id;
Url = url;
HtmlUrl = htmlUrl;
Body = body;
Path = path;
Position = position;
Line = line;
CommitId = commitId;
User = user;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
}
/// <summary>
/// The issue comment Id.
/// </summary>
public int Id { get; protected set; }
/// <summary>
/// The URL for this repository comment.
/// </summary>
public Uri Url { get; protected set; }
/// <summary>
/// The html URL for this repository comment.
/// </summary>
public Uri HtmlUrl { get; protected set; }
/// <summary>
/// Details about the repository comment.
/// </summary>
public string Body { get; protected set; }
/// <summary>
/// Relative path of the file that was commented on.
/// </summary>
public string Path { get; protected set; }
/// <summary>
/// Line index in the diff that was commented on.
/// </summary>
public int? Position { get; protected set; }
/// <summary>
/// The line number in the file that was commented on.
/// </summary>
public int? Line { get; protected set; }
/// <summary>
/// The commit
/// </summary>
public string CommitId { get; protected set; }
/// <summary>
/// The user that created the repository comment.
/// </summary>
public User User { get; protected set; }
/// <summary>
/// The date the repository comment was created.
/// </summary>
public DateTimeOffset CreatedAt { get; protected set; }
/// <summary>
/// The date the repository comment was last updated.
/// </summary>
public DateTimeOffset? UpdatedAt { get; protected set; }
public ReactionSummary Reactions { get; protected set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Id: {0}, Commit Id: {1}, CreatedAt: {2}", Id, CommitId, CreatedAt);
}
}
}
}