< Summary

Class:Microsoft.Azure.CognitiveServices.Search.WebSearch.Models.Images
Assembly:Microsoft.Azure.CognitiveServices.Search.BingWebSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\Images.cs
Covered lines:3
Uncovered lines:27
Coverable lines:30
Total lines:127
Line coverage:10% (3 of 30)
Covered branches:0
Total branches:20
Branch coverage:0% (0 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_NextOffset()-0%100%
get_Value()-100%100%
get_QueryExpansions()-0%100%
get_SimilarTerms()-0%100%
get_RelatedSearches()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingWebSearch\src\Generated\WebSearch\Models\Images.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.WebSearch.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    /// Defines an image answer
 17    /// </summary>
 18    public partial class Images : SearchResultsAnswer
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the Images class.
 22        /// </summary>
 223        public Images()
 24        {
 25            CustomInit();
 226        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the Images class.
 30        /// </summary>
 31        /// <param name="value">A list of image objects that are relevant to
 32        /// the query. If there are no results, the List is empty.</param>
 33        /// <param name="id">A String identifier.</param>
 34        /// <param name="webSearchUrl">The URL To Bing's search result for this
 35        /// item.</param>
 36        /// <param name="totalEstimatedMatches">The estimated number of
 37        /// webpages that are relevant to the query. Use this number along with
 38        /// the count and offset query parameters to page the results.</param>
 39        public Images(IList<ImageObject> value, string id = default(string), string webSearchUrl = default(string), ILis
 040            : base(id, webSearchUrl, followUpQueries, queryContext, totalEstimatedMatches, isFamilyFriendly)
 41        {
 042            NextOffset = nextOffset;
 043            Value = value;
 044            QueryExpansions = queryExpansions;
 045            SimilarTerms = similarTerms;
 046            RelatedSearches = relatedSearches;
 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        /// </summary>
 57        [JsonProperty(PropertyName = "nextOffset")]
 058        public int? NextOffset { get; private set; }
 59
 60        /// <summary>
 61        /// Gets or sets a list of image objects that are relevant to the
 62        /// query. If there are no results, the List is empty.
 63        /// </summary>
 64        [JsonProperty(PropertyName = "value")]
 865        public IList<ImageObject> Value { get; set; }
 66
 67        /// <summary>
 68        /// </summary>
 69        [JsonProperty(PropertyName = "queryExpansions")]
 070        public IList<Query> QueryExpansions { get; private set; }
 71
 72        /// <summary>
 73        /// </summary>
 74        [JsonProperty(PropertyName = "similarTerms")]
 075        public IList<Query> SimilarTerms { get; private set; }
 76
 77        /// <summary>
 78        /// </summary>
 79        [JsonProperty(PropertyName = "relatedSearches")]
 080        public IList<Query> RelatedSearches { get; private set; }
 81
 82        /// <summary>
 83        /// Validate the object.
 84        /// </summary>
 85        /// <exception cref="ValidationException">
 86        /// Thrown if validation fails
 87        /// </exception>
 88        public override void Validate()
 89        {
 090            base.Validate();
 091            if (Value == null)
 92            {
 093                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 94            }
 095            if (QueryExpansions != null)
 96            {
 097                foreach (var element in QueryExpansions)
 98                {
 099                    if (element != null)
 100                    {
 0101                        element.Validate();
 102                    }
 103                }
 104            }
 0105            if (SimilarTerms != null)
 106            {
 0107                foreach (var element1 in SimilarTerms)
 108                {
 0109                    if (element1 != null)
 110                    {
 0111                        element1.Validate();
 112                    }
 113                }
 114            }
 0115            if (RelatedSearches != null)
 116            {
 0117                foreach (var element2 in RelatedSearches)
 118                {
 0119                    if (element2 != null)
 120                    {
 0121                        element2.Validate();
 122                    }
 123                }
 124            }
 0125        }
 126    }
 127}