| | | 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.Storage.Models |
| | | 11 | | { |
| | | 12 | | internal static class KeyPermissionExtensions |
| | | 13 | | { |
| | 0 | 14 | | public static string ToSerialString(this KeyPermission value) => value switch |
| | 0 | 15 | | { |
| | 0 | 16 | | KeyPermission.Read => "Read", |
| | 0 | 17 | | KeyPermission.Full => "Full", |
| | 0 | 18 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyPermission value.") |
| | 0 | 19 | | }; |
| | | 20 | | |
| | | 21 | | public static KeyPermission ToKeyPermission(this string value) |
| | | 22 | | { |
| | 0 | 23 | | if (string.Equals(value, "Read", StringComparison.InvariantCultureIgnoreCase)) return KeyPermission.Read; |
| | 48 | 24 | | if (string.Equals(value, "Full", StringComparison.InvariantCultureIgnoreCase)) return KeyPermission.Full; |
| | 0 | 25 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown KeyPermission value."); |
| | | 26 | | } |
| | | 27 | | } |
| | | 28 | | } |