< Summary

Class:Azure.Analytics.Synapse.AccessControl.Models.ErrorResponse
Assembly:Azure.Analytics.Synapse.AccessControl
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\ErrorResponse.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\src\Generated\Models\ErrorResponse.Serialization.cs
Covered lines:0
Uncovered lines:39
Coverable lines:39
Total lines:108
Line coverage:0% (0 of 39)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\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
 8using System;
 9using System.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.AccessControl.Models
 13{
 14    /// <summary> The ErrorResponse. </summary>
 15    internal partial class ErrorResponse
 16    {
 17        /// <summary> Initializes a new instance of ErrorResponse. </summary>
 18        /// <param name="code"> . </param>
 19        /// <param name="message"> . </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="code"/> or <paramref name="message"/> is null. </ex
 021        internal ErrorResponse(string code, string message)
 22        {
 023            if (code == null)
 24            {
 025                throw new ArgumentNullException(nameof(code));
 26            }
 027            if (message == null)
 28            {
 029                throw new ArgumentNullException(nameof(message));
 30            }
 31
 032            Code = code;
 033            Message = message;
 034            Details = new ChangeTrackingList<ErrorDetail>();
 035        }
 36
 37        /// <summary> Initializes a new instance of ErrorResponse. </summary>
 38        /// <param name="code"> . </param>
 39        /// <param name="message"> . </param>
 40        /// <param name="target"> . </param>
 41        /// <param name="details"> . </param>
 042        internal ErrorResponse(string code, string message, string target, IReadOnlyList<ErrorDetail> details)
 43        {
 044            Code = code;
 045            Message = message;
 046            Target = target;
 047            Details = details;
 048        }
 49
 050        public string Code { get; }
 051        public string Message { get; }
 052        public string Target { get; }
 053        public IReadOnlyList<ErrorDetail> Details { get; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.AccessControl\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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.AccessControl.Models
 13{
 14    internal partial class ErrorResponse
 15    {
 16        internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
 17        {
 018            string code = default;
 019            string message = default;
 020            Optional<string> target = default;
 021            Optional<IReadOnlyList<ErrorDetail>> details = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("code"))
 25                {
 026                    code = property.Value.GetString();
 027                    continue;
 28                }
 029                if (property.NameEquals("message"))
 30                {
 031                    message = property.Value.GetString();
 032                    continue;
 33                }
 034                if (property.NameEquals("target"))
 35                {
 036                    target = property.Value.GetString();
 037                    continue;
 38                }
 039                if (property.NameEquals("details"))
 40                {
 041                    List<ErrorDetail> array = new List<ErrorDetail>();
 042                    foreach (var item in property.Value.EnumerateArray())
 43                    {
 044                        array.Add(ErrorDetail.DeserializeErrorDetail(item));
 45                    }
 046                    details = array;
 47                    continue;
 48                }
 49            }
 050            return new ErrorResponse(code, message, target.Value, Optional.ToList(details));
 51        }
 52    }
 53}