using System; using System.Diagnostics; using System.Globalization; using Octokit.Internal; namespace Octokit { [DebuggerDisplay("{DebuggerDisplay,nq}")] public class CommitStatus { public CommitStatus() { } public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, string targetUrl, string description, string context, long id, string nodeId, string url, User creator) { CreatedAt = createdAt; UpdatedAt = updatedAt; State = state; TargetUrl = targetUrl; Description = description; Context = context; Id = id; NodeId = nodeId; Url = url; Creator = creator; } /// /// The date the commit status was created. /// public DateTimeOffset CreatedAt { get; protected set; } /// /// The date the commit status was updated. /// public DateTimeOffset UpdatedAt { get; protected set; } /// /// The state of the commit /// public StringEnum State { get; protected set; } /// /// URL associated with this status. GitHub.com displays this URL as a link to allow users to easily see the /// ‘source’ of the Status. /// public string TargetUrl { get; protected set; } /// /// Short description of the status. /// public string Description { get; protected set; } /// /// A string label to differentiate this status from the status of other systems. /// public string Context { get; protected set; } /// /// The unique identifier of the status. /// public long Id { get; protected set; } /// /// GraphQL Node Id /// public string NodeId { get; protected set; } /// /// The URL of the status. /// public string Url { get; protected set; } /// /// The user that created the status. /// public User Creator { get; protected set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "CreatedAt: {0} State: {1}", CreatedAt, State); } } } /// /// Represents the state of a commit. /// public enum CommitState { /// /// The commit state is still being determined. A build server might set this when it starts a build. /// [Parameter(Value = "pending")] Pending, /// /// The build was successful for the commit. /// [Parameter(Value = "success")] Success, /// /// There was some error with the build. /// [Parameter(Value = "error")] Error, /// /// The build completed and reports a failure. /// [Parameter(Value = "failure")] Failure } }