< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Text()-0%100%
get_DisplayText()-0%100%
get_WebSearchUrl()-0%100%
get_SearchLink()-0%100%
get_Thumbnail()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\Models\Query.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.Linq;
 12
 13    /// <summary>
 14    /// Defines a search query.
 15    /// </summary>
 16    public partial class Query
 17    {
 18        /// <summary>
 19        /// Initializes a new instance of the Query class.
 20        /// </summary>
 29021        public Query()
 22        {
 23            CustomInit();
 29024        }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the Query class.
 28        /// </summary>
 29        /// <param name="text">The query string. Use this string as the query
 30        /// term in a new search request.</param>
 31        /// <param name="displayText">The display version of the query term.
 32        /// This version of the query term may contain special characters that
 33        /// highlight the search term found in the query string. The string
 34        /// contains the highlighting characters only if the query enabled hit
 35        /// highlighting</param>
 36        /// <param name="webSearchUrl">The URL that takes the user to the Bing
 37        /// search results page for the query.Only related search results
 38        /// include this field.</param>
 039        public Query(string text, string displayText = default(string), string webSearchUrl = default(string), string se
 40        {
 041            Text = text;
 042            DisplayText = displayText;
 043            WebSearchUrl = webSearchUrl;
 044            SearchLink = searchLink;
 045            Thumbnail = thumbnail;
 46            CustomInit();
 047        }
 48
 49        /// <summary>
 50        /// An initialization method that performs custom operations like setting defaults
 51        /// </summary>
 52        partial void CustomInit();
 53
 54        /// <summary>
 55        /// Gets or sets the query string. Use this string as the query term in
 56        /// a new search request.
 57        /// </summary>
 58        [JsonProperty(PropertyName = "text")]
 059        public string Text { get; set; }
 60
 61        /// <summary>
 62        /// Gets the display version of the query term. This version of the
 63        /// query term may contain special characters that highlight the search
 64        /// term found in the query string. The string contains the
 65        /// highlighting characters only if the query enabled hit highlighting
 66        /// </summary>
 67        [JsonProperty(PropertyName = "displayText")]
 068        public string DisplayText { get; private set; }
 69
 70        /// <summary>
 71        /// Gets the URL that takes the user to the Bing search results page
 72        /// for the query.Only related search results include this field.
 73        /// </summary>
 74        [JsonProperty(PropertyName = "webSearchUrl")]
 075        public string WebSearchUrl { get; private set; }
 76
 77        /// <summary>
 78        /// </summary>
 79        [JsonProperty(PropertyName = "searchLink")]
 080        public string SearchLink { get; private set; }
 81
 82        /// <summary>
 83        /// </summary>
 84        [JsonProperty(PropertyName = "thumbnail")]
 17685        public ImageObject Thumbnail { get; private set; }
 86
 87        /// <summary>
 88        /// Validate the object.
 89        /// </summary>
 90        /// <exception cref="ValidationException">
 91        /// Thrown if validation fails
 92        /// </exception>
 93        public virtual void Validate()
 94        {
 095            if (Text == null)
 96            {
 097                throw new ValidationException(ValidationRules.CannotBeNull, "Text");
 98            }
 099        }
 100    }
 101}