< Summary

Class:Azure.AI.TextAnalytics.Models.LinkedEntity
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\LinkedEntity.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\LinkedEntity.Serialization.cs
Covered lines:0
Uncovered lines:59
Coverable lines:59
Total lines:149
Line coverage:0% (0 of 59)
Covered branches:0
Total branches:26
Branch coverage:0% (0 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_Matches()-0%100%
get_Language()-0%100%
get_Id()-0%100%
get_Url()-0%100%
get_DataSource()-0%100%
DeserializeLinkedEntity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\LinkedEntity.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.AI.TextAnalytics.Models
 13{
 14    /// <summary> The LinkedEntity. </summary>
 15    internal partial class LinkedEntity
 16    {
 17        /// <summary> Initializes a new instance of LinkedEntity. </summary>
 18        /// <param name="name"> Entity Linking formal name. </param>
 19        /// <param name="matches"> List of instances this entity appears in the text. </param>
 20        /// <param name="language"> Language used in the data source. </param>
 21        /// <param name="url"> URL for the entity&apos;s page from the data source. </param>
 22        /// <param name="dataSource"> Data source used to extract entity linking, such as Wiki/Bing etc. </param>
 23        /// <exception cref="ArgumentNullException"> <paramref name="name"/>, <paramref name="matches"/>, <paramref name
 024        internal LinkedEntity(string name, IEnumerable<Match> matches, string language, string url, string dataSource)
 25        {
 026            if (name == null)
 27            {
 028                throw new ArgumentNullException(nameof(name));
 29            }
 030            if (matches == null)
 31            {
 032                throw new ArgumentNullException(nameof(matches));
 33            }
 034            if (language == null)
 35            {
 036                throw new ArgumentNullException(nameof(language));
 37            }
 038            if (url == null)
 39            {
 040                throw new ArgumentNullException(nameof(url));
 41            }
 042            if (dataSource == null)
 43            {
 044                throw new ArgumentNullException(nameof(dataSource));
 45            }
 46
 047            Name = name;
 048            Matches = matches.ToList();
 049            Language = language;
 050            Url = url;
 051            DataSource = dataSource;
 052        }
 53
 54        /// <summary> Initializes a new instance of LinkedEntity. </summary>
 55        /// <param name="name"> Entity Linking formal name. </param>
 56        /// <param name="matches"> List of instances this entity appears in the text. </param>
 57        /// <param name="language"> Language used in the data source. </param>
 58        /// <param name="id"> Unique identifier of the recognized entity from the data source. </param>
 59        /// <param name="url"> URL for the entity&apos;s page from the data source. </param>
 60        /// <param name="dataSource"> Data source used to extract entity linking, such as Wiki/Bing etc. </param>
 061        internal LinkedEntity(string name, IReadOnlyList<Match> matches, string language, string id, string url, string 
 62        {
 063            Name = name;
 064            Matches = matches;
 065            Language = language;
 066            Id = id;
 067            Url = url;
 068            DataSource = dataSource;
 069        }
 70
 71        /// <summary> Entity Linking formal name. </summary>
 072        public string Name { get; }
 73        /// <summary> List of instances this entity appears in the text. </summary>
 074        public IReadOnlyList<Match> Matches { get; }
 75        /// <summary> Language used in the data source. </summary>
 076        public string Language { get; }
 77        /// <summary> Unique identifier of the recognized entity from the data source. </summary>
 078        public string Id { get; }
 79        /// <summary> URL for the entity&apos;s page from the data source. </summary>
 080        public string Url { get; }
 81        /// <summary> Data source used to extract entity linking, such as Wiki/Bing etc. </summary>
 082        public string DataSource { get; }
 83    }
 84}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\LinkedEntity.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.AI.TextAnalytics.Models
 13{
 14    internal partial class LinkedEntity
 15    {
 16        internal static LinkedEntity DeserializeLinkedEntity(JsonElement element)
 17        {
 018            string name = default;
 019            IReadOnlyList<Match> matches = default;
 020            string language = default;
 021            Optional<string> id = default;
 022            string url = default;
 023            string dataSource = default;
 024            foreach (var property in element.EnumerateObject())
 25            {
 026                if (property.NameEquals("name"))
 27                {
 028                    name = property.Value.GetString();
 029                    continue;
 30                }
 031                if (property.NameEquals("matches"))
 32                {
 033                    List<Match> array = new List<Match>();
 034                    foreach (var item in property.Value.EnumerateArray())
 35                    {
 036                        array.Add(Match.DeserializeMatch(item));
 37                    }
 038                    matches = array;
 039                    continue;
 40                }
 041                if (property.NameEquals("language"))
 42                {
 043                    language = property.Value.GetString();
 044                    continue;
 45                }
 046                if (property.NameEquals("id"))
 47                {
 048                    id = property.Value.GetString();
 049                    continue;
 50                }
 051                if (property.NameEquals("url"))
 52                {
 053                    url = property.Value.GetString();
 054                    continue;
 55                }
 056                if (property.NameEquals("dataSource"))
 57                {
 058                    dataSource = property.Value.GetString();
 59                    continue;
 60                }
 61            }
 062            return new LinkedEntity(name, matches, language, id.Value, url, dataSource);
 63        }
 64    }
 65}