| | 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.Resources.Models |
| | 11 | | { |
| | 12 | | internal static class SubscriptionStateExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this SubscriptionState value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | SubscriptionState.Enabled => "Enabled", |
| 0 | 17 | | SubscriptionState.Warned => "Warned", |
| 0 | 18 | | SubscriptionState.PastDue => "PastDue", |
| 0 | 19 | | SubscriptionState.Disabled => "Disabled", |
| 0 | 20 | | SubscriptionState.Deleted => "Deleted", |
| 0 | 21 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubscriptionState value.") |
| 0 | 22 | | }; |
| | 23 | |
|
| | 24 | | public static SubscriptionState ToSubscriptionState(this string value) |
| | 25 | | { |
| 40 | 26 | | if (string.Equals(value, "Enabled", StringComparison.InvariantCultureIgnoreCase)) return SubscriptionState.E |
| 0 | 27 | | if (string.Equals(value, "Warned", StringComparison.InvariantCultureIgnoreCase)) return SubscriptionState.Wa |
| 0 | 28 | | if (string.Equals(value, "PastDue", StringComparison.InvariantCultureIgnoreCase)) return SubscriptionState.P |
| 16 | 29 | | if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return SubscriptionState. |
| 0 | 30 | | if (string.Equals(value, "Deleted", StringComparison.InvariantCultureIgnoreCase)) return SubscriptionState.D |
| 0 | 31 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SubscriptionState value."); |
| | 32 | | } |
| | 33 | | } |
| | 34 | | } |