< Summary

Class:Azure.Search.Documents.Indexes.Models.ConditionalSkill
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ConditionalSkill.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ConditionalSkill.Serialization.cs
Covered lines:61
Uncovered lines:4
Coverable lines:65
Total lines:153
Line coverage:93.8% (61 of 65)
Covered branches:30
Total branches:34
Branch coverage:88.2% (30 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-71.43%50%
.ctor(...)-100%50%
Azure.Core.IUtf8JsonSerializable.Write(...)-91.67%90%
DeserializeConditionalSkill(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ConditionalSkill.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;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    /// <summary> A skill that enables scenarios that require a Boolean operation to determine the data to assign to an 
 14    public partial class ConditionalSkill : SearchIndexerSkill
 15    {
 16        /// <summary> Initializes a new instance of ConditionalSkill. </summary>
 17        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 18        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 19        /// <exception cref="ArgumentNullException"> <paramref name="inputs"/> or <paramref name="outputs"/> is null. </
 120        public ConditionalSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingEntry> outputs
 21        {
 122            if (inputs == null)
 23            {
 024                throw new ArgumentNullException(nameof(inputs));
 25            }
 126            if (outputs == null)
 27            {
 028                throw new ArgumentNullException(nameof(outputs));
 29            }
 30
 131            ODataType = "#Microsoft.Skills.Util.ConditionalSkill";
 132        }
 33
 34        /// <summary> Initializes a new instance of ConditionalSkill. </summary>
 35        /// <param name="oDataType"> Identifies the concrete type of the skill. </param>
 36        /// <param name="name"> The name of the skill which uniquely identifies it within the skillset. A skill with no 
 37        /// <param name="description"> The description of the skill which describes the inputs, outputs, and usage of th
 38        /// <param name="context"> Represents the level at which operations take place, such as the document root or doc
 39        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 40        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 141        internal ConditionalSkill(string oDataType, string name, string description, string context, IList<InputFieldMap
 42        {
 143            ODataType = oDataType ?? "#Microsoft.Skills.Util.ConditionalSkill";
 144        }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\ConditionalSkill.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 ConditionalSkill : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 118            writer.WriteStartObject();
 119            writer.WritePropertyName("@odata.type");
 120            writer.WriteStringValue(ODataType);
 121            if (Optional.IsDefined(Name))
 22            {
 123                writer.WritePropertyName("name");
 124                writer.WriteStringValue(Name);
 25            }
 126            if (Optional.IsDefined(Description))
 27            {
 028                writer.WritePropertyName("description");
 029                writer.WriteStringValue(Description);
 30            }
 131            if (Optional.IsDefined(Context))
 32            {
 133                writer.WritePropertyName("context");
 134                writer.WriteStringValue(Context);
 35            }
 136            writer.WritePropertyName("inputs");
 137            writer.WriteStartArray();
 838            foreach (var item in Inputs)
 39            {
 340                writer.WriteObjectValue(item);
 41            }
 142            writer.WriteEndArray();
 143            writer.WritePropertyName("outputs");
 144            writer.WriteStartArray();
 445            foreach (var item in Outputs)
 46            {
 147                writer.WriteObjectValue(item);
 48            }
 149            writer.WriteEndArray();
 150            writer.WriteEndObject();
 151        }
 52
 53        internal static ConditionalSkill DeserializeConditionalSkill(JsonElement element)
 54        {
 155            string odataType = default;
 156            Optional<string> name = default;
 157            Optional<string> description = default;
 158            Optional<string> context = default;
 159            IList<InputFieldMappingEntry> inputs = default;
 160            IList<OutputFieldMappingEntry> outputs = default;
 1461            foreach (var property in element.EnumerateObject())
 62            {
 663                if (property.NameEquals("@odata.type"))
 64                {
 165                    odataType = property.Value.GetString();
 166                    continue;
 67                }
 568                if (property.NameEquals("name"))
 69                {
 170                    name = property.Value.GetString();
 171                    continue;
 72                }
 473                if (property.NameEquals("description"))
 74                {
 175                    description = property.Value.GetString();
 176                    continue;
 77                }
 378                if (property.NameEquals("context"))
 79                {
 180                    context = property.Value.GetString();
 181                    continue;
 82                }
 283                if (property.NameEquals("inputs"))
 84                {
 185                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 886                    foreach (var item in property.Value.EnumerateArray())
 87                    {
 388                        array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
 89                    }
 190                    inputs = array;
 191                    continue;
 92                }
 193                if (property.NameEquals("outputs"))
 94                {
 195                    List<OutputFieldMappingEntry> array = new List<OutputFieldMappingEntry>();
 496                    foreach (var item in property.Value.EnumerateArray())
 97                    {
 198                        array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
 99                    }
 1100                    outputs = array;
 101                    continue;
 102                }
 103            }
 1104            return new ConditionalSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs);
 105        }
 106    }
 107}