| | 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 UpgradeModeExtensions |
| | 13 | | { |
| 364 | 14 | | public static string ToSerialString(this UpgradeMode value) => value switch |
| 364 | 15 | | { |
| 704 | 16 | | UpgradeMode.Automatic => "Automatic", |
| 388 | 17 | | UpgradeMode.Manual => "Manual", |
| 0 | 18 | | UpgradeMode.Rolling => "Rolling", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeMode value.") |
| 364 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static UpgradeMode ToUpgradeMode(this string value) |
| | 23 | | { |
| 872 | 24 | | if (string.Equals(value, "Automatic", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Autom |
| 48 | 25 | | if (string.Equals(value, "Manual", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Manual; |
| 0 | 26 | | if (string.Equals(value, "Rolling", StringComparison.InvariantCultureIgnoreCase)) return UpgradeMode.Rolling |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown UpgradeMode value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |