using System; using System.Diagnostics; using System.Globalization; namespace Octokit { /// /// Metadata of a Github Pages build. /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PagesBuild { public PagesBuild() { } public PagesBuild(string url, PagesBuildStatus status, ApiError error, User pusher, Commit commit, TimeSpan duration, DateTime createdAt, DateTime updatedAt) { Url = url; Status = status; Error = error; Pusher = pusher; Commit = commit; Duration = duration; CreatedAt = createdAt; UpdatedAt = updatedAt; } /// /// The pages's API URL. /// public string Url { get; protected set; } /// /// The status of the build. /// public PagesBuildStatus Status { get; protected set; } /// /// Error details - if there was one. /// public ApiError Error { get; protected set; } /// /// The user whose commit intiated the build. /// public User Pusher { get; protected set; } /// /// Commit SHA. /// public Commit Commit { get; protected set; } /// /// Duration of the build /// public TimeSpan Duration { get; protected set; } public DateTime CreatedAt { get; protected set; } public DateTime UpdatedAt { get; protected set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Pusher: {0}, Status: {1}, Duration: {2}", Pusher.Name, Status.ToString(), Duration.TotalMilliseconds); } } } }