using System.Net;
using System.Text;

namespace isn
{
    public class PushReport
    {
        public string PkgName { get; set; }
        public bool Executed { get; internal set; }
        public bool OK { get; internal set; }
        public bool AlreadyPresent { get; internal set; }
        public string Message { get; internal set; }
        public string StatusCode { get; internal set; }
        public string StackTrace { get; internal set; }

        public string ToDoc()
        {
            StringBuilder sb = new StringBuilder($"= Pushing {PkgName}\n\n");
            if (Executed) sb.AppendLine("* Executed");
            if (OK) sb.AppendLine("* OK");
            if (!string.IsNullOrWhiteSpace(Message))
                sb.AppendLine(Message);
            if (!string.IsNullOrWhiteSpace(StatusCode))
                sb.AppendLine($"* Status Code : ");
            if (!string.IsNullOrWhiteSpace(StackTrace))
                sb.AppendLine($"* StackTrace : ");
            return sb.ToString();
        }
    }
}