// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System;

namespace Azure.ResourceManager.AppService.Models
{
    internal static partial class SiteAvailabilityStateExtensions
    {
        public static string ToSerialString(this SiteAvailabilityState value) => value switch
        {
            SiteAvailabilityState.Normal => "Normal",
            SiteAvailabilityState.Limited => "Limited",
            SiteAvailabilityState.DisasterRecoveryMode => "DisasterRecoveryMode",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value.")
        };

        public static SiteAvailabilityState ToSiteAvailabilityState(this string value)
        {
            if (string.Equals(value, "Normal", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Normal;
            if (string.Equals(value, "Limited", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.Limited;
            if (string.Equals(value, "DisasterRecoveryMode", StringComparison.InvariantCultureIgnoreCase)) return SiteAvailabilityState.DisasterRecoveryMode;
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SiteAvailabilityState value.");
        }
    }
}
