< Summary

Class:Azure.Search.Documents.Indexes.Models.IndexingParameters
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexingParameters.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexingParameters.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\IndexingParameters.cs
Covered lines:49
Uncovered lines:18
Coverable lines:67
Total lines:183
Line coverage:73.1% (49 of 67)
Covered branches:22
Total branches:34
Branch coverage:64.7% (22 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_BatchSize()-100%100%
get_MaxFailedItems()-100%100%
get_MaxFailedItemsPerBatch()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-52%43.75%
DeserializeIndexingParameters(...)-79.31%83.33%
get_Configuration()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexingParameters.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 Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    /// <summary> Represents parameters for indexer execution. </summary>
 14    public partial class IndexingParameters
 15    {
 16        /// <summary> Initializes a new instance of IndexingParameters. </summary>
 3417        public IndexingParameters()
 18        {
 3419            Configuration = new ChangeTrackingDictionary<string, object>();
 3420        }
 21
 22        /// <summary> Initializes a new instance of IndexingParameters. </summary>
 23        /// <param name="batchSize"> The number of items that are read from the data source and indexed as a single batc
 24        /// <param name="maxFailedItems"> The maximum number of items that can fail indexing for indexer execution to st
 25        /// <param name="maxFailedItemsPerBatch"> The maximum number of items in a single batch that can fail indexing f
 26        /// <param name="configuration"> A dictionary of indexer-specific configuration properties. Each name is the nam
 127        internal IndexingParameters(int? batchSize, int? maxFailedItems, int? maxFailedItemsPerBatch, IDictionary<string
 28        {
 129            BatchSize = batchSize;
 130            MaxFailedItems = maxFailedItems;
 131            MaxFailedItemsPerBatch = maxFailedItemsPerBatch;
 132            Configuration = configuration;
 133        }
 34
 35        /// <summary> The number of items that are read from the data source and indexed as a single batch in order to i
 336        public int? BatchSize { get; set; }
 37        /// <summary> The maximum number of items that can fail indexing for indexer execution to still be considered su
 338        public int? MaxFailedItems { get; set; }
 39        /// <summary> The maximum number of items in a single batch that can fail indexing for the batch to still be con
 340        public int? MaxFailedItemsPerBatch { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\IndexingParameters.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 IndexingParameters : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 218            writer.WriteStartObject();
 219            if (Optional.IsDefined(BatchSize))
 20            {
 021                if (BatchSize != null)
 22                {
 023                    writer.WritePropertyName("batchSize");
 024                    writer.WriteNumberValue(BatchSize.Value);
 25                }
 26                else
 27                {
 028                    writer.WriteNull("batchSize");
 29                }
 30            }
 231            if (Optional.IsDefined(MaxFailedItems))
 32            {
 033                if (MaxFailedItems != null)
 34                {
 035                    writer.WritePropertyName("maxFailedItems");
 036                    writer.WriteNumberValue(MaxFailedItems.Value);
 37                }
 38                else
 39                {
 040                    writer.WriteNull("maxFailedItems");
 41                }
 42            }
 243            if (Optional.IsDefined(MaxFailedItemsPerBatch))
 44            {
 045                if (MaxFailedItemsPerBatch != null)
 46                {
 047                    writer.WritePropertyName("maxFailedItemsPerBatch");
 048                    writer.WriteNumberValue(MaxFailedItemsPerBatch.Value);
 49                }
 50                else
 51                {
 052                    writer.WriteNull("maxFailedItemsPerBatch");
 53                }
 54            }
 255            if (Optional.IsCollectionDefined(Configuration))
 56            {
 157                writer.WritePropertyName("configuration");
 158                writer.WriteStartObject();
 459                foreach (var item in Configuration)
 60                {
 161                    writer.WritePropertyName(item.Key);
 162                    writer.WriteObjectValue(item.Value);
 63                }
 164                writer.WriteEndObject();
 65            }
 266            writer.WriteEndObject();
 267        }
 68
 69        internal static IndexingParameters DeserializeIndexingParameters(JsonElement element)
 70        {
 171            Optional<int?> batchSize = default;
 172            Optional<int?> maxFailedItems = default;
 173            Optional<int?> maxFailedItemsPerBatch = default;
 174            Optional<IDictionary<string, object>> configuration = default;
 1275            foreach (var property in element.EnumerateObject())
 76            {
 577                if (property.NameEquals("batchSize"))
 78                {
 179                    if (property.Value.ValueKind == JsonValueKind.Null)
 80                    {
 181                        batchSize = null;
 182                        continue;
 83                    }
 084                    batchSize = property.Value.GetInt32();
 085                    continue;
 86                }
 487                if (property.NameEquals("maxFailedItems"))
 88                {
 189                    if (property.Value.ValueKind == JsonValueKind.Null)
 90                    {
 191                        maxFailedItems = null;
 192                        continue;
 93                    }
 094                    maxFailedItems = property.Value.GetInt32();
 095                    continue;
 96                }
 397                if (property.NameEquals("maxFailedItemsPerBatch"))
 98                {
 199                    if (property.Value.ValueKind == JsonValueKind.Null)
 100                    {
 1101                        maxFailedItemsPerBatch = null;
 1102                        continue;
 103                    }
 0104                    maxFailedItemsPerBatch = property.Value.GetInt32();
 0105                    continue;
 106                }
 2107                if (property.NameEquals("configuration"))
 108                {
 1109                    Dictionary<string, object> dictionary = new Dictionary<string, object>();
 4110                    foreach (var property0 in property.Value.EnumerateObject())
 111                    {
 1112                        dictionary.Add(property0.Name, property0.Value.GetObject());
 113                    }
 1114                    configuration = dictionary;
 115                    continue;
 116                }
 117            }
 1118            return new IndexingParameters(Optional.ToNullable(batchSize), Optional.ToNullable(maxFailedItems), Optional.
 119        }
 120    }
 121}

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using Azure.Core;
 6
 7namespace Azure.Search.Documents.Indexes.Models
 8{
 9    public partial class IndexingParameters
 10    {
 11        /// <summary>
 12        /// A dictionary of indexer-specific configuration properties.
 13        /// Each name is the name of a <see href="https://docs.microsoft.com/rest/api/searchservice/create-indexer#param
 14        /// Each value must be of a primitive type.
 15        /// See the <see href="https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/search/Azure.Search.Documents/
 16        /// sample for code you can include in your own projects to set these values intuitively.
 17        /// </summary>
 7818        public IDictionary<string, object> Configuration { get; }
 19    }
 20}