| | 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 IndexActionTypeExtensions |
| | 13 | | { |
| 16685 | 14 | | public static string ToSerialString(this IndexActionType value) => value switch |
| 16685 | 15 | | { |
| 33315 | 16 | | IndexActionType.Upload => "upload", |
| 16706 | 17 | | IndexActionType.Merge => "merge", |
| 16699 | 18 | | IndexActionType.MergeOrUpload => "mergeOrUpload", |
| 16705 | 19 | | IndexActionType.Delete => "delete", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexActionType value.") |
| 16685 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static IndexActionType ToIndexActionType(this string value) |
| | 24 | | { |
| 0 | 25 | | if (string.Equals(value, "upload", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Uplo |
| 0 | 26 | | if (string.Equals(value, "merge", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Merge |
| 0 | 27 | | if (string.Equals(value, "mergeOrUpload", StringComparison.InvariantCultureIgnoreCase)) return IndexActionTy |
| 0 | 28 | | if (string.Equals(value, "delete", StringComparison.InvariantCultureIgnoreCase)) return IndexActionType.Dele |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexActionType value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |