< Summary

Class:Azure.ResourceManager.DigitalTwins.Models.ErrorDefinition
Assembly:Azure.ResourceManager.DigitalTwins
File(s):C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\ErrorDefinition.cs
C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\ErrorDefinition.Serialization.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:87
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

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%
DeserializeErrorDefinition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\ErrorDefinition.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.ResourceManager.DigitalTwins.Models
 12{
 13    /// <summary> Error definition. </summary>
 14    internal partial class ErrorDefinition
 15    {
 16        /// <summary> Initializes a new instance of ErrorDefinition. </summary>
 017        internal ErrorDefinition()
 18        {
 019            Details = new ChangeTrackingList<ErrorDefinition>();
 020        }
 21
 22        /// <summary> Initializes a new instance of ErrorDefinition. </summary>
 23        /// <param name="code"> Service specific error code which serves as the substatus for the HTTP error code. </par
 24        /// <param name="message"> Description of the error. </param>
 25        /// <param name="details"> Internal error details. </param>
 026        internal ErrorDefinition(string code, string message, IReadOnlyList<ErrorDefinition> details)
 27        {
 028            Code = code;
 029            Message = message;
 030            Details = details;
 031        }
 32
 33        /// <summary> Service specific error code which serves as the substatus for the HTTP error code. </summary>
 034        public string Code { get; }
 35        /// <summary> Description of the error. </summary>
 036        public string Message { get; }
 37        /// <summary> Internal error details. </summary>
 038        public IReadOnlyList<ErrorDefinition> Details { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\digitaltwins\Azure.ResourceManager.DigitalTwins\src\Generated\Models\ErrorDefinition.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.ResourceManager.DigitalTwins.Models
 13{
 14    internal partial class ErrorDefinition
 15    {
 16        internal static ErrorDefinition DeserializeErrorDefinition(JsonElement element)
 17        {
 018            Optional<string> code = default;
 019            Optional<string> message = default;
 020            Optional<IReadOnlyList<ErrorDefinition>> details = default;
 021            foreach (var property in element.EnumerateObject())
 22            {
 023                if (property.NameEquals("code"))
 24                {
 025                    code = property.Value.GetString();
 026                    continue;
 27                }
 028                if (property.NameEquals("message"))
 29                {
 030                    message = property.Value.GetString();
 031                    continue;
 32                }
 033                if (property.NameEquals("details"))
 34                {
 035                    List<ErrorDefinition> array = new List<ErrorDefinition>();
 036                    foreach (var item in property.Value.EnumerateArray())
 37                    {
 038                        array.Add(DeserializeErrorDefinition(item));
 39                    }
 040                    details = array;
 41                    continue;
 42                }
 43            }
 044            return new ErrorDefinition(code.Value, message.Value, Optional.ToList(details));
 45        }
 46    }
 47}