< Summary

Class:Azure.AI.TextAnalytics.Models.TextAnalyticsError_internal
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\TextAnalyticsError_internal.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\TextAnalyticsError_internal.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\TextAnalyticsError_internal.cs
Covered lines:29
Uncovered lines:17
Coverable lines:46
Total lines:134
Line coverage:63% (29 of 46)
Covered branches:9
Total branches:18
Branch coverage:50% (9 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Code()-100%100%
.ctor(...)-0%0%
.ctor(...)-100%100%
get_Message()-100%100%
get_Target()-100%100%
get_Innererror()-100%100%
get_Details()-0%100%
DeserializeTextAnalyticsError_internal(...)-70.83%64.29%
get_Code()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\TextAnalyticsError_internal.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 Azure.Core;
 11
 12namespace Azure.AI.TextAnalytics.Models
 413{
 14    /// <summary> The TextAnalyticsError. </summary>
 15    internal partial class TextAnalyticsError_internal
 16    {
 17        /// <summary> Initializes a new instance of TextAnalyticsError_internal. </summary>
 18        /// <param name="code"> Error code. </param>
 19        /// <param name="message"> Error message. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="code"/> or <paramref name="message"/> is null. </ex
 021        internal TextAnalyticsError_internal(string code, string message)
 22        {
 023            if (code == null)
 24            {
 025                throw new ArgumentNullException(nameof(code));
 26            }
 027            if (message == null)
 28            {
 029                throw new ArgumentNullException(nameof(message));
 30            }
 31
 032            Code = code;
 033            Message = message;
 034            Details = new ChangeTrackingList<TextAnalyticsError_internal>();
 035        }
 36
 37        /// <summary> Initializes a new instance of TextAnalyticsError_internal. </summary>
 38        /// <param name="code"> Error code. </param>
 39        /// <param name="message"> Error message. </param>
 40        /// <param name="target"> Error target. </param>
 41        /// <param name="innererror"> Inner error contains more specific information. </param>
 42        /// <param name="details"> Details about specific errors that led to this reported error. </param>
 843        internal TextAnalyticsError_internal(string code, string message, string target, InnerError innererror, IReadOnl
 44        {
 845            Code = code;
 846            Message = message;
 847            Target = target;
 848            Innererror = innererror;
 849            Details = details;
 850        }
 51        /// <summary> Error message. </summary>
 852        public string Message { get; }
 53        /// <summary> Error target. </summary>
 854        public string Target { get; }
 55        /// <summary> Inner error contains more specific information. </summary>
 856        public InnerError Innererror { get; }
 57        /// <summary> Details about specific errors that led to this reported error. </summary>
 058        public IReadOnlyList<TextAnalyticsError_internal> Details { get; }
 59    }
 60}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\Generated\Models\TextAnalyticsError_internal.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 TextAnalyticsError_internal
 15    {
 16        internal static TextAnalyticsError_internal DeserializeTextAnalyticsError_internal(JsonElement element)
 17        {
 818            string code = default;
 819            string message = default;
 820            Optional<string> target = default;
 821            Optional<InnerError> innererror = default;
 822            Optional<IReadOnlyList<TextAnalyticsError_internal>> details = default;
 6423            foreach (var property in element.EnumerateObject())
 24            {
 2425                if (property.NameEquals("code"))
 26                {
 827                    code = property.Value.GetString();
 828                    continue;
 29                }
 1630                if (property.NameEquals("message"))
 31                {
 832                    message = property.Value.GetString();
 833                    continue;
 34                }
 835                if (property.NameEquals("target"))
 36                {
 037                    target = property.Value.GetString();
 038                    continue;
 39                }
 840                if (property.NameEquals("innererror"))
 41                {
 842                    innererror = InnerError.DeserializeInnerError(property.Value);
 843                    continue;
 44                }
 045                if (property.NameEquals("details"))
 46                {
 047                    List<TextAnalyticsError_internal> array = new List<TextAnalyticsError_internal>();
 048                    foreach (var item in property.Value.EnumerateArray())
 49                    {
 050                        array.Add(DeserializeTextAnalyticsError_internal(item));
 51                    }
 052                    details = array;
 53                    continue;
 54                }
 55            }
 856            return new TextAnalyticsError_internal(code, message, target.Value, innererror.Value, Optional.ToList(detail
 57        }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\TextAnalyticsError_internal.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Azure.Core;
 5
 6namespace Azure.AI.TextAnalytics.Models
 7{
 8    [CodeGenModel("TextAnalyticsError")]
 9    internal partial class TextAnalyticsError_internal
 10    {
 11        /// <summary> Error code as string </summary>
 12        [CodeGenMember("Code")]
 413        public string Code { get; }
 14    }
 15}