< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.CloudError
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CloudError.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CloudError.Serialization.cs
Covered lines:0
Uncovered lines:41
Coverable lines:41
Total lines:119
Line coverage:0% (0 of 41)
Covered branches:0
Total branches:20
Branch coverage:0% (0 of 20)

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%
DeserializeCloudError(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CloudError.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.Artifacts.Models
 13{
 14    /// <summary> The object that defines the structure of an Azure Synapse error response. </summary>
 15    internal partial class CloudError
 16    {
 17        /// <summary> Initializes a new instance of CloudError. </summary>
 18        /// <param name="code"> Error code. </param>
 19        /// <param name="message"> Error message. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="code"/> or <paramref name="message"/> is null. </ex
 021        internal CloudError(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<CloudError>();
 035        }
 36
 37        /// <summary> Initializes a new instance of CloudError. </summary>
 38        /// <param name="code"> Error code. </param>
 39        /// <param name="message"> Error message. </param>
 40        /// <param name="target"> Property name/path in request associated with error. </param>
 41        /// <param name="details"> Array with additional error details. </param>
 042        internal CloudError(string code, string message, string target, IReadOnlyList<CloudError> details)
 43        {
 044            Code = code;
 045            Message = message;
 046            Target = target;
 047            Details = details;
 048        }
 49
 50        /// <summary> Error code. </summary>
 051        public string Code { get; }
 52        /// <summary> Error message. </summary>
 053        public string Message { get; }
 54        /// <summary> Property name/path in request associated with error. </summary>
 055        public string Target { get; }
 56        /// <summary> Array with additional error details. </summary>
 057        public IReadOnlyList<CloudError> Details { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CloudError.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.Artifacts.Models
 13{
 14    internal partial class CloudError
 15    {
 16        internal static CloudError DeserializeCloudError(JsonElement element)
 17        {
 018            string code = default;
 019            string message = default;
 020            Optional<string> target = default;
 021            Optional<IReadOnlyList<CloudError>> details = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("error"))
 25                {
 026                    foreach (var property0 in property.Value.EnumerateObject())
 27                    {
 028                        if (property0.NameEquals("code"))
 29                        {
 030                            code = property0.Value.GetString();
 031                            continue;
 32                        }
 033                        if (property0.NameEquals("message"))
 34                        {
 035                            message = property0.Value.GetString();
 036                            continue;
 37                        }
 038                        if (property0.NameEquals("target"))
 39                        {
 040                            target = property0.Value.GetString();
 041                            continue;
 42                        }
 043                        if (property0.NameEquals("details"))
 44                        {
 045                            List<CloudError> array = new List<CloudError>();
 046                            foreach (var item in property0.Value.EnumerateArray())
 47                            {
 048                                array.Add(DeserializeCloudError(item));
 49                            }
 050                            details = array;
 51                            continue;
 52                        }
 53                    }
 54                    continue;
 55                }
 56            }
 057            return new CloudError(code, message, target.Value, Optional.ToList(details));
 58        }
 59    }
 60}