Add ProjectCard property to Issue Events model (#2102)

This commit is contained in:
Maxim Lobanov
2020-02-24 17:56:52 +03:00
committed by GitHub
parent 0074e76a8f
commit fe6639f270
13 changed files with 173 additions and 61 deletions
+15 -1
View File
@@ -9,7 +9,7 @@ namespace Octokit
{
public IssueEvent() { }
public IssueEvent(long id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl)
public IssueEvent(long id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl, RenameInfo rename, IssueEventProjectCard projectCard)
{
Id = id;
NodeId = nodeId;
@@ -22,6 +22,8 @@ namespace Octokit
CreatedAt = createdAt;
Issue = issue;
CommitUrl = commitUrl;
Rename = rename;
ProjectCard = projectCard;
}
/// <summary>
@@ -79,6 +81,18 @@ namespace Octokit
/// </summary>
public Issue Issue { get; protected set; }
/// <summary>
/// An object containing rename details
/// Only provided for renamed events
/// </summary>
public RenameInfo Rename { get; protected set; }
/// <summary>
/// Information about the project card that triggered the event.
/// The project_card attribute is not returned if someone deletes the project board, or if you do not have permission to view it.
/// </summary>
public IssueEventProjectCard ProjectCard { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0} CreatedAt: {1}", Id, CreatedAt); }
@@ -0,0 +1,58 @@
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class IssueEventProjectCard
{
public IssueEventProjectCard() { }
public IssueEventProjectCard(long id, string url, long projectId, string projectUrl, string columnName, string previousColumnName)
{
Id = id;
Url = url;
ProjectId = projectId;
ProjectUrl = projectUrl;
ColumnName = columnName;
PreviousColumnName = previousColumnName;
}
/// <summary>
/// The identification number of the project card.
/// </summary>
public long Id { get; protected set; }
/// <summary>
/// The API URL of the project card, if the card still exists.
/// Not included for removed_from_project events.
/// </summary>
public string Url { get; protected set; }
/// <summary>
/// The identification number of the project.
/// </summary>
public long ProjectId { get; protected set; }
/// <summary>
/// The API URL of the project.
/// </summary>
public string ProjectUrl { get; protected set; }
/// <summary>
/// The name of the column that the card is listed in.
/// </summary>
public string ColumnName { get; protected set; }
/// <summary>
/// The name of the column that the card was listed in prior to column_name
/// Only returned for moved_columns_in_project events.
/// </summary>
public string PreviousColumnName { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0}", Id); }
}
}
}
+18 -1
View File
@@ -9,7 +9,7 @@ namespace Octokit
{
public TimelineEventInfo() { }
public TimelineEventInfo(long id, string nodeId, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename)
public TimelineEventInfo(long id, string nodeId, string url, User actor, string commitId, EventInfoState @event, DateTimeOffset createdAt, Label label, User assignee, Milestone milestone, SourceInfo source, RenameInfo rename, IssueEventProjectCard projectCard)
{
Id = id;
NodeId = nodeId;
@@ -23,6 +23,7 @@ namespace Octokit
Milestone = milestone;
Source = source;
Rename = rename;
ProjectCard = projectCard;
}
public long Id { get; protected set; }
@@ -40,9 +41,25 @@ namespace Octokit
public Label Label { get; protected set; }
public User Assignee { get; protected set; }
public Milestone Milestone { get; protected set; }
/// <summary>
/// The source of reference from another issue
/// Only provided for cross-referenced events
/// </summary>
public SourceInfo Source { get; protected set; }
/// <summary>
/// An object containing rename details
/// Only provided for renamed events
/// </summary>
public RenameInfo Rename { get; protected set; }
/// <summary>
/// The name of the column that the card was listed in prior to column_name.
/// Only returned for moved_columns_in_project events
/// </summary>
public IssueEventProjectCard ProjectCard { get; protected set; }
internal string DebuggerDisplay
{
get { return string.Format(CultureInfo.InvariantCulture, "Id: {0} CreatedAt: {1} Event: {2}", Id, CreatedAt, Event); }