< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.Models.Videos
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\Videos.cs
Covered lines:3
Uncovered lines:22
Coverable lines:25
Total lines:119
Line coverage:12% (3 of 25)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\Videos.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.VideoSearch.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 a video answer.
 17    /// </summary>
 18    public partial class Videos : SearchResultsAnswer
 19    {
 20        /// <summary>
 21        /// Initializes a new instance of the Videos class.
 22        /// </summary>
 223        public Videos()
 24        {
 25            CustomInit();
 226        }
 27
 28        /// <summary>
 29        /// Initializes a new instance of the Videos class.
 30        /// </summary>
 31        /// <param name="value">A list of video objects that are relevant to
 32        /// the query.</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        /// <param name="scenario">Possible values include: 'List',
 40        /// 'SingleDominantVideo'</param>
 41        public Videos(IList<VideoObject> value, string id = default(string), string webSearchUrl = default(string), ILis
 042            : base(id, webSearchUrl, followUpQueries, totalEstimatedMatches, isFamilyFriendly)
 43        {
 044            Value = value;
 045            NextOffset = nextOffset;
 046            Scenario = scenario;
 047            QueryExpansions = queryExpansions;
 048            PivotSuggestions = pivotSuggestions;
 49            CustomInit();
 050        }
 51
 52        /// <summary>
 53        /// An initialization method that performs custom operations like setting defaults
 54        /// </summary>
 55        partial void CustomInit();
 56
 57        /// <summary>
 58        /// Gets or sets a list of video objects that are relevant to the
 59        /// query.
 60        /// </summary>
 61        [JsonProperty(PropertyName = "value")]
 862        public IList<VideoObject> Value { get; set; }
 63
 64        /// <summary>
 65        /// </summary>
 66        [JsonProperty(PropertyName = "nextOffset")]
 067        public int? NextOffset { get; private set; }
 68
 69        /// <summary>
 70        /// Gets possible values include: 'List', 'SingleDominantVideo'
 71        /// </summary>
 72        [JsonProperty(PropertyName = "scenario")]
 073        public VideoQueryScenario? Scenario { get; private set; }
 74
 75        /// <summary>
 76        /// </summary>
 77        [JsonProperty(PropertyName = "queryExpansions")]
 078        public IList<Query> QueryExpansions { get; private set; }
 79
 80        /// <summary>
 81        /// </summary>
 82        [JsonProperty(PropertyName = "pivotSuggestions")]
 083        public IList<PivotSuggestions> PivotSuggestions { get; private set; }
 84
 85        /// <summary>
 86        /// Validate the object.
 87        /// </summary>
 88        /// <exception cref="ValidationException">
 89        /// Thrown if validation fails
 90        /// </exception>
 91        public virtual void Validate()
 92        {
 093            if (Value == null)
 94            {
 095                throw new ValidationException(ValidationRules.CannotBeNull, "Value");
 96            }
 097            if (QueryExpansions != null)
 98            {
 099                foreach (var element in QueryExpansions)
 100                {
 0101                    if (element != null)
 102                    {
 0103                        element.Validate();
 104                    }
 105                }
 106            }
 0107            if (PivotSuggestions != null)
 108            {
 0109                foreach (var element1 in PivotSuggestions)
 110                {
 0111                    if (element1 != null)
 112                    {
 0113                        element1.Validate();
 114                    }
 115                }
 116            }
 0117        }
 118    }
 119}