< Summary

Class:Azure.ResourceManager.Storage.Models.ErrorResponse
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ErrorResponse.cs
C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ErrorResponse.Serialization.cs
Covered lines:0
Uncovered lines:19
Coverable lines:19
Total lines:75
Line coverage:0% (0 of 19)
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%
DeserializeErrorResponse(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ErrorResponse.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.ResourceManager.Storage.Models
 9{
 10    /// <summary> An error response from the storage resource provider. </summary>
 11    internal partial class ErrorResponse
 12    {
 13        /// <summary> Initializes a new instance of ErrorResponse. </summary>
 014        internal ErrorResponse()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ErrorResponse. </summary>
 19        /// <param name="code"> An identifier for the error. Codes are invariant and are intended to be consumed program
 20        /// <param name="message"> A message describing the error, intended to be suitable for display in a user interfa
 021        internal ErrorResponse(string code, string message)
 22        {
 023            Code = code;
 024            Message = message;
 025        }
 26
 27        /// <summary> An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
 028        public string Code { get; }
 29        /// <summary> A message describing the error, intended to be suitable for display in a user interface. </summary
 030        public string Message { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\Models\ErrorResponse.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.ResourceManager.Storage.Models
 12{
 13    internal partial class ErrorResponse
 14    {
 15        internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
 16        {
 017            string code = default;
 018            string message = default;
 019            foreach (var property in element.EnumerateObject())
 20            {
 021                if (property.NameEquals("code"))
 22                {
 023                    if (property.Value.ValueKind == JsonValueKind.Null)
 24                    {
 25                        continue;
 26                    }
 027                    code = property.Value.GetString();
 028                    continue;
 29                }
 030                if (property.NameEquals("message"))
 31                {
 032                    if (property.Value.ValueKind == JsonValueKind.Null)
 33                    {
 34                        continue;
 35                    }
 036                    message = property.Value.GetString();
 37                    continue;
 38                }
 39            }
 040            return new ErrorResponse(code, message);
 41        }
 42    }
 43}