| | 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 CachingTypesExtensions |
| | 13 | | { |
| 456 | 14 | | public static string ToSerialString(this CachingTypes value) => value switch |
| 456 | 15 | | { |
| 904 | 16 | | CachingTypes.None => "None", |
| 464 | 17 | | CachingTypes.ReadOnly => "ReadOnly", |
| 0 | 18 | | CachingTypes.ReadWrite => "ReadWrite", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingTypes value.") |
| 456 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static CachingTypes ToCachingTypes(this string value) |
| | 23 | | { |
| 2784 | 24 | | if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.None; |
| 32 | 25 | | if (string.Equals(value, "ReadOnly", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.ReadO |
| 0 | 26 | | if (string.Equals(value, "ReadWrite", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.Read |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingTypes value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |