| | 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 IndexerExecutionStatusExtensions |
| | 13 | | { |
| 0 | 14 | | public static string ToSerialString(this IndexerExecutionStatus value) => value switch |
| 0 | 15 | | { |
| 0 | 16 | | IndexerExecutionStatus.TransientFailure => "transientFailure", |
| 0 | 17 | | IndexerExecutionStatus.Success => "success", |
| 0 | 18 | | IndexerExecutionStatus.InProgress => "inProgress", |
| 0 | 19 | | IndexerExecutionStatus.Reset => "reset", |
| 0 | 20 | | _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerExecutionStatus value.") |
| 0 | 21 | | }; |
| | 22 | |
|
| | 23 | | public static IndexerExecutionStatus ToIndexerExecutionStatus(this string value) |
| | 24 | | { |
| 0 | 25 | | if (string.Equals(value, "transientFailure", StringComparison.InvariantCultureIgnoreCase)) return IndexerExe |
| 24 | 26 | | if (string.Equals(value, "success", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecutionSta |
| 0 | 27 | | if (string.Equals(value, "inProgress", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecution |
| 0 | 28 | | if (string.Equals(value, "reset", StringComparison.InvariantCultureIgnoreCase)) return IndexerExecutionStatu |
| 0 | 29 | | throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown IndexerExecutionStatus value."); |
| | 30 | | } |
| | 31 | | } |
| | 32 | | } |