< Summary

Class:Azure.ResourceManager.Compute.Models.ApiErrorBase
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiErrorBase.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiErrorBase.Serialization.cs
Covered lines:0
Uncovered lines:38
Coverable lines:38
Total lines:110
Line coverage:0% (0 of 38)
Covered branches:0
Total branches:20
Branch coverage:0% (0 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Code()-0%100%
get_Target()-0%100%
get_Message()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApiErrorBase(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiErrorBase.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.Compute.Models
 9{
 10    /// <summary> Api error base. </summary>
 11    public partial class ApiErrorBase
 12    {
 13        /// <summary> Initializes a new instance of ApiErrorBase. </summary>
 014        public ApiErrorBase()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ApiErrorBase. </summary>
 19        /// <param name="code"> The error code. </param>
 20        /// <param name="target"> The target of the particular error. </param>
 21        /// <param name="message"> The error message. </param>
 022        internal ApiErrorBase(string code, string target, string message)
 23        {
 024            Code = code;
 025            Target = target;
 026            Message = message;
 027        }
 28
 29        /// <summary> The error code. </summary>
 030        public string Code { get; set; }
 31        /// <summary> The target of the particular error. </summary>
 032        public string Target { get; set; }
 33        /// <summary> The error message. </summary>
 034        public string Message { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\ApiErrorBase.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.Compute.Models
 12{
 13    public partial class ApiErrorBase : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Code != null)
 19            {
 020                writer.WritePropertyName("code");
 021                writer.WriteStringValue(Code);
 22            }
 023            if (Target != null)
 24            {
 025                writer.WritePropertyName("target");
 026                writer.WriteStringValue(Target);
 27            }
 028            if (Message != null)
 29            {
 030                writer.WritePropertyName("message");
 031                writer.WriteStringValue(Message);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static ApiErrorBase DeserializeApiErrorBase(JsonElement element)
 37        {
 038            string code = default;
 039            string target = default;
 040            string message = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("code"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    code = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("target"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    target = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("message"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    message = property.Value.GetString();
 68                    continue;
 69                }
 70            }
 071            return new ApiErrorBase(code, target, message);
 72        }
 73    }
 74}