< Summary

Class:Azure.Search.Documents.Indexes.Models.IndexerExecutionResult
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerExecutionResult.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerExecutionResult.Serialization.cs
Covered lines:59
Uncovered lines:24
Coverable lines:83
Total lines:188
Line coverage:71% (59 of 83)
Covered branches:26
Total branches:32
Branch coverage:81.2% (26 of 32)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Status()-100%100%
get_ErrorMessage()-0%100%
get_StartTime()-0%100%
get_EndTime()-0%100%
get_Errors()-0%100%
get_Warnings()-0%100%
get_ItemCount()-0%100%
get_FailedItemCount()-0%100%
get_InitialTrackingState()-0%100%
get_FinalTrackingState()-0%100%
DeserializeIndexerExecutionResult(...)-92%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerExecutionResult.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 result of an individual indexer execution. </summary>
 15    public partial class IndexerExecutionResult
 16    {
 17        /// <summary> Initializes a new instance of IndexerExecutionResult. </summary>
 18        /// <param name="status"> The outcome of this indexer execution. </param>
 19        /// <param name="errors"> The item-level indexing errors. </param>
 20        /// <param name="warnings"> The item-level indexing warnings. </param>
 21        /// <param name="itemCount"> The number of items that were processed during this indexer execution. This include
 22        /// <param name="failedItemCount"> The number of items that failed to be indexed during this indexer execution. 
 23        /// <exception cref="ArgumentNullException"> <paramref name="errors"/> or <paramref name="warnings"/> is null. <
 024        internal IndexerExecutionResult(IndexerExecutionStatus status, IEnumerable<SearchIndexerError> errors, IEnumerab
 25        {
 026            if (errors == null)
 27            {
 028                throw new ArgumentNullException(nameof(errors));
 29            }
 030            if (warnings == null)
 31            {
 032                throw new ArgumentNullException(nameof(warnings));
 33            }
 34
 035            Status = status;
 036            Errors = errors.ToList();
 037            Warnings = warnings.ToList();
 038            ItemCount = itemCount;
 039            FailedItemCount = failedItemCount;
 040        }
 41
 42        /// <summary> Initializes a new instance of IndexerExecutionResult. </summary>
 43        /// <param name="status"> The outcome of this indexer execution. </param>
 44        /// <param name="errorMessage"> The error message indicating the top-level error, if any. </param>
 45        /// <param name="startTime"> The start time of this indexer execution. </param>
 46        /// <param name="endTime"> The end time of this indexer execution, if the execution has already completed. </par
 47        /// <param name="errors"> The item-level indexing errors. </param>
 48        /// <param name="warnings"> The item-level indexing warnings. </param>
 49        /// <param name="itemCount"> The number of items that were processed during this indexer execution. This include
 50        /// <param name="failedItemCount"> The number of items that failed to be indexed during this indexer execution. 
 51        /// <param name="initialTrackingState"> Change tracking state with which an indexer execution started. </param>
 52        /// <param name="finalTrackingState"> Change tracking state with which an indexer execution finished. </param>
 1253        internal IndexerExecutionResult(IndexerExecutionStatus status, string errorMessage, DateTimeOffset? startTime, D
 54        {
 1255            Status = status;
 1256            ErrorMessage = errorMessage;
 1257            StartTime = startTime;
 1258            EndTime = endTime;
 1259            Errors = errors;
 1260            Warnings = warnings;
 1261            ItemCount = itemCount;
 1262            FailedItemCount = failedItemCount;
 1263            InitialTrackingState = initialTrackingState;
 1264            FinalTrackingState = finalTrackingState;
 1265        }
 66
 67        /// <summary> The outcome of this indexer execution. </summary>
 568        public IndexerExecutionStatus Status { get; }
 69        /// <summary> The error message indicating the top-level error, if any. </summary>
 070        public string ErrorMessage { get; }
 71        /// <summary> The start time of this indexer execution. </summary>
 072        public DateTimeOffset? StartTime { get; }
 73        /// <summary> The end time of this indexer execution, if the execution has already completed. </summary>
 074        public DateTimeOffset? EndTime { get; }
 75        /// <summary> The item-level indexing errors. </summary>
 076        public IReadOnlyList<SearchIndexerError> Errors { get; }
 77        /// <summary> The item-level indexing warnings. </summary>
 078        public IReadOnlyList<SearchIndexerWarning> Warnings { get; }
 79        /// <summary> The number of items that were processed during this indexer execution. This includes both successf
 080        public int ItemCount { get; }
 81        /// <summary> The number of items that failed to be indexed during this indexer execution. </summary>
 082        public int FailedItemCount { get; }
 83        /// <summary> Change tracking state with which an indexer execution started. </summary>
 084        public string InitialTrackingState { get; }
 85        /// <summary> Change tracking state with which an indexer execution finished. </summary>
 086        public string FinalTrackingState { get; }
 87    }
 88}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexerExecutionResult.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;
 9using System.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.Search.Documents.Indexes.Models
 14{
 15    public partial class IndexerExecutionResult
 16    {
 17        internal static IndexerExecutionResult DeserializeIndexerExecutionResult(JsonElement element)
 18        {
 1219            IndexerExecutionStatus status = default;
 1220            Optional<string> errorMessage = default;
 1221            Optional<DateTimeOffset> startTime = default;
 1222            Optional<DateTimeOffset?> endTime = default;
 1223            IReadOnlyList<SearchIndexerError> errors = default;
 1224            IReadOnlyList<SearchIndexerWarning> warnings = default;
 1225            int itemsProcessed = default;
 1226            int itemsFailed = default;
 1227            Optional<string> initialTrackingState = default;
 1228            Optional<string> finalTrackingState = default;
 28829            foreach (var property in element.EnumerateObject())
 30            {
 13231                if (property.NameEquals("status"))
 32                {
 1233                    status = property.Value.GetString().ToIndexerExecutionStatus();
 1234                    continue;
 35                }
 12036                if (property.NameEquals("errorMessage"))
 37                {
 1238                    errorMessage = property.Value.GetString();
 1239                    continue;
 40                }
 10841                if (property.NameEquals("startTime"))
 42                {
 1243                    startTime = property.Value.GetDateTimeOffset("O");
 1244                    continue;
 45                }
 9646                if (property.NameEquals("endTime"))
 47                {
 1248                    if (property.Value.ValueKind == JsonValueKind.Null)
 49                    {
 050                        endTime = null;
 051                        continue;
 52                    }
 1253                    endTime = property.Value.GetDateTimeOffset("O");
 1254                    continue;
 55                }
 8456                if (property.NameEquals("errors"))
 57                {
 1258                    List<SearchIndexerError> array = new List<SearchIndexerError>();
 059                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 061                        array.Add(SearchIndexerError.DeserializeSearchIndexerError(item));
 62                    }
 1263                    errors = array;
 1264                    continue;
 65                }
 7266                if (property.NameEquals("warnings"))
 67                {
 1268                    List<SearchIndexerWarning> array = new List<SearchIndexerWarning>();
 2869                    foreach (var item in property.Value.EnumerateArray())
 70                    {
 271                        array.Add(SearchIndexerWarning.DeserializeSearchIndexerWarning(item));
 72                    }
 1273                    warnings = array;
 1274                    continue;
 75                }
 6076                if (property.NameEquals("itemsProcessed"))
 77                {
 1278                    itemsProcessed = property.Value.GetInt32();
 1279                    continue;
 80                }
 4881                if (property.NameEquals("itemsFailed"))
 82                {
 1283                    itemsFailed = property.Value.GetInt32();
 1284                    continue;
 85                }
 3686                if (property.NameEquals("initialTrackingState"))
 87                {
 1288                    initialTrackingState = property.Value.GetString();
 1289                    continue;
 90                }
 2491                if (property.NameEquals("finalTrackingState"))
 92                {
 1293                    finalTrackingState = property.Value.GetString();
 94                    continue;
 95                }
 96            }
 1297            return new IndexerExecutionResult(status, errorMessage.Value, Optional.ToNullable(startTime), Optional.ToNul
 98        }
 99    }
 100}