< Summary

Class:Azure.ResourceManager.Network.Models.Error
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Error.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\Error.Serialization.cs
Covered lines:0
Uncovered lines:45
Coverable lines:45
Total lines:132
Line coverage:0% (0 of 45)
Covered branches:0
Total branches:26
Branch coverage:0% (0 of 26)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Common error representation. </summary>
 13    internal partial class Error
 14    {
 15        /// <summary> Initializes a new instance of Error. </summary>
 016        internal Error()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of Error. </summary>
 21        /// <param name="code"> Error code. </param>
 22        /// <param name="message"> Error message. </param>
 23        /// <param name="target"> Error target. </param>
 24        /// <param name="details"> Error details. </param>
 25        /// <param name="innerError"> Inner error message. </param>
 026        internal Error(string code, string message, string target, IReadOnlyList<ErrorDetails> details, string innerErro
 27        {
 028            Code = code;
 029            Message = message;
 030            Target = target;
 031            Details = details;
 032            InnerError = innerError;
 033        }
 34
 35        /// <summary> Error code. </summary>
 036        public string Code { get; }
 37        /// <summary> Error message. </summary>
 038        public string Message { get; }
 39        /// <summary> Error target. </summary>
 040        public string Target { get; }
 41        /// <summary> Error details. </summary>
 042        public IReadOnlyList<ErrorDetails> Details { get; }
 43        /// <summary> Inner error message. </summary>
 044        public string InnerError { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\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.ResourceManager.Network.Models
 13{
 14    internal partial class Error
 15    {
 16        internal static Error DeserializeError(JsonElement element)
 17        {
 018            string code = default;
 019            string message = default;
 020            string target = default;
 021            IReadOnlyList<ErrorDetails> details = default;
 022            string innerError = default;
 023            foreach (var property in element.EnumerateObject())
 24            {
 025                if (property.NameEquals("code"))
 26                {
 027                    if (property.Value.ValueKind == JsonValueKind.Null)
 28                    {
 29                        continue;
 30                    }
 031                    code = property.Value.GetString();
 032                    continue;
 33                }
 034                if (property.NameEquals("message"))
 35                {
 036                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 040                    message = property.Value.GetString();
 041                    continue;
 42                }
 043                if (property.NameEquals("target"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    target = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("details"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    List<ErrorDetails> array = new List<ErrorDetails>();
 059                    foreach (var item in property.Value.EnumerateArray())
 60                    {
 061                        if (item.ValueKind == JsonValueKind.Null)
 62                        {
 063                            array.Add(null);
 64                        }
 65                        else
 66                        {
 067                            array.Add(ErrorDetails.DeserializeErrorDetails(item));
 68                        }
 69                    }
 070                    details = array;
 071                    continue;
 72                }
 073                if (property.NameEquals("innerError"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    innerError = property.Value.GetString();
 80                    continue;
 81                }
 82            }
 083            return new Error(code, message, target, details, innerError);
 84        }
 85    }
 86}