| | 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.Network.Models |
| | 11 | | { |
| | 12 | | internal static class ResourceIdentityTypeExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this ResourceIdentityType value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | ResourceIdentityType.SystemAssigned => "SystemAssigned", |
| 0 | 17 | | ResourceIdentityType.UserAssigned => "UserAssigned", |
| 0 | 18 | | ResourceIdentityType.SystemAssignedUserAssigned => "SystemAssigned, UserAssigned", |
| 0 | 19 | | ResourceIdentityType.None => "None", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value.") |
| 0 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static ResourceIdentityType ToResourceIdentityType(this string value) |
| | 24 | | { |
| 0 | 25 | | if (string.Equals(value, "SystemAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIden |
| 0 | 26 | | if (string.Equals(value, "UserAssigned", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdenti |
| 0 | 27 | | if (string.Equals(value, "SystemAssigned, UserAssigned", StringComparison.InvariantCultureIgnoreCase)) retur |
| 0 | 28 | | if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return ResourceIdentityType.N |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ResourceIdentityType value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |