| | 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 SearchModeExtensions |
| | 13 | | { |
| 2 | 14 | | public static string ToSerialString(this SearchMode value) => value switch |
| 2 | 15 | | { |
| 0 | 16 | | SearchMode.Any => "any", |
| 4 | 17 | | SearchMode.All => "all", |
| 0 | 18 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchMode value.") |
| 2 | 19 | | }; |
| | 20 | |
|
| | 21 | | public static SearchMode ToSearchMode(this string value) |
| | 22 | | { |
| 0 | 23 | | if (string.Equals(value, "any", StringComparison.InvariantCultureIgnoreCase)) return SearchMode.Any; |
| 0 | 24 | | if (string.Equals(value, "all", StringComparison.InvariantCultureIgnoreCase)) return SearchMode.All; |
| 0 | 25 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchMode value."); |
| | 26 | | } |
| | 27 | | } |
| | 28 | | } |