// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Bonsai.SimulatorApi.Models
{
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;
    using System.Runtime;
    using System.Runtime.Serialization;

    /// <summary>
    /// Defines values for EventType.
    /// </summary>
    [JsonConverter(typeof(StringEnumConverter))]
    public enum EventType
    {
        [EnumMember(Value = "Unspecified")]
        Unspecified,
        [EnumMember(Value = "EpisodeStart")]
        EpisodeStart,
        [EnumMember(Value = "EpisodeStep")]
        EpisodeStep,
        [EnumMember(Value = "EpisodeFinish")]
        EpisodeFinish,
        [EnumMember(Value = "Idle")]
        Idle,
        [EnumMember(Value = "Unregister")]
        Unregister
    }
    internal static class EventTypeEnumExtension
    {
        internal static string ToSerializedValue(this EventType? value)
        {
            return value == null ? null : ((EventType)value).ToSerializedValue();
        }

        internal static string ToSerializedValue(this EventType value)
        {
            switch( value )
            {
                case EventType.Unspecified:
                    return "Unspecified";
                case EventType.EpisodeStart:
                    return "EpisodeStart";
                case EventType.EpisodeStep:
                    return "EpisodeStep";
                case EventType.EpisodeFinish:
                    return "EpisodeFinish";
                case EventType.Idle:
                    return "Idle";
                case EventType.Unregister:
                    return "Unregister";
            }
            return null;
        }

        internal static EventType? ParseEventType(this string value)
        {
            switch( value )
            {
                case "Unspecified":
                    return EventType.Unspecified;
                case "EpisodeStart":
                    return EventType.EpisodeStart;
                case "EpisodeStep":
                    return EventType.EpisodeStep;
                case "EpisodeFinish":
                    return EventType.EpisodeFinish;
                case "Idle":
                    return EventType.Idle;
                case "Unregister":
                    return EventType.Unregister;
            }
            return null;
        }
    }
}
