| | 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.Compute.Models |
| | 11 | | { |
| | 12 | | internal static class UpgradeStateExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this UpgradeState value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | UpgradeState.RollingForward => "RollingForward", |
| 0 | 17 | | UpgradeState.Cancelled => "Cancelled", |
| 0 | 18 | | UpgradeState.Completed => "Completed", |
| 0 | 19 | | UpgradeState.Faulted => "Faulted", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeState value.") |
| 0 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static UpgradeState ToUpgradeState(this string value) |
| | 24 | | { |
| 0 | 25 | | if (string.Equals(value, "RollingForward", StringComparison.InvariantCultureIgnoreCase)) return UpgradeState |
| 0 | 26 | | if (string.Equals(value, "Cancelled", StringComparison.InvariantCultureIgnoreCase)) return UpgradeState.Canc |
| 0 | 27 | | if (string.Equals(value, "Completed", StringComparison.InvariantCultureIgnoreCase)) return UpgradeState.Comp |
| 0 | 28 | | if (string.Equals(value, "Faulted", StringComparison.InvariantCultureIgnoreCase)) return UpgradeState.Faulte |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeState value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |