| | | 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 FormContentTypeExtensions |
| | | 13 | | { |
| | 148 | 14 | | public static string ToSerialString(this FormContentType value) => value switch |
| | 148 | 15 | | { |
| | 236 | 16 | | FormContentType.Pdf => "application/pdf", |
| | 192 | 17 | | FormContentType.Jpeg => "image/jpeg", |
| | 152 | 18 | | FormContentType.Png => "image/png", |
| | 160 | 19 | | FormContentType.Tiff => "image/tiff", |
| | 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FormContentType value.") |
| | 148 | 21 | | }; |
| | | 22 | | |
| | | 23 | | public static FormContentType ToFormContentType(this string value) |
| | | 24 | | { |
| | 0 | 25 | | if (string.Equals(value, "application/pdf", StringComparison.InvariantCultureIgnoreCase)) return FormContent |
| | 0 | 26 | | if (string.Equals(value, "image/jpeg", StringComparison.InvariantCultureIgnoreCase)) return FormContentType. |
| | 0 | 27 | | if (string.Equals(value, "image/png", StringComparison.InvariantCultureIgnoreCase)) return FormContentType.P |
| | 0 | 28 | | if (string.Equals(value, "image/tiff", StringComparison.InvariantCultureIgnoreCase)) return FormContentType. |
| | 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FormContentType value."); |
| | | 30 | | } |
| | | 31 | | } |
| | | 32 | | } |