< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchIndexerSkill
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkill.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkill.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\SearchIndexerSkill.cs
Covered lines:29
Uncovered lines:60
Coverable lines:89
Total lines:205
Line coverage:32.5% (29 of 89)
Covered branches:26
Total branches:84
Branch coverage:30.9% (26 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_ODataType()-100%100%
get_Description()-100%100%
get_Context()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSearchIndexerSkill(...)-20%35.14%
.ctor(...)-100%100%
get_Name()-100%100%
get_Inputs()-100%100%
get_Outputs()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkill.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> Base type for skills. </summary>
 15    public partial class SearchIndexerSkill
 16    {
 17
 18        /// <summary> Initializes a new instance of SearchIndexerSkill. </summary>
 19        /// <param name="oDataType"> Identifies the concrete type of the skill. </param>
 20        /// <param name="name"> The name of the skill which uniquely identifies it within the skillset. A skill with no 
 21        /// <param name="description"> The description of the skill which describes the inputs, outputs, and usage of th
 22        /// <param name="context"> Represents the level at which operations take place, such as the document root or doc
 23        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 24        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 3225        internal SearchIndexerSkill(string oDataType, string name, string description, string context, IList<InputFieldM
 26        {
 3227            ODataType = oDataType;
 3228            Name = name;
 3229            Description = description;
 3230            Context = context;
 3231            Inputs = inputs;
 3232            Outputs = outputs;
 3233        }
 34
 35        /// <summary> Identifies the concrete type of the skill. </summary>
 15836        internal string ODataType { get; set; }
 37        /// <summary> The description of the skill which describes the inputs, outputs, and usage of the skill. </summar
 11438        public string Description { get; set; }
 39        /// <summary> Represents the level at which operations take place, such as the document root or document content
 14840        public string Context { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkill.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 SearchIndexerSkill : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("@odata.type");
 020            writer.WriteStringValue(ODataType);
 021            if (Optional.IsDefined(Name))
 22            {
 023                writer.WritePropertyName("name");
 024                writer.WriteStringValue(Name);
 25            }
 026            if (Optional.IsDefined(Description))
 27            {
 028                writer.WritePropertyName("description");
 029                writer.WriteStringValue(Description);
 30            }
 031            if (Optional.IsDefined(Context))
 32            {
 033                writer.WritePropertyName("context");
 034                writer.WriteStringValue(Context);
 35            }
 036            writer.WritePropertyName("inputs");
 037            writer.WriteStartArray();
 038            foreach (var item in Inputs)
 39            {
 040                writer.WriteObjectValue(item);
 41            }
 042            writer.WriteEndArray();
 043            writer.WritePropertyName("outputs");
 044            writer.WriteStartArray();
 045            foreach (var item in Outputs)
 46            {
 047                writer.WriteObjectValue(item);
 48            }
 049            writer.WriteEndArray();
 050            writer.WriteEndObject();
 051        }
 52
 53        internal static SearchIndexerSkill DeserializeSearchIndexerSkill(JsonElement element)
 54        {
 3255            if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
 56            {
 3257                switch (discriminator.GetString())
 58                {
 059                    case "#Microsoft.Skills.Custom.WebApiSkill": return WebApiSkill.DeserializeWebApiSkill(element);
 060                    case "#Microsoft.Skills.Text.EntityRecognitionSkill": return EntityRecognitionSkill.DeserializeEntit
 661                    case "#Microsoft.Skills.Text.KeyPhraseExtractionSkill": return KeyPhraseExtractionSkill.DeserializeK
 662                    case "#Microsoft.Skills.Text.LanguageDetectionSkill": return LanguageDetectionSkill.DeserializeLangu
 063                    case "#Microsoft.Skills.Text.MergeSkill": return MergeSkill.DeserializeMergeSkill(element);
 664                    case "#Microsoft.Skills.Text.SentimentSkill": return SentimentSkill.DeserializeSentimentSkill(elemen
 665                    case "#Microsoft.Skills.Text.SplitSkill": return SplitSkill.DeserializeSplitSkill(element);
 166                    case "#Microsoft.Skills.Text.TranslationSkill": return TextTranslationSkill.DeserializeTextTranslati
 167                    case "#Microsoft.Skills.Util.ConditionalSkill": return ConditionalSkill.DeserializeConditionalSkill(
 668                    case "#Microsoft.Skills.Util.ShaperSkill": return ShaperSkill.DeserializeShaperSkill(element);
 069                    case "#Microsoft.Skills.Vision.ImageAnalysisSkill": return ImageAnalysisSkill.DeserializeImageAnalys
 070                    case "#Microsoft.Skills.Vision.OcrSkill": return OcrSkill.DeserializeOcrSkill(element);
 71                }
 72            }
 073            string odataType = default;
 074            Optional<string> name = default;
 075            Optional<string> description = default;
 076            Optional<string> context = default;
 077            IList<InputFieldMappingEntry> inputs = default;
 078            IList<OutputFieldMappingEntry> outputs = default;
 079            foreach (var property in element.EnumerateObject())
 80            {
 081                if (property.NameEquals("@odata.type"))
 82                {
 083                    odataType = property.Value.GetString();
 084                    continue;
 85                }
 086                if (property.NameEquals("name"))
 87                {
 088                    name = property.Value.GetString();
 089                    continue;
 90                }
 091                if (property.NameEquals("description"))
 92                {
 093                    description = property.Value.GetString();
 094                    continue;
 95                }
 096                if (property.NameEquals("context"))
 97                {
 098                    context = property.Value.GetString();
 099                    continue;
 100                }
 0101                if (property.NameEquals("inputs"))
 102                {
 0103                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 0104                    foreach (var item in property.Value.EnumerateArray())
 105                    {
 0106                        array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
 107                    }
 0108                    inputs = array;
 0109                    continue;
 110                }
 0111                if (property.NameEquals("outputs"))
 112                {
 0113                    List<OutputFieldMappingEntry> array = new List<OutputFieldMappingEntry>();
 0114                    foreach (var item in property.Value.EnumerateArray())
 115                    {
 0116                        array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
 117                    }
 0118                    outputs = array;
 119                    continue;
 120                }
 121            }
 0122            return new SearchIndexerSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs);
 123        }
 124    }
 125}

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Linq;
 7using Azure.Core;
 8
 9namespace Azure.Search.Documents.Indexes.Models
 10{
 11    public partial class SearchIndexerSkill
 12    {
 13        /// <summary> Initializes a new instance of SearchIndexerSkill. </summary>
 14        /// <param name="inputs"> Inputs of the skills could be a column in the source data set, or the output of an ups
 15        /// <param name="outputs"> The output of a skill is either a field in a search index, or a value that can be con
 16        /// <exception cref="ArgumentNullException"><paramref name="inputs"/> or <paramref name="outputs"/> is null.</ex
 1217        private protected SearchIndexerSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingE
 18        {
 1219            Argument.AssertNotNull(inputs, nameof(inputs));
 1220            Argument.AssertNotNull(outputs, nameof(outputs));
 21
 1222            Inputs = inputs.ToList();
 1223            Outputs = outputs.ToList();
 1224        }
 25
 26        /// <summary>
 27        /// The name of the skill which uniquely identifies it within the skillset.
 28        /// A skill with no name defined will be given a default name of its 1-based index in the skills array prefaced 
 29        /// </summary>
 5830        public string Name { get; set; }
 31
 32        /// <summary> Inputs of the skills could be a column in the source data set, or the output of an upstream skill.
 8233        public IList<InputFieldMappingEntry> Inputs { get; }
 34
 35        /// <summary> The output of a skill is either a field in a search index, or a value that can be consumed as an i
 8236        public IList<OutputFieldMappingEntry> Outputs { get; }
 37    }
 38}