< Summary

Class:Azure.Search.Documents.Indexes.Models.LengthTokenFilter
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LengthTokenFilter.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LengthTokenFilter.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\LengthTokenFilter.cs
Covered lines:0
Uncovered lines:42
Coverable lines:42
Total lines:129
Line coverage:0% (0 of 42)
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%
DeserializeLengthTokenFilter(...)-0%0%
get_MinLength()-0%100%
get_MaxLength()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LengthTokenFilter.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> Removes words that are too long or too short. This token filter is implemented using Apache Lucene. </
 13    public partial class LengthTokenFilter : TokenFilter
 14    {
 15        /// <summary> Initializes a new instance of LengthTokenFilter. </summary>
 16        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 17        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 018        public LengthTokenFilter(string name) : base(name)
 19        {
 020            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 025            ODataType = "#Microsoft.Azure.Search.LengthTokenFilter";
 026        }
 27
 28        /// <summary> Initializes a new instance of LengthTokenFilter. </summary>
 29        /// <param name="oDataType"> Identifies the concrete type of the token filter. </param>
 30        /// <param name="name"> The name of the token filter. It must only contain letters, digits, spaces, dashes or un
 31        /// <param name="minLength"> The minimum length in characters. Default is 0. Maximum is 300. Must be less than t
 32        /// <param name="maxLength"> The maximum length in characters. Default and maximum is 300. </param>
 033        internal LengthTokenFilter(string oDataType, string name, int? minLength, int? maxLength) : base(oDataType, name
 34        {
 035            MinLength = minLength;
 036            MaxLength = maxLength;
 037            ODataType = oDataType ?? "#Microsoft.Azure.Search.LengthTokenFilter";
 038        }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LengthTokenFilter.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 LengthTokenFilter : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Optional.IsDefined(MinLength))
 19            {
 020                writer.WritePropertyName("min");
 021                writer.WriteNumberValue(MinLength.Value);
 22            }
 023            if (Optional.IsDefined(MaxLength))
 24            {
 025                writer.WritePropertyName("max");
 026                writer.WriteNumberValue(MaxLength.Value);
 27            }
 028            writer.WritePropertyName("@odata.type");
 029            writer.WriteStringValue(ODataType);
 030            writer.WritePropertyName("name");
 031            writer.WriteStringValue(Name);
 032            writer.WriteEndObject();
 033        }
 34
 35        internal static LengthTokenFilter DeserializeLengthTokenFilter(JsonElement element)
 36        {
 037            Optional<int> min = default;
 038            Optional<int> max = default;
 039            string odataType = default;
 040            string name = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("min"))
 44                {
 045                    min = property.Value.GetInt32();
 046                    continue;
 47                }
 048                if (property.NameEquals("max"))
 49                {
 050                    max = property.Value.GetInt32();
 051                    continue;
 52                }
 053                if (property.NameEquals("@odata.type"))
 54                {
 055                    odataType = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("name"))
 59                {
 060                    name = property.Value.GetString();
 61                    continue;
 62                }
 63            }
 064            return new LengthTokenFilter(odataType, name, Optional.ToNullable(min), Optional.ToNullable(max));
 65        }
 66    }
 67}

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Azure.Core;
 5
 6namespace Azure.Search.Documents.Indexes.Models
 7{
 8    public partial class LengthTokenFilter
 9    {
 10        /// <summary>
 11        /// Gets the minimum length in characters. Default is 0. Maximum is 300. Must be less than the value of <see cre
 12        /// </summary>
 13        [CodeGenMember("min")]
 014        public int? MinLength { get; }
 15
 16        /// <summary>
 17        /// Gets the maximum length in characters. Default and maximum is 300.
 18        /// </summary>
 19        [CodeGenMember("max")]
 020        public int? MaxLength { get; }
 21    }
 22}