| | 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.Training |
| | 11 | | { |
| | 12 | | internal static class TrainingStatusExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this TrainingStatus value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | TrainingStatus.Succeeded => "succeeded", |
| 0 | 17 | | TrainingStatus.PartiallySucceeded => "partiallySucceeded", |
| 0 | 18 | | TrainingStatus.Failed => "failed", |
| 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TrainingStatus value.") |
| 0 | 20 | | }; |
| | 21 | |
|
| | 22 | | public static TrainingStatus ToTrainingStatus(this string value) |
| | 23 | | { |
| 1368 | 24 | | if (string.Equals(value, "succeeded", StringComparison.InvariantCultureIgnoreCase)) return TrainingStatus.Su |
| 0 | 25 | | if (string.Equals(value, "partiallySucceeded", StringComparison.InvariantCultureIgnoreCase)) return Training |
| 0 | 26 | | if (string.Equals(value, "failed", StringComparison.InvariantCultureIgnoreCase)) return TrainingStatus.Faile |
| 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TrainingStatus value."); |
| | 28 | | } |
| | 29 | | } |
| | 30 | | } |