< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MicrosoftLanguageTokenizer.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> Divides text using language-specific rules. </summary>
 13    public partial class MicrosoftLanguageTokenizer : LexicalTokenizer
 14    {
 15        /// <summary> Initializes a new instance of MicrosoftLanguageTokenizer. </summary>
 16        /// <param name="name"> The name of the tokenizer. It must only contain letters, digits, spaces, dashes or under
 17        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 018        public MicrosoftLanguageTokenizer(string name) : base(name)
 19        {
 020            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 025            ODataType = "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer";
 026        }
 27
 28        /// <summary> Initializes a new instance of MicrosoftLanguageTokenizer. </summary>
 29        /// <param name="oDataType"> Identifies the concrete type of the tokenizer. </param>
 30        /// <param name="name"> The name of the tokenizer. It must only contain letters, digits, spaces, dashes or under
 31        /// <param name="maxTokenLength"> The maximum token length. Tokens longer than the maximum length are split. Max
 32        /// <param name="isSearchTokenizer"> A value indicating how the tokenizer is used. Set to true if used as the se
 33        /// <param name="language"> The language to use. The default is English. </param>
 034        internal MicrosoftLanguageTokenizer(string oDataType, string name, int? maxTokenLength, bool? isSearchTokenizer,
 35        {
 036            MaxTokenLength = maxTokenLength;
 037            IsSearchTokenizer = isSearchTokenizer;
 038            Language = language;
 039            ODataType = oDataType ?? "#Microsoft.Azure.Search.MicrosoftLanguageTokenizer";
 040        }
 41
 42        /// <summary> The maximum token length. Tokens longer than the maximum length are split. Maximum token length th
 043        public int? MaxTokenLength { get; set; }
 44        /// <summary> A value indicating how the tokenizer is used. Set to true if used as the search tokenizer, set to 
 045        public bool? IsSearchTokenizer { get; set; }
 46        /// <summary> The language to use. The default is English. </summary>
 047        public MicrosoftTokenizerLanguage? Language { get; set; }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MicrosoftLanguageTokenizer.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 MicrosoftLanguageTokenizer : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Optional.IsDefined(MaxTokenLength))
 19            {
 020                writer.WritePropertyName("maxTokenLength");
 021                writer.WriteNumberValue(MaxTokenLength.Value);
 22            }
 023            if (Optional.IsDefined(IsSearchTokenizer))
 24            {
 025                writer.WritePropertyName("isSearchTokenizer");
 026                writer.WriteBooleanValue(IsSearchTokenizer.Value);
 27            }
 028            if (Optional.IsDefined(Language))
 29            {
 030                writer.WritePropertyName("language");
 031                writer.WriteStringValue(Language.Value.ToSerialString());
 32            }
 033            writer.WritePropertyName("@odata.type");
 034            writer.WriteStringValue(ODataType);
 035            writer.WritePropertyName("name");
 036            writer.WriteStringValue(Name);
 037            writer.WriteEndObject();
 038        }
 39
 40        internal static MicrosoftLanguageTokenizer DeserializeMicrosoftLanguageTokenizer(JsonElement element)
 41        {
 042            Optional<int> maxTokenLength = default;
 043            Optional<bool> isSearchTokenizer = default;
 044            Optional<MicrosoftTokenizerLanguage> language = default;
 045            string odataType = default;
 046            string name = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("maxTokenLength"))
 50                {
 051                    maxTokenLength = property.Value.GetInt32();
 052                    continue;
 53                }
 054                if (property.NameEquals("isSearchTokenizer"))
 55                {
 056                    isSearchTokenizer = property.Value.GetBoolean();
 057                    continue;
 58                }
 059                if (property.NameEquals("language"))
 60                {
 061                    language = property.Value.GetString().ToMicrosoftTokenizerLanguage();
 062                    continue;
 63                }
 064                if (property.NameEquals("@odata.type"))
 65                {
 066                    odataType = property.Value.GetString();
 067                    continue;
 68                }
 069                if (property.NameEquals("name"))
 70                {
 071                    name = property.Value.GetString();
 72                    continue;
 73                }
 74            }
 075            return new MicrosoftLanguageTokenizer(odataType, name, Optional.ToNullable(maxTokenLength), Optional.ToNulla
 76        }
 77    }
 78}