| | 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 StateExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this State value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | State.Provisioning => "provisioning", |
| 0 | 17 | | State.Deprovisioning => "deprovisioning", |
| 0 | 18 | | State.Succeeded => "succeeded", |
| 0 | 19 | | State.Failed => "failed", |
| 0 | 20 | | State.NetworkSourceDeleted => "networkSourceDeleted", |
| 0 | 21 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown State value.") |
| 0 | 22 | | }; |
| | 23 | |
|
| | 24 | | public static State ToState(this string value) |
| | 25 | | { |
| 0 | 26 | | if (string.Equals(value, "provisioning", StringComparison.InvariantCultureIgnoreCase)) return State.Provisio |
| 0 | 27 | | if (string.Equals(value, "deprovisioning", StringComparison.InvariantCultureIgnoreCase)) return State.Deprov |
| 32 | 28 | | if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return State.Succeeded; |
| 0 | 29 | | if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return State.Failed; |
| 0 | 30 | | if (string.Equals(value, "networkSourceDeleted", StringComparison.InvariantCultureIgnoreCase)) return State. |
| 0 | 31 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown State value."); |
| | 32 | | } |
| | 33 | | } |
| | 34 | | } |