| | 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 RoleDisasterRecoveryExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this RoleDisasterRecovery value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | RoleDisasterRecovery.Primary => "Primary", |
| 0 | 17 | | RoleDisasterRecovery.PrimaryNotReplicating => "PrimaryNotReplicating", |
| 0 | 18 | | RoleDisasterRecovery.Secondary => "Secondary", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDisasterRecovery value.") |
| 0 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static RoleDisasterRecovery ToRoleDisasterRecovery(this string value) |
| | 23 | | { |
| 10494 | 24 | | if (string.Equals(value, "Primary", StringComparison.InvariantCultureIgnoreCase)) return RoleDisasterRecover |
| 1772 | 25 | | if (string.Equals(value, "PrimaryNotReplicating", StringComparison.InvariantCultureIgnoreCase)) return RoleD |
| 3056 | 26 | | if (string.Equals(value, "Secondary", StringComparison.InvariantCultureIgnoreCase)) return RoleDisasterRecov |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RoleDisasterRecovery value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |