// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// 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.Azure.Batch.Protocol.Models
{
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;
    using System.Runtime;
    using System.Runtime.Serialization;

    /// <summary>
    /// Defines values for OSType.
    /// </summary>
    [JsonConverter(typeof(StringEnumConverter))]
    public enum OSType
    {
        /// <summary>
        /// The Linux operating system.
        /// </summary>
        [EnumMember(Value = "linux")]
        Linux,
        /// <summary>
        /// The Windows operating system.
        /// </summary>
        [EnumMember(Value = "windows")]
        Windows
    }
    internal static class OSTypeEnumExtension
    {
        internal static string ToSerializedValue(this OSType? value)
        {
            return value == null ? null : ((OSType)value).ToSerializedValue();
        }

        internal static string ToSerializedValue(this OSType value)
        {
            switch( value )
            {
                case OSType.Linux:
                    return "linux";
                case OSType.Windows:
                    return "windows";
            }
            return null;
        }

        internal static OSType? ParseOSType(this string value)
        {
            switch( value )
            {
                case "linux":
                    return OSType.Linux;
                case "windows":
                    return OSType.Windows;
            }
            return null;
        }
    }
}
