| | 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 DefaultActionExtensions |
| | 13 | | { |
| 16 | 14 | | public static string ToSerialString(this DefaultAction value) => value switch |
| 16 | 15 | | { |
| 20 | 16 | | DefaultAction.Allow => "Allow", |
| 28 | 17 | | DefaultAction.Deny => "Deny", |
| 0 | 18 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DefaultAction value.") |
| 16 | 19 | | }; |
| | 20 | |
|
| | 21 | | public static DefaultAction ToDefaultAction(this string value) |
| | 22 | | { |
| 1652 | 23 | | if (string.Equals(value, "Allow", StringComparison.InvariantCultureIgnoreCase)) return DefaultAction.Allow; |
| 40 | 24 | | if (string.Equals(value, "Deny", StringComparison.InvariantCultureIgnoreCase)) return DefaultAction.Deny; |
| 0 | 25 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown DefaultAction value."); |
| | 26 | | } |
| | 27 | | } |
| | 28 | | } |