using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class CommitStatus
{
public CommitStatus() { }
public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, string targetUrl, string description, string context, int id, string url, User creator)
{
CreatedAt = createdAt;
UpdatedAt = updatedAt;
State = state;
TargetUrl = targetUrl;
Description = description;
Context = context;
Id = id;
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 CommitState 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 int Id { 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.
///
Pending,
///
/// The build was successful for the commit.
///
Success,
///
/// There was some error with the build.
///
Error,
///
/// The build completed and reports a failure.
///
Failure
}
}