franz/franz/silver_messages/global/report.cs

36 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
namespace silver_messages.global
{
public class report : message
{
//your name
public string name { get; set; }
//capabilities by name which aren't implied by your name
public Capabilites capabilites { get; set; } = new Capabilites();
//reasons you can't fill capabilities, implied or stated. Ideally with a stack trace.
public List<string> errors { get; set; } = new List<string>();
//warnings about your capabilities
public List<string> warnings { get; set; } = new List<string>();
public status GetStatus()
{
if (errors?.Count > 0)
return status.Errors;
else if (warnings?.Count > 0)
return status.Warnings;
else
return status.Good;
}
public class Capabilites
{
public IEnumerable<string> commands { get; set; }
public IEnumerable<string> checks { get; set; }
}
public enum status { Good, Warnings, Errors };
}
}