using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using Octokit.Internal; namespace Octokit { [DebuggerDisplay("{DebuggerDisplay,nq}")] public class DeploymentStatus { public DeploymentStatus() { } public DeploymentStatus(int id, string nodeId, string url, DeploymentState state, User creator, IReadOnlyDictionary payload, string targetUrl, string logUrl, string environmentUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description) { Id = id; NodeId = nodeId; Url = url; State = state; Creator = creator; Payload = payload; TargetUrl = targetUrl; LogUrl = logUrl; EnvironmentUrl = environmentUrl; CreatedAt = createdAt; UpdatedAt = updatedAt; Description = description; } /// /// Id of this deployment status. /// public int Id { get; protected set; } /// /// GraphQL Node Id /// public string NodeId { get; protected set; } /// /// The API URL for this deployment status. /// public string Url { get; protected set; } /// /// The state of this deployment status. /// public StringEnum State { get; protected set; } /// /// The that created this deployment status. /// public User Creator { get; protected set; } /// /// JSON payload with extra information about the deployment. /// public IReadOnlyDictionary Payload { get; protected set; } /// /// The target URL of this deployment status. This URL should contain /// output to keep the user updated while the task is running or serve /// as historical information for what happened in the deployment /// public string TargetUrl { get; protected set; } /// /// The target URL of this deployment status. This URL should contain /// output to keep the user updated while the task is running or serve as /// historical information for what happened in the deployment /// public string LogUrl { get; protected set; } /// /// The URL for accessing your environment. /// public string EnvironmentUrl { get; protected set; } /// /// The date and time that the status was created. /// public DateTimeOffset CreatedAt { get; protected set; } /// /// The date and time that the status was updated. /// public DateTimeOffset UpdatedAt { get; protected set; } /// /// A short description of the status. /// public string Description { get; protected set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "State: {0} UpdatedAt: {1}", State, UpdatedAt); } } } public enum DeploymentState { [Parameter(Value = "pending")] Pending, [Parameter(Value = "success")] Success, [Parameter(Value = "error")] Error, [Parameter(Value = "failure")] Failure, [Parameter(Value = "inactive")] Inactive, [Parameter(Value = "in_progress")] InProgress, [Parameter(Value = "queued")] Queued } }