< Summary

Class:Microsoft.Azure.CognitiveServices.Language.SpellCheck.Models.ErrorResponse
Assembly:Microsoft.Azure.CognitiveServices.Language.SpellCheck
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.SpellCheck\src\Generated\Models\ErrorResponse.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:77
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Errors()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.SpellCheck\src\Generated\Models\ErrorResponse.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.CognitiveServices.Language.SpellCheck.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    /// The top-level response that represents a failed request.
 17    /// </summary>
 18    public partial class ErrorResponse : Response
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the ErrorResponse class.
 22        /// </summary>
 023        public ErrorResponse()
 24        {
 25            CustomInit();
 026        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the ErrorResponse class.
 30        /// </summary>
 31        /// <param name="errors">A list of errors that describe the reasons why
 32        /// the request failed.</param>
 33        /// <param name="id">A String identifier.</param>
 34        public ErrorResponse(IList<Error> errors, string id = default(string))
 035            : base(id)
 36        {
 037            Errors = errors;
 38            CustomInit();
 039        }
 40
 41        /// <summary>
 42        /// An initialization method that performs custom operations like setting defaults
 43        /// </summary>
 44        partial void CustomInit();
 45
 46        /// <summary>
 47        /// Gets or sets a list of errors that describe the reasons why the
 48        /// request failed.
 49        /// </summary>
 50        [JsonProperty(PropertyName = "errors")]
 051        public IList<Error> Errors { get; set; }
 52
 53        /// <summary>
 54        /// Validate the object.
 55        /// </summary>
 56        /// <exception cref="ValidationException">
 57        /// Thrown if validation fails
 58        /// </exception>
 59        public virtual void Validate()
 60        {
 061            if (Errors == null)
 62            {
 063                throw new ValidationException(ValidationRules.CannotBeNull, "Errors");
 64            }
 065            if (Errors != null)
 66            {
 067                foreach (var element in Errors)
 68                {
 069                    if (element != null)
 70                    {
 071                        element.Validate();
 72                    }
 73                }
 74            }
 075        }
 76    }
 77}