< Summary

Class:Azure.DigitalTwins.Core.Error
Assembly:Azure.DigitalTwins.Core
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\Error.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\Error.Serialization.cs
Covered lines:0
Uncovered lines:33
Coverable lines:33
Total lines:97
Line coverage:0% (0 of 33)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Code()-0%100%
get_Message()-0%100%
get_Details()-0%100%
get_Innererror()-0%100%
DeserializeError(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\Error.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 Azure.Core;
 10
 11namespace Azure.DigitalTwins.Core
 12{
 13    /// <summary> Error definition. </summary>
 14    internal partial class Error
 15    {
 16        /// <summary> Initializes a new instance of Error. </summary>
 017        internal Error()
 18        {
 019            Details = new ChangeTrackingList<Error>();
 020        }
 21
 22        /// <summary> Initializes a new instance of Error. </summary>
 23        /// <param name="code"> Service specific error code which serves as the substatus for the HTTP error code. </par
 24        /// <param name="message"> A human-readable representation of the error. </param>
 25        /// <param name="details"> Internal error details. </param>
 26        /// <param name="innererror"> An object containing more specific information than the current object about the e
 027        internal Error(string code, string message, IReadOnlyList<Error> details, InnerError innererror)
 28        {
 029            Code = code;
 030            Message = message;
 031            Details = details;
 032            Innererror = innererror;
 033        }
 34
 35        /// <summary> Service specific error code which serves as the substatus for the HTTP error code. </summary>
 036        public string Code { get; }
 37        /// <summary> A human-readable representation of the error. </summary>
 038        public string Message { get; }
 39        /// <summary> Internal error details. </summary>
 040        public IReadOnlyList<Error> Details { get; }
 41        /// <summary> An object containing more specific information than the current object about the error. </summary>
 042        public InnerError Innererror { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.DigitalTwins.Core\src\Generated\Models\Error.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.DigitalTwins.Core
 13{
 14    internal partial class Error
 15    {
 16        internal static Error DeserializeError(JsonElement element)
 17        {
 018            Optional<string> code = default;
 019            Optional<string> message = default;
 020            Optional<IReadOnlyList<Error>> details = default;
 021            Optional<InnerError> innererror = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("code"))
 25                {
 026                    code = property.Value.GetString();
 027                    continue;
 28                }
 029                if (property.NameEquals("message"))
 30                {
 031                    message = property.Value.GetString();
 032                    continue;
 33                }
 034                if (property.NameEquals("details"))
 35                {
 036                    List<Error> array = new List<Error>();
 037                    foreach (var item in property.Value.EnumerateArray())
 38                    {
 039                        array.Add(DeserializeError(item));
 40                    }
 041                    details = array;
 042                    continue;
 43                }
 044                if (property.NameEquals("innererror"))
 45                {
 046                    innererror = InnerError.DeserializeInnerError(property.Value);
 47                    continue;
 48                }
 49            }
 050            return new Error(code.Value, message.Value, Optional.ToList(details), innererror.Value);
 51        }
 52    }
 53}