< Summary

Class:Microsoft.Azure.OperationalInsights.Models.ErrorDetail
Assembly:Microsoft.Azure.OperationalInsights
File(s):C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\Models\ErrorDetail.cs
C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Generated\Models\ErrorDetail.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:127
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Code()-100%100%
get_Message()-100%100%
get_Target()-100%100%
get_Value()-100%100%
get_Resources()-100%100%
get_AdditionalProperties()-100%100%
Validate()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
PrettyPrint(...)-0%0%
.ctor()-0%100%
.ctor(...)-0%100%
get_Code()-0%100%
get_Message()-0%100%
get_Target()-0%100%
get_Value()-0%100%
get_Resources()-0%100%
get_AdditionalProperties()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\Models\ErrorDetail.cs

#LineLine coverage
 1using System.Text;
 2
 3namespace Microsoft.Azure.OperationalInsights.Models
 4{
 5    public partial class ErrorDetail
 6    {
 7        internal void PrettyPrint(StringBuilder sb, string indentation)
 8        {
 09            sb.AppendLine($"{indentation}Code={Code}, Message={Message}, Target={Target}, Value={Value}");
 010            if (Resources != null && Resources.Count > 0)
 11            {
 012                sb.AppendLine($"{indentation}  Resources={string.Join(",", Resources)}");
 13            }
 014        }
 15    }
 16}

C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Generated\Models\ErrorDetail.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.OperationalInsights.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Collections;
 12    using System.Collections.Generic;
 13    using System.Linq;
 14
 15    /// <summary>
 16    /// Error details.
 17    /// </summary>
 18    public partial class ErrorDetail
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the ErrorDetail class.
 22        /// </summary>
 023        public ErrorDetail()
 24        {
 25            CustomInit();
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the ErrorDetail class.
 30        /// </summary>
 31        /// <param name="code">The error's code.</param>
 32        /// <param name="message">A human readable error message.</param>
 33        /// <param name="target">Indicates which property in the request is
 34        /// responsible for the error.</param>
 35        /// <param name="value">Indicates which value in 'target' is
 36        /// responsible for the error.</param>
 37        /// <param name="resources">Indicates resources which were responsible
 38        /// for the error.</param>
 039        public ErrorDetail(string code, string message, string target = default(string), string value = default(string),
 40        {
 041            Code = code;
 042            Message = message;
 043            Target = target;
 044            Value = value;
 045            Resources = resources;
 046            AdditionalProperties = additionalProperties;
 47            CustomInit();
 048        }
 49
 50        /// <summary>
 51        /// An initialization method that performs custom operations like setting defaults
 52        /// </summary>
 53        partial void CustomInit();
 54
 55        /// <summary>
 56        /// Gets or sets the error's code.
 57        /// </summary>
 58        [JsonProperty(PropertyName = "code")]
 059        public string Code { get; set; }
 60
 61        /// <summary>
 62        /// Gets or sets a human readable error message.
 63        /// </summary>
 64        [JsonProperty(PropertyName = "message")]
 065        public string Message { get; set; }
 66
 67        /// <summary>
 68        /// Gets or sets indicates which property in the request is responsible
 69        /// for the error.
 70        /// </summary>
 71        [JsonProperty(PropertyName = "target")]
 072        public string Target { get; set; }
 73
 74        /// <summary>
 75        /// Gets or sets indicates which value in 'target' is responsible for
 76        /// the error.
 77        /// </summary>
 78        [JsonProperty(PropertyName = "value")]
 079        public string Value { get; set; }
 80
 81        /// <summary>
 82        /// Gets or sets indicates resources which were responsible for the
 83        /// error.
 84        /// </summary>
 85        [JsonProperty(PropertyName = "resources")]
 086        public IList<string> Resources { get; set; }
 87
 88        /// <summary>
 89        /// </summary>
 90        [JsonProperty(PropertyName = "additionalProperties")]
 091        public object AdditionalProperties { get; set; }
 92
 93        /// <summary>
 94        /// Validate the object.
 95        /// </summary>
 96        /// <exception cref="ValidationException">
 97        /// Thrown if validation fails
 98        /// </exception>
 99        public virtual void Validate()
 100        {
 0101            if (Code == null)
 102            {
 0103                throw new ValidationException(ValidationRules.CannotBeNull, "Code");
 104            }
 0105            if (Message == null)
 106            {
 0107                throw new ValidationException(ValidationRules.CannotBeNull, "Message");
 108            }
 0109        }
 110    }
 111}