< Summary

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