| | 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 ChangeTypeExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this ChangeType value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | ChangeType.Create => "Create", |
| 0 | 17 | | ChangeType.Delete => "Delete", |
| 0 | 18 | | ChangeType.Ignore => "Ignore", |
| 0 | 19 | | ChangeType.Deploy => "Deploy", |
| 0 | 20 | | ChangeType.NoChange => "NoChange", |
| 0 | 21 | | ChangeType.Modify => "Modify", |
| 0 | 22 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChangeType value.") |
| 0 | 23 | | }; |
| | 24 | |
|
| | 25 | | public static ChangeType ToChangeType(this string value) |
| | 26 | | { |
| 90 | 27 | | if (string.Equals(value, "Create", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Create; |
| 42 | 28 | | if (string.Equals(value, "Delete", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Delete; |
| 42 | 29 | | if (string.Equals(value, "Ignore", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Ignore; |
| 32 | 30 | | if (string.Equals(value, "Deploy", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Deploy; |
| 24 | 31 | | if (string.Equals(value, "NoChange", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.NoChang |
| 32 | 32 | | if (string.Equals(value, "Modify", StringComparison.InvariantCultureIgnoreCase)) return ChangeType.Modify; |
| 0 | 33 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChangeType value."); |
| | 34 | | } |
| | 35 | | } |
| | 36 | | } |