| | 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.Search.Documents.Indexes.Models |
| | 11 | | { |
| | 12 | | internal static class ScoringFunctionInterpolationExtensions |
| | 13 | | { |
| 2 | 14 | | public static string ToSerialString(this ScoringFunctionInterpolation value) => value switch |
| 2 | 15 | | { |
| 4 | 16 | | ScoringFunctionInterpolation.Linear => "linear", |
| 0 | 17 | | ScoringFunctionInterpolation.Constant => "constant", |
| 0 | 18 | | ScoringFunctionInterpolation.Quadratic => "quadratic", |
| 0 | 19 | | ScoringFunctionInterpolation.Logarithmic => "logarithmic", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionInterpolation value |
| 2 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static ScoringFunctionInterpolation ToScoringFunctionInterpolation(this string value) |
| | 24 | | { |
| 20 | 25 | | if (string.Equals(value, "linear", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionInter |
| 0 | 26 | | if (string.Equals(value, "constant", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionInt |
| 0 | 27 | | if (string.Equals(value, "quadratic", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionIn |
| 0 | 28 | | if (string.Equals(value, "logarithmic", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunction |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionInterpolation value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |