mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-27 16:42:03 +00:00
23b25f5922
* add node_id to Deployments payloads (Deployment and DeploymentStatus and Account/User/Organization) * add node_id to gist responses * add node_id to Git Blob * add node_id to Git Commit response * add node_id to GitReference response * add node_id to everything that inherits GitReference * add node_id to Issue * add node_id to IssueComment/IssueEvent * add node_id to Label * add node_id to Milestone * add node_id to Project/ProjectCard/ProjectColumn * add node_id to Reaction * add node_id to Release/ReleaseAsset * add node_id to Team * add node_id to Repository.RepositoryContributor/RepositoryInvitation/RepositoryTag * add node_id to Commit related responses * Add node_id to PullRequest related responses * Add node_id to any response models it was found to be missing, based on auditing integration test responses * remove unused test variable that was using a response ctor * fix tests that need to handle node_id now * Committer is a request object as well as response, so make nodeId optional * fix test
117 lines
3.3 KiB
C#
117 lines
3.3 KiB
C#
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;
|
||
}
|
||
|
||
/// <summary>
|
||
/// The date the commit status was created.
|
||
/// </summary>
|
||
public DateTimeOffset CreatedAt { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// The date the commit status was updated.
|
||
/// </summary>
|
||
public DateTimeOffset UpdatedAt { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// The state of the commit
|
||
/// </summary>
|
||
public StringEnum<CommitState> State { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// URL associated with this status. GitHub.com displays this URL as a link to allow users to easily see the
|
||
/// ‘source’ of the Status.
|
||
/// </summary>
|
||
public string TargetUrl { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// Short description of the status.
|
||
/// </summary>
|
||
public string Description { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// A string label to differentiate this status from the status of other systems.
|
||
/// </summary>
|
||
public string Context { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// The unique identifier of the status.
|
||
/// </summary>
|
||
public long Id { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// GraphQL Node Id
|
||
/// </summary>
|
||
public string NodeId { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// The URL of the status.
|
||
/// </summary>
|
||
public string Url { get; protected set; }
|
||
|
||
/// <summary>
|
||
/// The user that created the status.
|
||
/// </summary>
|
||
public User Creator { get; protected set; }
|
||
|
||
internal string DebuggerDisplay
|
||
{
|
||
get
|
||
{
|
||
return string.Format(CultureInfo.InvariantCulture, "CreatedAt: {0} State: {1}", CreatedAt, State);
|
||
}
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Represents the state of a commit.
|
||
/// </summary>
|
||
public enum CommitState
|
||
{
|
||
/// <summary>
|
||
/// The commit state is still being determined. A build server might set this when it starts a build.
|
||
/// </summary>
|
||
[Parameter(Value = "pending")]
|
||
Pending,
|
||
|
||
/// <summary>
|
||
/// The build was successful for the commit.
|
||
/// </summary>
|
||
[Parameter(Value = "success")]
|
||
Success,
|
||
|
||
/// <summary>
|
||
/// There was some error with the build.
|
||
/// </summary>
|
||
[Parameter(Value = "error")]
|
||
Error,
|
||
|
||
/// <summary>
|
||
/// The build completed and reports a failure.
|
||
/// </summary>
|
||
[Parameter(Value = "failure")]
|
||
Failure
|
||
}
|
||
}
|