< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchIndexerStatus
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerStatus.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerStatus.Serialization.cs
Covered lines:29
Uncovered lines:13
Coverable lines:42
Total lines:118
Line coverage:69% (29 of 42)
Covered branches:13
Total branches:18
Branch coverage:72.2% (13 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Status()-100%100%
get_LastResult()-100%100%
get_ExecutionHistory()-0%100%
get_Limits()-0%100%
DeserializeSearchIndexerStatus(...)-91.3%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerStatus.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10using System.Linq;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Represents the current status and execution history of an indexer. </summary>
 15    public partial class SearchIndexerStatus
 16    {
 17        /// <summary> Initializes a new instance of SearchIndexerStatus. </summary>
 18        /// <param name="status"> Overall indexer status. </param>
 19        /// <param name="executionHistory"> History of the recent indexer executions, sorted in reverse chronological or
 20        /// <param name="limits"> The execution limits for the indexer. </param>
 21        /// <exception cref="ArgumentNullException"> <paramref name="executionHistory"/> or <paramref name="limits"/> is
 022        internal SearchIndexerStatus(IndexerStatus status, IEnumerable<IndexerExecutionResult> executionHistory, SearchI
 23        {
 024            if (executionHistory == null)
 25            {
 026                throw new ArgumentNullException(nameof(executionHistory));
 27            }
 028            if (limits == null)
 29            {
 030                throw new ArgumentNullException(nameof(limits));
 31            }
 32
 033            Status = status;
 034            ExecutionHistory = executionHistory.ToList();
 035            Limits = limits;
 036        }
 37
 38        /// <summary> Initializes a new instance of SearchIndexerStatus. </summary>
 39        /// <param name="status"> Overall indexer status. </param>
 40        /// <param name="lastResult"> The result of the most recent or an in-progress indexer execution. </param>
 41        /// <param name="executionHistory"> History of the recent indexer executions, sorted in reverse chronological or
 42        /// <param name="limits"> The execution limits for the indexer. </param>
 543        internal SearchIndexerStatus(IndexerStatus status, IndexerExecutionResult lastResult, IReadOnlyList<IndexerExecu
 44        {
 545            Status = status;
 546            LastResult = lastResult;
 547            ExecutionHistory = executionHistory;
 548            Limits = limits;
 549        }
 50
 51        /// <summary> Overall indexer status. </summary>
 552        public IndexerStatus Status { get; }
 53        /// <summary> The result of the most recent or an in-progress indexer execution. </summary>
 554        public IndexerExecutionResult LastResult { get; }
 55        /// <summary> History of the recent indexer executions, sorted in reverse chronological order. </summary>
 056        public IReadOnlyList<IndexerExecutionResult> ExecutionHistory { get; }
 57        /// <summary> The execution limits for the indexer. </summary>
 058        public SearchIndexerLimits Limits { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerStatus.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    public partial class SearchIndexerStatus
 15    {
 16        internal static SearchIndexerStatus DeserializeSearchIndexerStatus(JsonElement element)
 17        {
 518            IndexerStatus status = default;
 519            Optional<IndexerExecutionResult> lastResult = default;
 520            IReadOnlyList<IndexerExecutionResult> executionHistory = default;
 521            SearchIndexerLimits limits = default;
 7022            foreach (var property in element.EnumerateObject())
 23            {
 3024                if (property.NameEquals("status"))
 25                {
 526                    status = property.Value.GetString().ToIndexerStatus();
 527                    continue;
 28                }
 2529                if (property.NameEquals("lastResult"))
 30                {
 531                    if (property.Value.ValueKind == JsonValueKind.Null)
 32                    {
 033                        lastResult = null;
 034                        continue;
 35                    }
 536                    lastResult = IndexerExecutionResult.DeserializeIndexerExecutionResult(property.Value);
 537                    continue;
 38                }
 2039                if (property.NameEquals("executionHistory"))
 40                {
 541                    List<IndexerExecutionResult> array = new List<IndexerExecutionResult>();
 2442                    foreach (var item in property.Value.EnumerateArray())
 43                    {
 744                        array.Add(IndexerExecutionResult.DeserializeIndexerExecutionResult(item));
 45                    }
 546                    executionHistory = array;
 547                    continue;
 48                }
 1549                if (property.NameEquals("limits"))
 50                {
 551                    limits = SearchIndexerLimits.DeserializeSearchIndexerLimits(property.Value);
 52                    continue;
 53                }
 54            }
 555            return new SearchIndexerStatus(status, lastResult.Value, executionHistory, limits);
 56        }
 57    }
 58}