< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.Models.ErrorInfo
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\ErrorInfo.cs
C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\ErrorInfo.cs
Covered lines:0
Uncovered lines:32
Coverable lines:32
Total lines:139
Line coverage:0% (0 of 32)
Covered branches:0
Total branches:18
Branch coverage:0% (0 of 18)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
PrettyPrint(...)-0%0%
.ctor()-0%100%
.ctor(...)-0%100%
get_Code()-0%100%
get_Message()-0%100%
get_Details()-0%100%
get_Innererror()-0%100%
get_AdditionalProperties()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\ErrorInfo.cs

#LineLine coverage
 1using System.Text;
 2
 3namespace Microsoft.Azure.ApplicationInsights.Query.Models
 4{
 5    public partial class ErrorInfo
 6    {
 7        internal void PrettyPrint(StringBuilder sb, string indentation = "")
 8        {
 09            sb.AppendLine($"{indentation}Code={Code}, Message={Message}");
 010            if (Details != null)
 11            {
 012                foreach (var detail in Details)
 13                {
 014                    detail.PrettyPrint(sb, $"{indentation}    ");
 15                }
 16            }
 17
 018            if (Innererror != null)
 19            {
 020                Innererror.PrettyPrint(sb, $"{indentation}  ");
 21            }
 022        }
 23    }
 24}

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\ErrorInfo.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.ApplicationInsights.Query.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// The code and message for an error.
 21    /// </summary>
 22    public partial class ErrorInfo
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the ErrorInfo class.
 26        /// </summary>
 027        public ErrorInfo()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the ErrorInfo class.
 34        /// </summary>
 35        /// <param name="code">A machine readable error code.</param>
 36        /// <param name="message">A human readable error message.</param>
 37        /// <param name="details">error details.</param>
 38        /// <param name="innererror">Inner error details if they exist.</param>
 039        public ErrorInfo(string code, string message, IList<ErrorDetail> details = default(IList<ErrorDetail>), ErrorInf
 40        {
 041            Code = code;
 042            Message = message;
 043            Details = details;
 044            Innererror = innererror;
 045            AdditionalProperties = additionalProperties;
 46            CustomInit();
 047        }
 48
 49        /// <summary>
 50        /// An initialization method that performs custom operations like setting defaults
 51        /// </summary>
 52        partial void CustomInit();
 53
 54        /// <summary>
 55        /// Gets or sets a machine readable error code.
 56        /// </summary>
 57        [JsonProperty(PropertyName = "code")]
 058        public string Code { get; set; }
 59
 60        /// <summary>
 61        /// Gets or sets a human readable error message.
 62        /// </summary>
 63        [JsonProperty(PropertyName = "message")]
 064        public string Message { get; set; }
 65
 66        /// <summary>
 67        /// Gets or sets error details.
 68        /// </summary>
 69        [JsonProperty(PropertyName = "details")]
 070        public IList<ErrorDetail> Details { get; set; }
 71
 72        /// <summary>
 73        /// Gets or sets inner error details if they exist.
 74        /// </summary>
 75        [JsonProperty(PropertyName = "innererror")]
 076        public ErrorInfo Innererror { get; set; }
 77
 78        /// <summary>
 79        /// </summary>
 80        [JsonProperty(PropertyName = "additionalProperties")]
 081        public object AdditionalProperties { get; set; }
 82
 83        /// <summary>
 84        /// Validate the object.
 85        /// </summary>
 86        /// <exception cref="ValidationException">
 87        /// Thrown if validation fails
 88        /// </exception>
 89        public virtual void Validate()
 90        {
 091            if (Code == null)
 92            {
 093                throw new ValidationException(ValidationRules.CannotBeNull, "Code");
 94            }
 095            if (Message == null)
 96            {
 097                throw new ValidationException(ValidationRules.CannotBeNull, "Message");
 98            }
 099            if (Details != null)
 100            {
 0101                foreach (var element in Details)
 102                {
 0103                    if (element != null)
 104                    {
 0105                        element.Validate();
 106                    }
 107                }
 108            }
 0109            if (Innererror != null)
 110            {
 0111                Innererror.Validate();
 112            }
 0113        }
 114    }
 115}