| | | 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.AI.FormRecognizer |
| | | 11 | | { |
| | | 12 | | internal static class OperationStatusExtensions |
| | | 13 | | { |
| | 0 | 14 | | public static string ToSerialString(this OperationStatus value) => value switch |
| | 0 | 15 | | { |
| | 0 | 16 | | OperationStatus.NotStarted => "notStarted", |
| | 0 | 17 | | OperationStatus.Running => "running", |
| | 0 | 18 | | OperationStatus.Succeeded => "succeeded", |
| | 0 | 19 | | OperationStatus.Failed => "failed", |
| | 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value.") |
| | 0 | 21 | | }; |
| | | 22 | | |
| | | 23 | | public static OperationStatus ToOperationStatus(this string value) |
| | | 24 | | { |
| | 1930 | 25 | | if (string.Equals(value, "notStarted", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus. |
| | 880 | 26 | | if (string.Equals(value, "running", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Run |
| | 328 | 27 | | if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.S |
| | 32 | 28 | | if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return OperationStatus.Fail |
| | 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown OperationStatus value."); |
| | | 30 | | } |
| | | 31 | | } |
| | | 32 | | } |