< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Id()-0%100%
get_KeyPhrases()-0%100%
get_Warnings()-0%100%
get_Statistics()-0%100%
DeserializeDocumentKeyPhrases(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentKeyPhrases.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;
 11using Azure.AI.TextAnalytics;
 12
 13namespace Azure.AI.TextAnalytics.Models
 14{
 15    /// <summary> The DocumentKeyPhrases. </summary>
 16    internal partial class DocumentKeyPhrases
 17    {
 18        /// <summary> Initializes a new instance of DocumentKeyPhrases. </summary>
 19        /// <param name="id"> Unique, non-empty document identifier. </param>
 20        /// <param name="keyPhrases"> A list of representative words or phrases. The number of key phrases returned is p
 21        /// <param name="warnings"> Warnings encountered while processing document. </param>
 22        /// <exception cref="ArgumentNullException"> <paramref name="id"/>, <paramref name="keyPhrases"/>, or <paramref 
 023        internal DocumentKeyPhrases(string id, IEnumerable<string> keyPhrases, IEnumerable<TextAnalyticsWarning_internal
 24        {
 025            if (id == null)
 26            {
 027                throw new ArgumentNullException(nameof(id));
 28            }
 029            if (keyPhrases == null)
 30            {
 031                throw new ArgumentNullException(nameof(keyPhrases));
 32            }
 033            if (warnings == null)
 34            {
 035                throw new ArgumentNullException(nameof(warnings));
 36            }
 37
 038            Id = id;
 039            KeyPhrases = keyPhrases.ToList();
 040            Warnings = warnings.ToList();
 041        }
 42
 43        /// <summary> Initializes a new instance of DocumentKeyPhrases. </summary>
 44        /// <param name="id"> Unique, non-empty document identifier. </param>
 45        /// <param name="keyPhrases"> A list of representative words or phrases. The number of key phrases returned is p
 46        /// <param name="warnings"> Warnings encountered while processing document. </param>
 47        /// <param name="statistics"> if showStats=true was specified in the request this field will contain information
 048        internal DocumentKeyPhrases(string id, IReadOnlyList<string> keyPhrases, IReadOnlyList<TextAnalyticsWarning_inte
 49        {
 050            Id = id;
 051            KeyPhrases = keyPhrases;
 052            Warnings = warnings;
 053            Statistics = statistics;
 054        }
 55
 56        /// <summary> Unique, non-empty document identifier. </summary>
 057        public string Id { get; }
 58        /// <summary> A list of representative words or phrases. The number of key phrases returned is proportional to t
 059        public IReadOnlyList<string> KeyPhrases { get; }
 60        /// <summary> Warnings encountered while processing document. </summary>
 061        public IReadOnlyList<TextAnalyticsWarning_internal> Warnings { get; }
 62        /// <summary> if showStats=true was specified in the request this field will contain information about the docum
 063        public TextDocumentStatistics? Statistics { get; }
 64    }
 65}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\DocumentKeyPhrases.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.AI.TextAnalytics;
 11using Azure.Core;
 12
 13namespace Azure.AI.TextAnalytics.Models
 14{
 15    internal partial class DocumentKeyPhrases
 16    {
 17        internal static DocumentKeyPhrases DeserializeDocumentKeyPhrases(JsonElement element)
 18        {
 019            string id = default;
 020            IReadOnlyList<string> keyPhrases = default;
 021            IReadOnlyList<TextAnalyticsWarning_internal> warnings = default;
 022            Optional<TextDocumentStatistics> statistics = default;
 023            foreach (var property in element.EnumerateObject())
 24            {
 025                if (property.NameEquals("id"))
 26                {
 027                    id = property.Value.GetString();
 028                    continue;
 29                }
 030                if (property.NameEquals("keyPhrases"))
 31                {
 032                    List<string> array = new List<string>();
 033                    foreach (var item in property.Value.EnumerateArray())
 34                    {
 035                        array.Add(item.GetString());
 36                    }
 037                    keyPhrases = array;
 038                    continue;
 39                }
 040                if (property.NameEquals("warnings"))
 41                {
 042                    List<TextAnalyticsWarning_internal> array = new List<TextAnalyticsWarning_internal>();
 043                    foreach (var item in property.Value.EnumerateArray())
 44                    {
 045                        array.Add(TextAnalyticsWarning_internal.DeserializeTextAnalyticsWarning_internal(item));
 46                    }
 047                    warnings = array;
 048                    continue;
 49                }
 050                if (property.NameEquals("statistics"))
 51                {
 052                    statistics = TextDocumentStatistics.DeserializeTextDocumentStatistics(property.Value);
 53                    continue;
 54                }
 55            }
 056            return new DocumentKeyPhrases(id, keyPhrases, warnings, Optional.ToNullable(statistics));
 57        }
 58    }
 59}