| | | 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.Models |
| | | 11 | | { |
| | | 12 | | internal static class AutocompleteModeExtensions |
| | | 13 | | { |
| | 32 | 14 | | public static string ToSerialString(this AutocompleteMode value) => value switch |
| | 32 | 15 | | { |
| | 56 | 16 | | AutocompleteMode.OneTerm => "oneTerm", |
| | 36 | 17 | | AutocompleteMode.TwoTerms => "twoTerms", |
| | 36 | 18 | | AutocompleteMode.OneTermWithContext => "oneTermWithContext", |
| | 0 | 19 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutocompleteMode value.") |
| | 32 | 20 | | }; |
| | | 21 | | |
| | | 22 | | public static AutocompleteMode ToAutocompleteMode(this string value) |
| | | 23 | | { |
| | 0 | 24 | | if (string.Equals(value, "oneTerm", StringComparison.InvariantCultureIgnoreCase)) return AutocompleteMode.On |
| | 0 | 25 | | if (string.Equals(value, "twoTerms", StringComparison.InvariantCultureIgnoreCase)) return AutocompleteMode.T |
| | 0 | 26 | | if (string.Equals(value, "oneTermWithContext", StringComparison.InvariantCultureIgnoreCase)) return Autocomp |
| | 0 | 27 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AutocompleteMode value."); |
| | | 28 | | } |
| | | 29 | | } |
| | | 30 | | } |