| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | |
|
| | 10 | | namespace Azure.ResourceManager.EventHubs.Models |
| | 11 | | { |
| | 12 | | internal static class UnavailableReasonExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this UnavailableReason value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | UnavailableReason.None => "None", |
| 0 | 17 | | UnavailableReason.InvalidName => "InvalidName", |
| 0 | 18 | | UnavailableReason.SubscriptionIsDisabled => "SubscriptionIsDisabled", |
| 0 | 19 | | UnavailableReason.NameInUse => "NameInUse", |
| 0 | 20 | | UnavailableReason.NameInLockdown => "NameInLockdown", |
| 0 | 21 | | UnavailableReason.TooManyNamespaceInCurrentSubscription => "TooManyNamespaceInCurrentSubscription", |
| 0 | 22 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnavailableReason value.") |
| 0 | 23 | | }; |
| | 24 | |
|
| | 25 | | public static UnavailableReason ToUnavailableReason(this string value) |
| | 26 | | { |
| 32 | 27 | | if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReason.None |
| 0 | 28 | | if (string.Equals(value, "InvalidName", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReas |
| 0 | 29 | | if (string.Equals(value, "SubscriptionIsDisabled", StringComparison.InvariantCultureIgnoreCase)) return Unav |
| 0 | 30 | | if (string.Equals(value, "NameInUse", StringComparison.InvariantCultureIgnoreCase)) return UnavailableReason |
| 0 | 31 | | if (string.Equals(value, "NameInLockdown", StringComparison.InvariantCultureIgnoreCase)) return UnavailableR |
| 0 | 32 | | if (string.Equals(value, "TooManyNamespaceInCurrentSubscription", StringComparison.InvariantCultureIgnoreCas |
| 0 | 33 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UnavailableReason value."); |
| | 34 | | } |
| | 35 | | } |
| | 36 | | } |