| | 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 HostCachingExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this HostCaching value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | HostCaching.None => "None", |
| 0 | 17 | | HostCaching.ReadOnly => "ReadOnly", |
| 0 | 18 | | HostCaching.ReadWrite => "ReadWrite", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostCaching value.") |
| 0 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static HostCaching ToHostCaching(this string value) |
| | 23 | | { |
| 48 | 24 | | if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.None; |
| 0 | 25 | | if (string.Equals(value, "ReadOnly", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.ReadOn |
| 0 | 26 | | if (string.Equals(value, "ReadWrite", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.ReadW |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostCaching value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |