| | 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 PublicAccessExtensions |
| | 13 | | { |
| 8 | 14 | | public static string ToSerialString(this PublicAccess value) => value switch |
| 8 | 15 | | { |
| 16 | 16 | | PublicAccess.Container => "Container", |
| 0 | 17 | | PublicAccess.Blob => "Blob", |
| 0 | 18 | | PublicAccess.None => "None", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicAccess value.") |
| 8 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static PublicAccess ToPublicAccess(this string value) |
| | 23 | | { |
| 64 | 24 | | if (string.Equals(value, "Container", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.Cont |
| 0 | 25 | | if (string.Equals(value, "Blob", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.Blob; |
| 48 | 26 | | if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return PublicAccess.None; |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown PublicAccess value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |