| | 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.EventHubs.Models |
| | 11 | | { |
| | 12 | | internal static class EntityStatusExtensions |
| | 13 | | { |
| 8 | 14 | | public static string ToSerialString(this EntityStatus value) => value switch |
| 8 | 15 | | { |
| 16 | 16 | | EntityStatus.Active => "Active", |
| 0 | 17 | | EntityStatus.Disabled => "Disabled", |
| 0 | 18 | | EntityStatus.Restoring => "Restoring", |
| 0 | 19 | | EntityStatus.SendDisabled => "SendDisabled", |
| 0 | 20 | | EntityStatus.ReceiveDisabled => "ReceiveDisabled", |
| 0 | 21 | | EntityStatus.Creating => "Creating", |
| 0 | 22 | | EntityStatus.Deleting => "Deleting", |
| 0 | 23 | | EntityStatus.Renaming => "Renaming", |
| 0 | 24 | | EntityStatus.Unknown => "Unknown", |
| 0 | 25 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EntityStatus value.") |
| 8 | 26 | | }; |
| | 27 | |
|
| | 28 | | public static EntityStatus ToEntityStatus(this string value) |
| | 29 | | { |
| 304 | 30 | | if (string.Equals(value, "Active", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Active; |
| 0 | 31 | | if (string.Equals(value, "Disabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Disab |
| 0 | 32 | | if (string.Equals(value, "Restoring", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Rest |
| 0 | 33 | | if (string.Equals(value, "SendDisabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.S |
| 0 | 34 | | if (string.Equals(value, "ReceiveDisabled", StringComparison.InvariantCultureIgnoreCase)) return EntityStatu |
| 0 | 35 | | if (string.Equals(value, "Creating", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Creat |
| 0 | 36 | | if (string.Equals(value, "Deleting", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Delet |
| 0 | 37 | | if (string.Equals(value, "Renaming", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Renam |
| 0 | 38 | | if (string.Equals(value, "Unknown", StringComparison.InvariantCultureIgnoreCase)) return EntityStatus.Unknow |
| 0 | 39 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown EntityStatus value."); |
| | 40 | | } |
| | 41 | | } |
| | 42 | | } |