Files
octokit.net/Octokit/Models/Response/CommitComment.cs
Ryan Gribble 23b25f5922 add GraphQL Node ID's to response models (#1806)
* add node_id to Deployments payloads (Deployment and DeploymentStatus and Account/User/Organization)

* add node_id to gist responses

* add node_id to Git Blob

* add node_id to Git Commit response

* add node_id to GitReference response

* add node_id to everything that inherits GitReference

* add node_id to Issue

* add node_id to IssueComment/IssueEvent

* add node_id to Label

* add node_id to Milestone

* add node_id to Project/ProjectCard/ProjectColumn

* add node_id to Reaction

* add node_id to Release/ReleaseAsset

* add node_id to Team

* add node_id to Repository.RepositoryContributor/RepositoryInvitation/RepositoryTag

* add node_id to Commit related responses

* Add node_id to PullRequest related responses

* Add node_id to any response models it was found to be missing, based on auditing integration test responses

* remove unused test variable that was using a response ctor

* fix tests that need to handle node_id now

* Committer is a request object as well as response, so make nodeId optional

* fix test
2018-06-29 15:41:50 +10:00

103 lines
3.0 KiB
C#

using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CommitComment
{
public CommitComment() { }
public CommitComment(int id, string nodeId, string url, string htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt, ReactionSummary reactions)
{
Id = id;
NodeId = nodeId;
Url = url;
HtmlUrl = htmlUrl;
Body = body;
Path = path;
Position = position;
Line = line;
CommitId = commitId;
User = user;
CreatedAt = createdAt;
UpdatedAt = updatedAt;
Reactions = reactions;
}
/// <summary>
/// The issue comment Id.
/// </summary>
public int Id { get; protected set; }
/// <summary>
/// GraphQL Node Id
/// </summary>
public string NodeId { get; protected set; }
/// <summary>
/// The URL for this repository comment.
/// </summary>
public string Url { get; protected set; }
/// <summary>
/// The html URL for this repository comment.
/// </summary>
public string 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; }
/// <summary>
/// The reaction summary for this comment.
/// </summary>
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);
}
}
}
}