< Summary

Class:Azure.Search.Documents.Indexes.Models.InputFieldMappingEntry
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\InputFieldMappingEntry.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\InputFieldMappingEntry.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\InputFieldMappingEntry.cs
Covered lines:52
Uncovered lines:1
Coverable lines:53
Total lines:146
Line coverage:98.1% (52 of 53)
Covered branches:21
Total branches:22
Branch coverage:95.4% (21 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-83.33%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_Source()-100%100%
get_SourceContext()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeInputFieldMappingEntry(...)-100%100%
get_Inputs()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\InputFieldMappingEntry.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 Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Input field mapping for a skill. </summary>
 15    public partial class InputFieldMappingEntry
 16    {
 17        /// <summary> Initializes a new instance of InputFieldMappingEntry. </summary>
 18        /// <param name="name"> The name of the input. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 4220        public InputFieldMappingEntry(string name)
 21        {
 4222            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 4227            Name = name;
 4228            Inputs = new ChangeTrackingList<InputFieldMappingEntry>();
 4229        }
 30
 31        /// <summary> Initializes a new instance of InputFieldMappingEntry. </summary>
 32        /// <param name="name"> The name of the input. </param>
 33        /// <param name="source"> The source of the input. </param>
 34        /// <param name="sourceContext"> The source context used for selecting recursive inputs. </param>
 35        /// <param name="inputs"> The recursive inputs used when creating a complex type. </param>
 11836        internal InputFieldMappingEntry(string name, string source, string sourceContext, IList<InputFieldMappingEntry> 
 37        {
 11838            Name = name;
 11839            Source = source;
 11840            SourceContext = sourceContext;
 11841            Inputs = inputs;
 11842        }
 43
 44        /// <summary> The name of the input. </summary>
 46845        public string Name { get; set; }
 46        /// <summary> The source of the input. </summary>
 53647        public string Source { get; set; }
 48        /// <summary> The source context used for selecting recursive inputs. </summary>
 43849        public string SourceContext { get; set; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\InputFieldMappingEntry.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 InputFieldMappingEntry : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 8018            writer.WriteStartObject();
 8019            writer.WritePropertyName("name");
 8020            writer.WriteStringValue(Name);
 8021            if (Optional.IsDefined(Source))
 22            {
 7223                writer.WritePropertyName("source");
 7224                writer.WriteStringValue(Source);
 25            }
 8026            if (Optional.IsDefined(SourceContext))
 27            {
 828                writer.WritePropertyName("sourceContext");
 829                writer.WriteStringValue(SourceContext);
 30            }
 8031            if (Optional.IsCollectionDefined(Inputs))
 32            {
 4233                writer.WritePropertyName("inputs");
 4234                writer.WriteStartArray();
 12435                foreach (var item in Inputs)
 36                {
 2037                    writer.WriteObjectValue(item);
 38                }
 4239                writer.WriteEndArray();
 40            }
 8041            writer.WriteEndObject();
 8042        }
 43
 44        internal static InputFieldMappingEntry DeserializeInputFieldMappingEntry(JsonElement element)
 45        {
 11846            string name = default;
 11847            Optional<string> source = default;
 11848            Optional<string> sourceContext = default;
 11849            Optional<IList<InputFieldMappingEntry>> inputs = default;
 118050            foreach (var property in element.EnumerateObject())
 51            {
 47252                if (property.NameEquals("name"))
 53                {
 11854                    name = property.Value.GetString();
 11855                    continue;
 56                }
 35457                if (property.NameEquals("source"))
 58                {
 11859                    source = property.Value.GetString();
 11860                    continue;
 61                }
 23662                if (property.NameEquals("sourceContext"))
 63                {
 11864                    sourceContext = property.Value.GetString();
 11865                    continue;
 66                }
 11867                if (property.NameEquals("inputs"))
 68                {
 11869                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 29670                    foreach (var item in property.Value.EnumerateArray())
 71                    {
 3072                        array.Add(DeserializeInputFieldMappingEntry(item));
 73                    }
 11874                    inputs = array;
 75                    continue;
 76                }
 77            }
 11878            return new InputFieldMappingEntry(name, source.Value, sourceContext.Value, Optional.ToList(inputs));
 79        }
 80    }
 81}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\InputFieldMappingEntry.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 InputFieldMappingEntry
 10    {
 11        /// <summary> The recursive inputs used when creating a complex type. </summary>
 36012        public IList<InputFieldMappingEntry> Inputs { get; }
 13    }
 14}