< Summary

Class:Azure.Search.Documents.Indexes.Models.SearchIndexerSkillset
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkillset.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkillset.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\SearchIndexerSkillset.cs
Covered lines:61
Uncovered lines:3
Coverable lines:64
Total lines:173
Line coverage:95.3% (61 of 64)
Covered branches:26
Total branches:30
Branch coverage:86.6% (26 of 30)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-75%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_Description()-100%100%
get_CognitiveServicesAccount()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeSearchIndexerSkillset(...)-100%100%
get_ETag()-100%100%
set_ETag(...)-0%0%
get_Skills()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkillset.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> A list of skills. </summary>
 15    public partial class SearchIndexerSkillset
 16    {
 17        /// <summary> Initializes a new instance of SearchIndexerSkillset. </summary>
 18        /// <param name="name"> The name of the skillset. </param>
 19        /// <param name="skills"> A list of skills in the skillset. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="skills"/> is null. </exc
 321        public SearchIndexerSkillset(string name, IEnumerable<SearchIndexerSkill> skills)
 22        {
 323            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 327            if (skills == null)
 28            {
 029                throw new ArgumentNullException(nameof(skills));
 30            }
 31
 332            Name = name;
 333            Skills = skills.ToList();
 334        }
 35
 36        /// <summary> Initializes a new instance of SearchIndexerSkillset. </summary>
 37        /// <param name="name"> The name of the skillset. </param>
 38        /// <param name="description"> The description of the skillset. </param>
 39        /// <param name="skills"> A list of skills in the skillset. </param>
 40        /// <param name="cognitiveServicesAccount"> Details about cognitive services to be used when running skills. </p
 41        /// <param name="Etag"> The ETag of the skillset. </param>
 1242        internal SearchIndexerSkillset(string name, string description, IList<SearchIndexerSkill> skills, CognitiveServi
 43        {
 1244            Name = name;
 1245            Description = description;
 1246            Skills = skills;
 1247            CognitiveServicesAccount = cognitiveServicesAccount;
 1248            _etag = Etag;
 1249        }
 50
 51        /// <summary> The name of the skillset. </summary>
 3852        public string Name { get; set; }
 53        /// <summary> The description of the skillset. </summary>
 3354        public string Description { get; set; }
 55        /// <summary> Details about cognitive services to be used when running skills. </summary>
 2556        public CognitiveServicesAccount CognitiveServicesAccount { get; set; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\SearchIndexerSkillset.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 SearchIndexerSkillset : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 518            writer.WriteStartObject();
 519            writer.WritePropertyName("name");
 520            writer.WriteStringValue(Name);
 521            if (Optional.IsDefined(Description))
 22            {
 223                writer.WritePropertyName("description");
 224                writer.WriteStringValue(Description);
 25            }
 526            writer.WritePropertyName("skills");
 527            writer.WriteStartArray();
 5428            foreach (var item in Skills)
 29            {
 2230                writer.WriteObjectValue(item);
 31            }
 532            writer.WriteEndArray();
 533            if (Optional.IsDefined(CognitiveServicesAccount))
 34            {
 535                writer.WritePropertyName("cognitiveServices");
 536                writer.WriteObjectValue(CognitiveServicesAccount);
 37            }
 538            if (Optional.IsDefined(_etag))
 39            {
 240                writer.WritePropertyName("@odata.etag");
 241                writer.WriteStringValue(_etag);
 42            }
 543            writer.WriteEndObject();
 544        }
 45
 46        internal static SearchIndexerSkillset DeserializeSearchIndexerSkillset(JsonElement element)
 47        {
 948            string name = default;
 949            Optional<string> description = default;
 950            IList<SearchIndexerSkill> skills = default;
 951            Optional<CognitiveServicesAccount> cognitiveServices = default;
 952            Optional<string> odataEtag = default;
 13453            foreach (var property in element.EnumerateObject())
 54            {
 5855                if (property.NameEquals("name"))
 56                {
 957                    name = property.Value.GetString();
 958                    continue;
 59                }
 4960                if (property.NameEquals("description"))
 61                {
 762                    description = property.Value.GetString();
 763                    continue;
 64                }
 4265                if (property.NameEquals("skills"))
 66                {
 767                    List<SearchIndexerSkill> array = new List<SearchIndexerSkill>();
 7868                    foreach (var item in property.Value.EnumerateArray())
 69                    {
 3270                        array.Add(SearchIndexerSkill.DeserializeSearchIndexerSkill(item));
 71                    }
 772                    skills = array;
 773                    continue;
 74                }
 3575                if (property.NameEquals("cognitiveServices"))
 76                {
 777                    cognitiveServices = CognitiveServicesAccount.DeserializeCognitiveServicesAccount(property.Value);
 778                    continue;
 79                }
 2880                if (property.NameEquals("@odata.etag"))
 81                {
 782                    odataEtag = property.Value.GetString();
 83                    continue;
 84                }
 85            }
 986            return new SearchIndexerSkillset(name, description.Value, skills, cognitiveServices.Value, odataEtag.Value);
 87        }
 88    }
 89}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\SearchIndexerSkillset.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 SearchIndexerSkillset
 10    {
 11        [CodeGenMember("etag")]
 12        private string _etag;
 13
 14        /// <summary>
 15        /// The <see cref="Azure.ETag"/> of the <see cref="SearchIndexerSkillset"/>.
 16        /// </summary>
 17        public ETag? ETag
 18        {
 1519            get => _etag is null ? (ETag?)null : new ETag(_etag);
 020            set => _etag = value?.ToString();
 21        }
 22
 23        /// <summary> A list of skills in the skillset. </summary>
 1724        public IList<SearchIndexerSkill> Skills { get; }
 25    }
 26}