| | 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.Models |
| | 11 | | { |
| | 12 | | internal static class LengthUnitExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this LengthUnit value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | LengthUnit.Pixel => "pixel", |
| 0 | 17 | | LengthUnit.Inch => "inch", |
| 0 | 18 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LengthUnit value.") |
| 0 | 19 | | }; |
| | 20 | |
|
| | 21 | | public static LengthUnit ToLengthUnit(this string value) |
| | 22 | | { |
| 276 | 23 | | if (string.Equals(value, "pixel", StringComparison.InvariantCultureIgnoreCase)) return LengthUnit.Pixel; |
| 312 | 24 | | if (string.Equals(value, "inch", StringComparison.InvariantCultureIgnoreCase)) return LengthUnit.Inch; |
| 0 | 25 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown LengthUnit value."); |
| | 26 | | } |
| | 27 | | } |
| | 28 | | } |