<reponame>mpodwysocki/azure-notificationhubs-cadl<filename>cadl-output/csharp/NotificationHubJobType.Serialization.cs<gh_stars>0// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// <auto-generated/>

#nullable disable

using System;

namespace NotificationHubs.Models
{
    internal static partial class NotificationHubJobTypeExtensions
    {
        public static string ToSerialString(this NotificationHubJobType value) => value switch
        {
            NotificationHubJobType.ExportRegistrations => "ExportRegistrations",
            NotificationHubJobType.ImportCreateRegistrations => "ImportCreateRegistrations",
            NotificationHubJobType.ImportUpdateRegistrations => "ImportUpdateRegistrations",
            NotificationHubJobType.ImportDeleteRegistrations => "ImportDeleteRegistrations",
            NotificationHubJobType.ImportUpsertRegistrations => "ImportUpsertRegistrations",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationHubJobType value.")
        };

        public static NotificationHubJobType ToNotificationHubJobType(this string value)
        {
            if (string.Equals(value, "ExportRegistrations", StringComparison.InvariantCultureIgnoreCase)) return NotificationHubJobType.ExportRegistrations;
            if (string.Equals(value, "ImportCreateRegistrations", StringComparison.InvariantCultureIgnoreCase)) return NotificationHubJobType.ImportCreateRegistrations;
            if (string.Equals(value, "ImportUpdateRegistrations", StringComparison.InvariantCultureIgnoreCase)) return NotificationHubJobType.ImportUpdateRegistrations;
            if (string.Equals(value, "ImportDeleteRegistrations", StringComparison.InvariantCultureIgnoreCase)) return NotificationHubJobType.ImportDeleteRegistrations;
            if (string.Equals(value, "ImportUpsertRegistrations", StringComparison.InvariantCultureIgnoreCase)) return NotificationHubJobType.ImportUpsertRegistrations;
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown NotificationHubJobType value.");
        }
    }
}
