< Summary

Class:Azure.Security.KeyVault.Administration.Models.KeyVaultServiceError
Assembly:Azure.Security.KeyVault.Administration
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultServiceError.cs
C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultServiceError.Serialization.cs
Covered lines:20
Uncovered lines:6
Coverable lines:26
Total lines:82
Line coverage:76.9% (20 of 26)
Covered branches:9
Total branches:10
Branch coverage:90% (9 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Code()-0%100%
get_Message()-0%100%
get_InnerError()-0%100%
DeserializeKeyVaultServiceError(...)-93.75%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultServiceError.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
 8namespace Azure.Security.KeyVault.Administration.Models
 9{
 10    /// <summary> The key vault server error. </summary>
 11    public partial class KeyVaultServiceError
 12    {
 13        /// <summary> Initializes a new instance of KeyVaultServiceError. </summary>
 014        internal KeyVaultServiceError()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of KeyVaultServiceError. </summary>
 19        /// <param name="code"> The error code. </param>
 20        /// <param name="message"> The error message. </param>
 21        /// <param name="innerError"> The key vault server error. </param>
 1422        internal KeyVaultServiceError(string code, string message, KeyVaultServiceError innerError)
 23        {
 1424            Code = code;
 1425            Message = message;
 1426            InnerError = innerError;
 1427        }
 28
 29        /// <summary> The error code. </summary>
 030        public string Code { get; }
 31        /// <summary> The error message. </summary>
 032        public string Message { get; }
 33        /// <summary> The key vault server error. </summary>
 034        public KeyVaultServiceError InnerError { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Administration\src\Generated\Models\KeyVaultServiceError.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Security.KeyVault.Administration.Models
 12{
 13    public partial class KeyVaultServiceError
 14    {
 15        internal static KeyVaultServiceError DeserializeKeyVaultServiceError(JsonElement element)
 16        {
 1417            Optional<string> code = default;
 1418            Optional<string> message = default;
 1419            Optional<KeyVaultServiceError> innererror = default;
 11220            foreach (var property in element.EnumerateObject())
 21            {
 4222                if (property.NameEquals("code"))
 23                {
 1424                    code = property.Value.GetString();
 1425                    continue;
 26                }
 2827                if (property.NameEquals("message"))
 28                {
 1429                    message = property.Value.GetString();
 1430                    continue;
 31                }
 1432                if (property.NameEquals("innererror"))
 33                {
 1434                    if (property.Value.ValueKind == JsonValueKind.Null)
 35                    {
 1436                        innererror = null;
 1437                        continue;
 38                    }
 039                    innererror = DeserializeKeyVaultServiceError(property.Value);
 40                    continue;
 41                }
 42            }
 1443            return new KeyVaultServiceError(code.Value, message.Value, innererror.Value);
 44        }
 45    }
 46}