< Summary

Class:Microsoft.Azure.CognitiveServices.Search.VideoSearch.VideoSearchClient
Assembly:Microsoft.Azure.CognitiveServices.Search.BingVideoSearch
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\VideoSearchClient.cs
Covered lines:46
Uncovered lines:21
Coverable lines:67
Total lines:222
Line coverage:68.6% (46 of 67)
Covered branches:3
Total branches:12
Branch coverage:25% (3 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_BaseUri()-100%100%
get_SerializationSettings()-100%100%
get_DeserializationSettings()-100%100%
get_Endpoint()-100%100%
get_Credentials()-100%100%
get_Videos()-100%100%
.ctor(...)-0%100%
.ctor(...)-100%100%
.ctor(...)-0%100%
.ctor(...)-85.71%75%
.ctor(...)-0%0%
.ctor(...)-0%0%
Initialize()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Search.BingVideoSearch\src\Generated\VideoSearch\VideoSearchClient.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
 8{
 9    using Microsoft.Rest;
 10    using Microsoft.Rest.Serialization;
 11    using Models;
 12    using Newtonsoft.Json;
 13    using System.Collections;
 14    using System.Collections.Generic;
 15    using System.Net;
 16    using System.Net.Http;
 17
 18    /// <summary>
 19    /// The Video Search API lets you search on Bing for video that are
 20    /// relevant to the user's search query, for insights about a video or for
 21    /// videos that are trending based on search requests made by others. This
 22    /// section provides technical details about the query parameters and
 23    /// headers that you use to request videos and the JSON response objects
 24    /// that contain them. For examples that show how to make requests, see
 25    /// [Searching the Web for
 26    /// Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web).
 27    /// </summary>
 28    public partial class VideoSearchClient : ServiceClient<VideoSearchClient>, IVideoSearchClient
 29    {
 30        /// <summary>
 31        /// The base URI of the service.
 32        /// </summary>
 1233        internal string BaseUri {get; set;}
 34
 35        /// <summary>
 36        /// Gets or sets json serialization settings.
 37        /// </summary>
 1238        public JsonSerializerSettings SerializationSettings { get; private set; }
 39
 40        /// <summary>
 41        /// Gets or sets json deserialization settings.
 42        /// </summary>
 1843        public JsonSerializerSettings DeserializationSettings { get; private set; }
 44
 45        /// <summary>
 46        /// Supported Cognitive Services endpoints (protocol and hostname, for example:
 47        /// "https://westus.api.cognitive.microsoft.com",
 48        /// "https://api.cognitive.microsoft.com").
 49        /// </summary>
 1850        public string Endpoint { get; set; }
 51
 52        /// <summary>
 53        /// Subscription credentials which uniquely identify client subscription.
 54        /// </summary>
 3055        public ServiceClientCredentials Credentials { get; private set; }
 56
 57        /// <summary>
 58        /// Gets the IVideosOperations.
 59        /// </summary>
 1260        public virtual IVideosOperations Videos { get; private set; }
 61
 62        /// <summary>
 63        /// Initializes a new instance of the VideoSearchClient class.
 64        /// </summary>
 65        /// <param name='httpClient'>
 66        /// HttpClient to be used
 67        /// </param>
 68        /// <param name='disposeHttpClient'>
 69        /// True: will dispose the provided httpClient on calling VideoSearchClient.Dispose(). False: will not dispose p
 070        protected VideoSearchClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
 71        {
 072            Initialize();
 073        }
 74
 75        /// <summary>
 76        /// Initializes a new instance of the VideoSearchClient class.
 77        /// </summary>
 78        /// <param name='handlers'>
 79        /// Optional. The delegating handlers to add to the http client pipeline.
 80        /// </param>
 681        protected VideoSearchClient(params DelegatingHandler[] handlers) : base(handlers)
 82        {
 683            Initialize();
 684        }
 85
 86        /// <summary>
 87        /// Initializes a new instance of the VideoSearchClient class.
 88        /// </summary>
 89        /// <param name='rootHandler'>
 90        /// Optional. The http client handler used to handle http transport.
 91        /// </param>
 92        /// <param name='handlers'>
 93        /// Optional. The delegating handlers to add to the http client pipeline.
 94        /// </param>
 095        protected VideoSearchClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandl
 96        {
 097            Initialize();
 098        }
 99
 100        /// <summary>
 101        /// Initializes a new instance of the VideoSearchClient class.
 102        /// </summary>
 103        /// <param name='credentials'>
 104        /// Required. Subscription credentials which uniquely identify client subscription.
 105        /// </param>
 106        /// <param name='handlers'>
 107        /// Optional. The delegating handlers to add to the http client pipeline.
 108        /// </param>
 109        /// <exception cref="System.ArgumentNullException">
 110        /// Thrown when a required parameter is null
 111        /// </exception>
 6112        public VideoSearchClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handl
 113        {
 6114            if (credentials == null)
 115            {
 0116                throw new System.ArgumentNullException("credentials");
 117            }
 6118            Credentials = credentials;
 6119            if (Credentials != null)
 120            {
 6121                Credentials.InitializeServiceClient(this);
 122            }
 6123        }
 124
 125        /// <summary>
 126        /// Initializes a new instance of the VideoSearchClient class.
 127        /// </summary>
 128        /// <param name='credentials'>
 129        /// Required. Subscription credentials which uniquely identify client subscription.
 130        /// </param>
 131        /// <param name='httpClient'>
 132        /// HttpClient to be used
 133        /// </param>
 134        /// <param name='disposeHttpClient'>
 135        /// True: will dispose the provided httpClient on calling VideoSearchClient.Dispose(). False: will not dispose p
 136        /// <exception cref="System.ArgumentNullException">
 137        /// Thrown when a required parameter is null
 138        /// </exception>
 0139        public VideoSearchClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : 
 140        {
 0141            if (credentials == null)
 142            {
 0143                throw new System.ArgumentNullException("credentials");
 144            }
 0145            Credentials = credentials;
 0146            if (Credentials != null)
 147            {
 0148                Credentials.InitializeServiceClient(this);
 149            }
 0150        }
 151
 152        /// <summary>
 153        /// Initializes a new instance of the VideoSearchClient class.
 154        /// </summary>
 155        /// <param name='credentials'>
 156        /// Required. Subscription credentials which uniquely identify client subscription.
 157        /// </param>
 158        /// <param name='rootHandler'>
 159        /// Optional. The http client handler used to handle http transport.
 160        /// </param>
 161        /// <param name='handlers'>
 162        /// Optional. The delegating handlers to add to the http client pipeline.
 163        /// </param>
 164        /// <exception cref="System.ArgumentNullException">
 165        /// Thrown when a required parameter is null
 166        /// </exception>
 0167        public VideoSearchClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingH
 168        {
 0169            if (credentials == null)
 170            {
 0171                throw new System.ArgumentNullException("credentials");
 172            }
 0173            Credentials = credentials;
 0174            if (Credentials != null)
 175            {
 0176                Credentials.InitializeServiceClient(this);
 177            }
 0178        }
 179
 180        /// <summary>
 181        /// An optional partial-method to perform custom initialization.
 182        ///</summary>
 183        partial void CustomInitialize();
 184        /// <summary>
 185        /// Initializes client properties.
 186        /// </summary>
 187        private void Initialize()
 188        {
 6189            Videos = new VideosOperations(this);
 6190            BaseUri = "{Endpoint}/bing/v7.0";
 6191            Endpoint = "https://api.cognitive.microsoft.com";
 6192            SerializationSettings = new JsonSerializerSettings
 6193            {
 6194                Formatting = Newtonsoft.Json.Formatting.Indented,
 6195                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 6196                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 6197                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 6198                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 6199                ContractResolver = new ReadOnlyJsonContractResolver(),
 6200                Converters = new  List<JsonConverter>
 6201                    {
 6202                        new Iso8601TimeSpanConverter()
 6203                    }
 6204            };
 6205            DeserializationSettings = new JsonSerializerSettings
 6206            {
 6207                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 6208                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 6209                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 6210                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 6211                ContractResolver = new ReadOnlyJsonContractResolver(),
 6212                Converters = new List<JsonConverter>
 6213                    {
 6214                        new Iso8601TimeSpanConverter()
 6215                    }
 6216            };
 6217            SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<ResponseBase>("_type"));
 6218            DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter<ResponseBase>("_type"));
 219            CustomInitialize();
 6220        }
 221    }
 222}