internal IndexerExecutionInfo(IndexerStatus status, IndexerExecutionResult lastResult, IReadOnlyList <IndexerExecutionResult> executionHistory, IndexerLimits limits) { Status = status; LastResult = lastResult; ExecutionHistory = executionHistory; Limits = limits; }
internal static IndexerExecutionInfo DeserializeIndexerExecutionInfo(JsonElement element) { IndexerStatus status = default; IndexerExecutionResult lastResult = default; IReadOnlyList <IndexerExecutionResult> executionHistory = default; IndexerLimits limits = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("status")) { status = property.Value.GetString().ToIndexerStatus(); continue; } if (property.NameEquals("lastResult")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } lastResult = IndexerExecutionResult.DeserializeIndexerExecutionResult(property.Value); continue; } if (property.NameEquals("executionHistory")) { List <IndexerExecutionResult> array = new List <IndexerExecutionResult>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(IndexerExecutionResult.DeserializeIndexerExecutionResult(item)); } } executionHistory = array; continue; } if (property.NameEquals("limits")) { limits = IndexerLimits.DeserializeIndexerLimits(property.Value); continue; } } return(new IndexerExecutionInfo(status, lastResult, executionHistory, limits)); }