| | 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 PropertyChangeTypeExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this PropertyChangeType value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | PropertyChangeType.Create => "Create", |
| 0 | 17 | | PropertyChangeType.Delete => "Delete", |
| 0 | 18 | | PropertyChangeType.Modify => "Modify", |
| 0 | 19 | | PropertyChangeType.Array => "Array", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PropertyChangeType value.") |
| 0 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static PropertyChangeType ToPropertyChangeType(this string value) |
| | 24 | | { |
| 32 | 25 | | if (string.Equals(value, "Create", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.C |
| 0 | 26 | | if (string.Equals(value, "Delete", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.D |
| 16 | 27 | | if (string.Equals(value, "Modify", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.M |
| 0 | 28 | | if (string.Equals(value, "Array", StringComparison.InvariantCultureIgnoreCase)) return PropertyChangeType.Ar |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PropertyChangeType value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |