< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
get_ODataType()-0%100%
get_Name()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeCharFilter(...)-0%0%
.ctor(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\CharFilter.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;
 9
 10namespace Azure.Search.Documents.Indexes.Models
 11{
 12    /// <summary> Base type for character filters. </summary>
 13    public partial class CharFilter
 14    {
 15
 16        /// <summary> Initializes a new instance of CharFilter. </summary>
 17        /// <param name="oDataType"> Identifies the concrete type of the char filter. </param>
 18        /// <param name="name"> The name of the char filter. It must only contain letters, digits, spaces, dashes or und
 019        internal CharFilter(string oDataType, string name)
 20        {
 021            ODataType = oDataType;
 022            Name = name;
 023        }
 24
 25        /// <summary> Identifies the concrete type of the char filter. </summary>
 026        internal string ODataType { get; set; }
 27        /// <summary> The name of the char filter. It must only contain letters, digits, spaces, dashes or underscores, 
 028        public string Name { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\CharFilter.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class CharFilter : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("@odata.type");
 019            writer.WriteStringValue(ODataType);
 020            writer.WritePropertyName("name");
 021            writer.WriteStringValue(Name);
 022            writer.WriteEndObject();
 023        }
 24
 25        internal static CharFilter DeserializeCharFilter(JsonElement element)
 26        {
 027            if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
 28            {
 029                switch (discriminator.GetString())
 30                {
 031                    case "#Microsoft.Azure.Search.MappingCharFilter": return MappingCharFilter.DeserializeMappingCharFil
 032                    case "#Microsoft.Azure.Search.PatternReplaceCharFilter": return PatternReplaceCharFilter.Deserialize
 33                }
 34            }
 035            string odataType = default;
 036            string name = default;
 037            foreach (var property in element.EnumerateObject())
 38            {
 039                if (property.NameEquals("@odata.type"))
 40                {
 041                    odataType = property.Value.GetString();
 042                    continue;
 43                }
 044                if (property.NameEquals("name"))
 45                {
 046                    name = property.Value.GetString();
 47                    continue;
 48                }
 49            }
 050            return new CharFilter(odataType, name);
 51        }
 52    }
 53}

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace Azure.Search.Documents.Indexes.Models
 7{
 8    public partial class CharFilter
 9    {
 10        /// <summary> Initializes a new instance of CharFilter. </summary>
 11        /// <param name="name"> The name of the char filter. It must only contain letters, digits, spaces, dashes or und
 12        /// <exception cref="ArgumentNullException"><paramref name="name"/> is null.</exception>
 013        private protected CharFilter(string name)
 14        {
 015            Name = name ?? throw new ArgumentNullException(nameof(name));
 016        }
 17    }
 18}