< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMappingCharFilter(...)-0%0%
get_Mappings()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MappingCharFilter.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 character filter that applies mappings defined with the mappings option. Matching is greedy (longest
 15    public partial class MappingCharFilter : CharFilter
 16    {
 17        /// <summary> Initializes a new instance of MappingCharFilter. </summary>
 18        /// <param name="name"> The name of the char filter. It must only contain letters, digits, spaces, dashes or und
 19        /// <param name="mappings"> A list of mappings of the following format: &quot;a=&gt;b&quot; (all occurrences of 
 20        /// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="mappings"/> is null. </e
 021        public MappingCharFilter(string name, IEnumerable<string> mappings) : base(name)
 22        {
 023            if (name == null)
 24            {
 025                throw new ArgumentNullException(nameof(name));
 26            }
 027            if (mappings == null)
 28            {
 029                throw new ArgumentNullException(nameof(mappings));
 30            }
 31
 032            Mappings = mappings.ToList();
 033            ODataType = "#Microsoft.Azure.Search.MappingCharFilter";
 034        }
 35
 36        /// <summary> Initializes a new instance of MappingCharFilter. </summary>
 37        /// <param name="oDataType"> Identifies the concrete type of the char filter. </param>
 38        /// <param name="name"> The name of the char filter. It must only contain letters, digits, spaces, dashes or und
 39        /// <param name="mappings"> A list of mappings of the following format: &quot;a=&gt;b&quot; (all occurrences of 
 040        internal MappingCharFilter(string oDataType, string name, IList<string> mappings) : base(oDataType, name)
 41        {
 042            Mappings = mappings;
 043            ODataType = oDataType ?? "#Microsoft.Azure.Search.MappingCharFilter";
 044        }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MappingCharFilter.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 MappingCharFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("mappings");
 020            writer.WriteStartArray();
 021            foreach (var item in Mappings)
 22            {
 023                writer.WriteStringValue(item);
 24            }
 025            writer.WriteEndArray();
 026            writer.WritePropertyName("@odata.type");
 027            writer.WriteStringValue(ODataType);
 028            writer.WritePropertyName("name");
 029            writer.WriteStringValue(Name);
 030            writer.WriteEndObject();
 031        }
 32
 33        internal static MappingCharFilter DeserializeMappingCharFilter(JsonElement element)
 34        {
 035            IList<string> mappings = default;
 036            string odataType = default;
 037            string name = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("mappings"))
 41                {
 042                    List<string> array = new List<string>();
 043                    foreach (var item in property.Value.EnumerateArray())
 44                    {
 045                        array.Add(item.GetString());
 46                    }
 047                    mappings = array;
 048                    continue;
 49                }
 050                if (property.NameEquals("@odata.type"))
 51                {
 052                    odataType = property.Value.GetString();
 053                    continue;
 54                }
 055                if (property.NameEquals("name"))
 56                {
 057                    name = property.Value.GetString();
 58                    continue;
 59                }
 60            }
 061            return new MappingCharFilter(odataType, name, mappings);
 62        }
 63    }
 64}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\MappingCharFilter.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 MappingCharFilter
 10    {
 11        /// <summary> A list of mappings of the following format: &quot;a=&gt;b&quot; (all occurrences of the character 
 012        public IList<string> Mappings { get; }
 13    }
 14}