| | 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 ScoringFunctionAggregationExtensions |
| | 13 | | { |
| 6 | 14 | | public static string ToSerialString(this ScoringFunctionAggregation value) => value switch |
| 6 | 15 | | { |
| 12 | 16 | | ScoringFunctionAggregation.Sum => "sum", |
| 0 | 17 | | ScoringFunctionAggregation.Average => "average", |
| 0 | 18 | | ScoringFunctionAggregation.Minimum => "minimum", |
| 0 | 19 | | ScoringFunctionAggregation.Maximum => "maximum", |
| 0 | 20 | | ScoringFunctionAggregation.FirstMatching => "firstMatching", |
| 0 | 21 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionAggregation value." |
| 6 | 22 | | }; |
| | 23 | |
|
| | 24 | | public static ScoringFunctionAggregation ToScoringFunctionAggregation(this string value) |
| | 25 | | { |
| 20 | 26 | | if (string.Equals(value, "sum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggregat |
| 0 | 27 | | if (string.Equals(value, "average", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr |
| 0 | 28 | | if (string.Equals(value, "minimum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr |
| 0 | 29 | | if (string.Equals(value, "maximum", StringComparison.InvariantCultureIgnoreCase)) return ScoringFunctionAggr |
| 0 | 30 | | if (string.Equals(value, "firstMatching", StringComparison.InvariantCultureIgnoreCase)) return ScoringFuncti |
| 0 | 31 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ScoringFunctionAggregation value."); |
| | 32 | | } |
| | 33 | | } |
| | 34 | | } |