b6be7a351f
* First pass * First pass adding service registraiton * Finished up service registration * Json exception * Moved to the right place * Fixed tests * Added some missing docs strings * Reflecting Gergo's specklepy changes * Correct the DI registration * Readme * No warn beta packages * Format * renamed misleading variable * Fixed lock files * Disable SQLite for automate
22 lines
732 B
C#
22 lines
732 B
C#
namespace Speckle.Automate.Sdk.Schema;
|
|
|
|
public abstract class AutomationStatusMapping
|
|
{
|
|
private const string INITIALIZING = "INITIALIZING";
|
|
private const string RUNNING = "RUNNING";
|
|
private const string FAILED = "FAILED";
|
|
private const string SUCCEEDED = "SUCCEEDED";
|
|
private const string EXCEPTION = "EXCEPTION";
|
|
|
|
public static string Get(AutomationStatus status) =>
|
|
status switch
|
|
{
|
|
AutomationStatus.Running => RUNNING,
|
|
AutomationStatus.Failed => FAILED,
|
|
AutomationStatus.Succeeded => SUCCEEDED,
|
|
AutomationStatus.Initializing => INITIALIZING,
|
|
AutomationStatus.Exception => EXCEPTION,
|
|
_ => throw new ArgumentOutOfRangeException($"Not valid value for enum {status}"),
|
|
};
|
|
}
|