using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using Octokit.Internal; namespace Octokit { [DebuggerDisplay("{DebuggerDisplay,nq}")] public class EventInfo { public EventInfo() { } public EventInfo(long id, string nodeId, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt) { Id = id; NodeId = nodeId; Url = url; Actor = actor; Assignee = assignee; Label = label; Event = @event; CommitId = commitId; CreatedAt = createdAt; } /// /// The id of the issue/pull request event. /// public long Id { get; protected set; } /// /// GraphQL Node Id /// public string NodeId { get; protected set; } /// /// The URL for this event. /// public string Url { get; protected set; } /// /// Always the User that generated the event. /// public User Actor { get; protected set; } /// /// The user that was assigned, if the event was 'Assigned'. /// public User Assignee { get; protected set; } /// /// The label that was assigned, if the event was 'Labeled' /// public Label Label { get; protected set; } /// /// Identifies the actual type of Event that occurred. /// public StringEnum Event { get; protected set; } /// /// The String SHA of a commit that referenced this Issue. /// public string CommitId { get; protected set; } /// /// Date the event occurred for the issue/pull request. /// public DateTimeOffset CreatedAt { get; protected set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Id: {0} CreatedAt: {1}", Id, CreatedAt); } } } public enum EventInfoState { /// /// The issue was closed by the actor. When the commit_id is present, it identifies the commit that /// closed the issue using “closes / fixes #NN” syntax. /// [Parameter(Value = "closed")] Closed, /// /// The issue was reopened by the actor. /// [Parameter(Value = "reopened")] Reopened, /// /// The actor subscribed to receive notifications for an issue. /// [Parameter(Value = "subscribed")] Subscribed, /// /// The issue was merged by the actor. The commit_id attribute is the SHA1 of the HEAD commit that was merged. /// [Parameter(Value = "merged")] Merged, /// /// The issue was referenced from a commit message. The commit_id attribute is the commit SHA1 of where /// that happened. /// [Parameter(Value = "referenced")] Referenced, /// /// The actor was @mentioned in an issue body. /// [Parameter(Value = "mentioned")] Mentioned, /// /// The issue was assigned to the actor. /// [Parameter(Value = "assigned")] Assigned, /// /// The issue was unassigned to the actor. /// [Parameter(Value = "unassigned")] Unassigned, /// /// A label was added to the issue. /// [Parameter(Value = "labeled")] Labeled, /// /// A label was removed from the issue. /// [Parameter(Value = "unlabeled")] Unlabeled, /// /// The issue was added to a milestone. /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Milestoned")] [Parameter(Value = "milestoned")] Milestoned, /// /// The issue was removed from a milestone. /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Demilestoned")] [Parameter(Value = "demilestoned")] Demilestoned, /// /// The issue title was changed. /// [Parameter(Value = "renamed")] Renamed, /// /// The issue was locked by the actor. /// [Parameter(Value = "locked")] Locked, /// /// The issue was unlocked by the actor. /// [Parameter(Value = "unlocked")] Unlocked, /// /// The pull request’s branch was deleted. /// [Parameter(Value = "head_ref_deleted")] HeadRefDeleted, /// /// The pull request’s branch was restored. /// [Parameter(Value = "head_ref_restored")] HeadRefRestored, /// /// The pull request’s branch was force pushed to. /// [Parameter(Value = "head_ref_force_pushed")] HeadRefForcePushed, /// /// The pull request is ready for review /// [Parameter(Value = "ready_for_review")] ReadyForReview, /// /// The actor dismissed a review from the pull request. /// [Parameter(Value = "review_dismissed")] ReviewDismissed, /// /// The actor requested review from the subject on this pull request. /// [Parameter(Value = "review_requested")] ReviewRequested, /// /// The actor removed the review request for the subject on this pull request. /// [Parameter(Value = "review_request_removed")] ReviewRequestRemoved, /// /// The issue was added to a project board. /// [Parameter(Value = "added_to_project")] AddedToProject, /// /// The issue was moved between columns in a project board. /// [Parameter(Value = "moved_columns_in_project")] MovedColumnsInProject, /// /// The issue was removed from a project board. /// [Parameter(Value = "removed_from_project")] RemovedFromProject, /// /// The issue was created by converting a note in a project board to an issue. /// [Parameter(Value = "converted_note_to_issue")] ConvertedNoteToIssue, /// /// The actor unsubscribed from notifications for an issue. /// [Parameter(Value = "unsubscribed")] Unsubscribed, /// /// A comment was added to the issue. /// [Parameter(Value = "commented")] Commented, /// /// A commit was added to the pull request's HEAD branch. /// Only provided for pull requests. /// [Parameter(Value = "committed")] Committed, /// /// Base branch of the pull request was changed. /// [Parameter(Value = "base_ref_changed")] BaseRefChanged, /// /// The issue was referenced from another issue. /// The source attribute contains the id, actor, and /// url of the reference's source. /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Crossreferenced")] [Parameter(Value = "cross-referenced")] Crossreferenced, /// /// The issue was reviewed. /// [Parameter(Value = "reviewed")] Reviewed, /// /// A line comment was made. /// [Parameter(Value = "line-commented")] LineCommented, /// /// A commit comment was made. /// [Parameter(Value = "commit-commented")] CommitCommented, /// /// A user with write permissions marked an issue as a duplicate of another issue or a pull request as a duplicate of another pull request. /// [Parameter(Value = "marked_as_duplicate")] MarkedAsDuplicate, /// /// An issue that a user had previously marked as a duplicate of another issue is no longer considered a duplicate. /// [Parameter(Value = "unmarked_as_duplicate")] UnmarkedAsDuplicate, /// /// An issue comment was deleted. /// [Parameter(Value = "comment_deleted")] CommentDeleted, /// /// An issue was transferred. /// [Parameter(Value = "transferred")] Transferred, /// /// An issue was connected. /// [Parameter(Value = "connected")] Connected, /// /// An issue was pinned. /// [Parameter(Value = "pinned")] Pinned, /// /// An issue was unpinned. /// [Parameter(Value = "unpinned")] Unpinned, } }