< Summary

Class:Microsoft.Azure.CognitiveServices.Search.ImageSearch.Models.ErrorResponse
Assembly:Microsoft.Azure.CognitiveServices.Search.BingImageSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingImageSearch\src\Generated\ImageSearch\Models\ErrorResponse.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:80
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\Search.BingImageSearch\src\Generated\ImageSearch\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.Search.ImageSearch.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        /// <param name="readLink">The URL that returns this resource.</param>
 35        /// <param name="webSearchUrl">The URL To Bing's search result for this
 36        /// item.</param>
 37        public ErrorResponse(IList<Error> errors, string id = default(string), string readLink = default(string), string
 038            : base(id, readLink, webSearchUrl)
 39        {
 040            Errors = errors;
 41            CustomInit();
 042        }
 43
 44        /// <summary>
 45        /// An initialization method that performs custom operations like setting defaults
 46        /// </summary>
 47        partial void CustomInit();
 48
 49        /// <summary>
 50        /// Gets or sets a list of errors that describe the reasons why the
 51        /// request failed.
 52        /// </summary>
 53        [JsonProperty(PropertyName = "errors")]
 054        public IList<Error> Errors { get; set; }
 55
 56        /// <summary>
 57        /// Validate the object.
 58        /// </summary>
 59        /// <exception cref="ValidationException">
 60        /// Thrown if validation fails
 61        /// </exception>
 62        public virtual void Validate()
 63        {
 064            if (Errors == null)
 65            {
 066                throw new ValidationException(ValidationRules.CannotBeNull, "Errors");
 67            }
 068            if (Errors != null)
 69            {
 070                foreach (var element in Errors)
 71                {
 072                    if (element != null)
 73                    {
 074                        element.Validate();
 75                    }
 76                }
 77            }
 078        }
 79    }
 80}