| | 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 MediaJobErrorCodeExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this MediaJobErrorCode value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | MediaJobErrorCode.ServiceError => "ServiceError", |
| 0 | 17 | | MediaJobErrorCode.ServiceTransientError => "ServiceTransientError", |
| 0 | 18 | | MediaJobErrorCode.DownloadNotAccessible => "DownloadNotAccessible", |
| 0 | 19 | | MediaJobErrorCode.DownloadTransientError => "DownloadTransientError", |
| 0 | 20 | | MediaJobErrorCode.UploadNotAccessible => "UploadNotAccessible", |
| 0 | 21 | | MediaJobErrorCode.UploadTransientError => "UploadTransientError", |
| 0 | 22 | | MediaJobErrorCode.ConfigurationUnsupported => "ConfigurationUnsupported", |
| 0 | 23 | | MediaJobErrorCode.ContentMalformed => "ContentMalformed", |
| 0 | 24 | | MediaJobErrorCode.ContentUnsupported => "ContentUnsupported", |
| 0 | 25 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCode value.") |
| 0 | 26 | | }; |
| | 27 | |
|
| | 28 | | public static MediaJobErrorCode ToMediaJobErrorCode(this string value) |
| | 29 | | { |
| 32 | 30 | | if (string.Equals(value, "ServiceError", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorC |
| 0 | 31 | | if (string.Equals(value, "ServiceTransientError", StringComparison.InvariantCultureIgnoreCase)) return Media |
| 0 | 32 | | if (string.Equals(value, "DownloadNotAccessible", StringComparison.InvariantCultureIgnoreCase)) return Media |
| 0 | 33 | | if (string.Equals(value, "DownloadTransientError", StringComparison.InvariantCultureIgnoreCase)) return Medi |
| 0 | 34 | | if (string.Equals(value, "UploadNotAccessible", StringComparison.InvariantCultureIgnoreCase)) return MediaJo |
| 0 | 35 | | if (string.Equals(value, "UploadTransientError", StringComparison.InvariantCultureIgnoreCase)) return MediaJ |
| 0 | 36 | | if (string.Equals(value, "ConfigurationUnsupported", StringComparison.InvariantCultureIgnoreCase)) return Me |
| 0 | 37 | | if (string.Equals(value, "ContentMalformed", StringComparison.InvariantCultureIgnoreCase)) return MediaJobEr |
| 0 | 38 | | if (string.Equals(value, "ContentUnsupported", StringComparison.InvariantCultureIgnoreCase)) return MediaJob |
| 0 | 39 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCode value."); |
| | 40 | | } |
| | 41 | | } |
| | 42 | | } |