| | 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.Messaging.EventGrid.SystemEvents |
| | 11 | | { |
| | 12 | | internal static class MediaJobStateExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this MediaJobState value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | MediaJobState.Canceled => "Canceled", |
| 0 | 17 | | MediaJobState.Canceling => "Canceling", |
| 0 | 18 | | MediaJobState.Error => "Error", |
| 0 | 19 | | MediaJobState.Finished => "Finished", |
| 0 | 20 | | MediaJobState.Processing => "Processing", |
| 0 | 21 | | MediaJobState.Queued => "Queued", |
| 0 | 22 | | MediaJobState.Scheduled => "Scheduled", |
| 0 | 23 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobState value.") |
| 0 | 24 | | }; |
| | 25 | |
|
| | 26 | | public static MediaJobState ToMediaJobState(this string value) |
| | 27 | | { |
| 68 | 28 | | if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Canc |
| 64 | 29 | | if (string.Equals(value, "Canceling", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Can |
| 54 | 30 | | if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Error; |
| 48 | 31 | | if (string.Equals(value, "Finished", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Fini |
| 56 | 32 | | if (string.Equals(value, "Processing", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Pr |
| 20 | 33 | | if (string.Equals(value, "Queued", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Queued |
| 24 | 34 | | if (string.Equals(value, "Scheduled", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Sch |
| 0 | 35 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobState value."); |
| | 36 | | } |
| | 37 | | } |
| | 38 | | } |