< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StemmerTokenFilter.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> Language specific stemming filter. This token filter is implemented using Apache Lucene. </summary>
 13    public partial class StemmerTokenFilter : TokenFilter
 14    {
 15        /// <summary> Initializes a new instance of StemmerTokenFilter. </summary>
 16        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 17        /// <param name="language"> The language to use. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 019        public StemmerTokenFilter(string name, StemmerTokenFilterLanguage language) : base(name)
 20        {
 021            if (name == null)
 22            {
 023                throw new ArgumentNullException(nameof(name));
 24            }
 25
 026            Language = language;
 027            ODataType = "#Microsoft.Azure.Search.StemmerTokenFilter";
 028        }
 29
 30        /// <summary> Initializes a new instance of StemmerTokenFilter. </summary>
 31        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
 32        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 33        /// <param name="language"> The language to use. </param>
 034        internal StemmerTokenFilter(string oDataType, string name, StemmerTokenFilterLanguage language) : base(oDataType
 35        {
 036            Language = language;
 037            ODataType = oDataType ?? "#Microsoft.Azure.Search.StemmerTokenFilter";
 038        }
 39
 40        /// <summary> The language to use. </summary>
 041        public StemmerTokenFilterLanguage Language { get; set; }
 42    }
 43}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\StemmerTokenFilter.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 StemmerTokenFilter : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("language");
 019            writer.WriteStringValue(Language.ToSerialString());
 020            writer.WritePropertyName("@odata.type");
 021            writer.WriteStringValue(ODataType);
 022            writer.WritePropertyName("name");
 023            writer.WriteStringValue(Name);
 024            writer.WriteEndObject();
 025        }
 26
 27        internal static StemmerTokenFilter DeserializeStemmerTokenFilter(JsonElement element)
 28        {
 029            StemmerTokenFilterLanguage language = default;
 030            string odataType = default;
 031            string name = default;
 032            foreach (var property in element.EnumerateObject())
 33            {
 034                if (property.NameEquals("language"))
 35                {
 036                    language = property.Value.GetString().ToStemmerTokenFilterLanguage();
 037                    continue;
 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 StemmerTokenFilter(odataType, name, language);
 51        }
 52    }
 53}