< Summary

Class:Azure.Search.Documents.Indexes.Models.MergeSkill
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MergeSkill.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MergeSkill.Serialization.cs
Covered lines:0
Uncovered lines:83
Coverable lines:83
Total lines:184
Line coverage:0% (0 of 83)
Covered branches:0
Total branches:42
Branch coverage:0% (0 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_InsertPreTag()-0%100%
get_InsertPostTag()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMergeSkill(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MergeSkill.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 for merging two or more strings into a single unified string, with an optional user-defined de
 14    public partial class MergeSkill : SearchIndexerSkill
 15    {
 16        /// <summary> Initializes a new instance of MergeSkill. </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. </
 020        public MergeSkill(IEnumerable<InputFieldMappingEntry> inputs, IEnumerable<OutputFieldMappingEntry> outputs) : ba
 21        {
 022            if (inputs == null)
 23            {
 024                throw new ArgumentNullException(nameof(inputs));
 25            }
 026            if (outputs == null)
 27            {
 028                throw new ArgumentNullException(nameof(outputs));
 29            }
 30
 031            ODataType = "#Microsoft.Skills.Text.MergeSkill";
 032        }
 33
 34        /// <summary> Initializes a new instance of MergeSkill. </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
 41        /// <param name="insertPreTag"> The tag indicates the start of the merged text. By default, the tag is an empty 
 42        /// <param name="insertPostTag"> The tag indicates the end of the merged text. By default, the tag is an empty s
 043        internal MergeSkill(string oDataType, string name, string description, string context, IList<InputFieldMappingEn
 44        {
 045            InsertPreTag = insertPreTag;
 046            InsertPostTag = insertPostTag;
 047            ODataType = oDataType ?? "#Microsoft.Skills.Text.MergeSkill";
 048        }
 49
 50        /// <summary> The tag indicates the start of the merged text. By default, the tag is an empty space. </summary>
 051        public string InsertPreTag { get; set; }
 52        /// <summary> The tag indicates the end of the merged text. By default, the tag is an empty space. </summary>
 053        public string InsertPostTag { get; set; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MergeSkill.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 MergeSkill : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(InsertPreTag))
 20            {
 021                writer.WritePropertyName("insertPreTag");
 022                writer.WriteStringValue(InsertPreTag);
 23            }
 024            if (Optional.IsDefined(InsertPostTag))
 25            {
 026                writer.WritePropertyName("insertPostTag");
 027                writer.WriteStringValue(InsertPostTag);
 28            }
 029            writer.WritePropertyName("@odata.type");
 030            writer.WriteStringValue(ODataType);
 031            if (Optional.IsDefined(Name))
 32            {
 033                writer.WritePropertyName("name");
 034                writer.WriteStringValue(Name);
 35            }
 036            if (Optional.IsDefined(Description))
 37            {
 038                writer.WritePropertyName("description");
 039                writer.WriteStringValue(Description);
 40            }
 041            if (Optional.IsDefined(Context))
 42            {
 043                writer.WritePropertyName("context");
 044                writer.WriteStringValue(Context);
 45            }
 046            writer.WritePropertyName("inputs");
 047            writer.WriteStartArray();
 048            foreach (var item in Inputs)
 49            {
 050                writer.WriteObjectValue(item);
 51            }
 052            writer.WriteEndArray();
 053            writer.WritePropertyName("outputs");
 054            writer.WriteStartArray();
 055            foreach (var item in Outputs)
 56            {
 057                writer.WriteObjectValue(item);
 58            }
 059            writer.WriteEndArray();
 060            writer.WriteEndObject();
 061        }
 62
 63        internal static MergeSkill DeserializeMergeSkill(JsonElement element)
 64        {
 065            Optional<string> insertPreTag = default;
 066            Optional<string> insertPostTag = default;
 067            string odataType = default;
 068            Optional<string> name = default;
 069            Optional<string> description = default;
 070            Optional<string> context = default;
 071            IList<InputFieldMappingEntry> inputs = default;
 072            IList<OutputFieldMappingEntry> outputs = default;
 073            foreach (var property in element.EnumerateObject())
 74            {
 075                if (property.NameEquals("insertPreTag"))
 76                {
 077                    insertPreTag = property.Value.GetString();
 078                    continue;
 79                }
 080                if (property.NameEquals("insertPostTag"))
 81                {
 082                    insertPostTag = property.Value.GetString();
 083                    continue;
 84                }
 085                if (property.NameEquals("@odata.type"))
 86                {
 087                    odataType = property.Value.GetString();
 088                    continue;
 89                }
 090                if (property.NameEquals("name"))
 91                {
 092                    name = property.Value.GetString();
 093                    continue;
 94                }
 095                if (property.NameEquals("description"))
 96                {
 097                    description = property.Value.GetString();
 098                    continue;
 99                }
 0100                if (property.NameEquals("context"))
 101                {
 0102                    context = property.Value.GetString();
 0103                    continue;
 104                }
 0105                if (property.NameEquals("inputs"))
 106                {
 0107                    List<InputFieldMappingEntry> array = new List<InputFieldMappingEntry>();
 0108                    foreach (var item in property.Value.EnumerateArray())
 109                    {
 0110                        array.Add(InputFieldMappingEntry.DeserializeInputFieldMappingEntry(item));
 111                    }
 0112                    inputs = array;
 0113                    continue;
 114                }
 0115                if (property.NameEquals("outputs"))
 116                {
 0117                    List<OutputFieldMappingEntry> array = new List<OutputFieldMappingEntry>();
 0118                    foreach (var item in property.Value.EnumerateArray())
 119                    {
 0120                        array.Add(OutputFieldMappingEntry.DeserializeOutputFieldMappingEntry(item));
 121                    }
 0122                    outputs = array;
 123                    continue;
 124                }
 125            }
 0126            return new MergeSkill(odataType, name.Value, description.Value, context.Value, inputs, outputs, insertPreTag
 127        }
 128    }
 129}