< Summary

Class:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.QnAMakerClient
Assembly:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\QnAMakerClient.cs
Covered lines:0
Uncovered lines:72
Coverable lines:72
Total lines:239
Line coverage:0% (0 of 72)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_BaseUri()-0%100%
get_SerializationSettings()-0%100%
get_DeserializationSettings()-0%100%
get_Endpoint()-0%100%
get_Credentials()-0%100%
get_EndpointSettings()-0%100%
get_EndpointKeys()-0%100%
get_Alterations()-0%100%
get_Knowledgebase()-0%100%
get_Operations()-0%100%
.ctor(...)-0%100%
.ctor(...)-0%100%
.ctor(...)-0%100%
.ctor(...)-0%0%
.ctor(...)-0%0%
.ctor(...)-0%0%
Initialize()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\QnAMakerClient.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Serialization;
 15    using Models;
 16    using Newtonsoft.Json;
 17    using System.Collections;
 18    using System.Collections.Generic;
 19    using System.Net;
 20    using System.Net.Http;
 21
 22    /// <summary>
 23    /// An API for QnAMaker Service
 24    /// </summary>
 25    public partial class QnAMakerClient : ServiceClient<QnAMakerClient>, IQnAMakerClient
 26    {
 27        /// <summary>
 28        /// The base URI of the service.
 29        /// </summary>
 030        internal string BaseUri {get; set;}
 31
 32        /// <summary>
 33        /// Gets or sets json serialization settings.
 34        /// </summary>
 035        public JsonSerializerSettings SerializationSettings { get; private set; }
 36
 37        /// <summary>
 38        /// Gets or sets json deserialization settings.
 39        /// </summary>
 040        public JsonSerializerSettings DeserializationSettings { get; private set; }
 41
 42        /// <summary>
 43        /// Supported Cognitive Services endpoints (protocol and hostname, for example:
 44        /// https://westus.api.cognitive.microsoft.com).
 45        /// </summary>
 046        public string Endpoint { get; set; }
 47
 48        /// <summary>
 49        /// Subscription credentials which uniquely identify client subscription.
 50        /// </summary>
 051        public ServiceClientCredentials Credentials { get; private set; }
 52
 53        /// <summary>
 54        /// Gets the IEndpointSettings.
 55        /// </summary>
 056        public virtual IEndpointSettings EndpointSettings { get; private set; }
 57
 58        /// <summary>
 59        /// Gets the IEndpointKeys.
 60        /// </summary>
 061        public virtual IEndpointKeys EndpointKeys { get; private set; }
 62
 63        /// <summary>
 64        /// Gets the IAlterations.
 65        /// </summary>
 066        public virtual IAlterations Alterations { get; private set; }
 67
 68        /// <summary>
 69        /// Gets the IKnowledgebase.
 70        /// </summary>
 071        public virtual IKnowledgebase Knowledgebase { get; private set; }
 72
 73        /// <summary>
 74        /// Gets the IOperations.
 75        /// </summary>
 076        public virtual IOperations Operations { get; private set; }
 77
 78        /// <summary>
 79        /// Initializes a new instance of the QnAMakerClient class.
 80        /// </summary>
 81        /// <param name='httpClient'>
 82        /// HttpClient to be used
 83        /// </param>
 84        /// <param name='disposeHttpClient'>
 85        /// True: will dispose the provided httpClient on calling QnAMakerClient.Dispose(). False: will not dispose prov
 086        protected QnAMakerClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
 87        {
 088            Initialize();
 089        }
 90
 91        /// <summary>
 92        /// Initializes a new instance of the QnAMakerClient class.
 93        /// </summary>
 94        /// <param name='handlers'>
 95        /// Optional. The delegating handlers to add to the http client pipeline.
 96        /// </param>
 097        protected QnAMakerClient(params DelegatingHandler[] handlers) : base(handlers)
 98        {
 099            Initialize();
 0100        }
 101
 102        /// <summary>
 103        /// Initializes a new instance of the QnAMakerClient class.
 104        /// </summary>
 105        /// <param name='rootHandler'>
 106        /// Optional. The http client handler used to handle http transport.
 107        /// </param>
 108        /// <param name='handlers'>
 109        /// Optional. The delegating handlers to add to the http client pipeline.
 110        /// </param>
 0111        protected QnAMakerClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler,
 112        {
 0113            Initialize();
 0114        }
 115
 116        /// <summary>
 117        /// Initializes a new instance of the QnAMakerClient class.
 118        /// </summary>
 119        /// <param name='credentials'>
 120        /// Required. Subscription credentials which uniquely identify client subscription.
 121        /// </param>
 122        /// <param name='handlers'>
 123        /// Optional. The delegating handlers to add to the http client pipeline.
 124        /// </param>
 125        /// <exception cref="System.ArgumentNullException">
 126        /// Thrown when a required parameter is null
 127        /// </exception>
 0128        public QnAMakerClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers
 129        {
 0130            if (credentials == null)
 131            {
 0132                throw new System.ArgumentNullException("credentials");
 133            }
 0134            Credentials = credentials;
 0135            if (Credentials != null)
 136            {
 0137                Credentials.InitializeServiceClient(this);
 138            }
 0139        }
 140
 141        /// <summary>
 142        /// Initializes a new instance of the QnAMakerClient class.
 143        /// </summary>
 144        /// <param name='credentials'>
 145        /// Required. Subscription credentials which uniquely identify client subscription.
 146        /// </param>
 147        /// <param name='httpClient'>
 148        /// HttpClient to be used
 149        /// </param>
 150        /// <param name='disposeHttpClient'>
 151        /// True: will dispose the provided httpClient on calling QnAMakerClient.Dispose(). False: will not dispose prov
 152        /// <exception cref="System.ArgumentNullException">
 153        /// Thrown when a required parameter is null
 154        /// </exception>
 0155        public QnAMakerClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : thi
 156        {
 0157            if (credentials == null)
 158            {
 0159                throw new System.ArgumentNullException("credentials");
 160            }
 0161            Credentials = credentials;
 0162            if (Credentials != null)
 163            {
 0164                Credentials.InitializeServiceClient(this);
 165            }
 0166        }
 167
 168        /// <summary>
 169        /// Initializes a new instance of the QnAMakerClient class.
 170        /// </summary>
 171        /// <param name='credentials'>
 172        /// Required. Subscription credentials which uniquely identify client subscription.
 173        /// </param>
 174        /// <param name='rootHandler'>
 175        /// Optional. The http client handler used to handle http transport.
 176        /// </param>
 177        /// <param name='handlers'>
 178        /// Optional. The delegating handlers to add to the http client pipeline.
 179        /// </param>
 180        /// <exception cref="System.ArgumentNullException">
 181        /// Thrown when a required parameter is null
 182        /// </exception>
 0183        public QnAMakerClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHand
 184        {
 0185            if (credentials == null)
 186            {
 0187                throw new System.ArgumentNullException("credentials");
 188            }
 0189            Credentials = credentials;
 0190            if (Credentials != null)
 191            {
 0192                Credentials.InitializeServiceClient(this);
 193            }
 0194        }
 195
 196        /// <summary>
 197        /// An optional partial-method to perform custom initialization.
 198        ///</summary>
 199        partial void CustomInitialize();
 200        /// <summary>
 201        /// Initializes client properties.
 202        /// </summary>
 203        private void Initialize()
 204        {
 0205            EndpointSettings = new EndpointSettings(this);
 0206            EndpointKeys = new EndpointKeys(this);
 0207            Alterations = new Alterations(this);
 0208            Knowledgebase = new Knowledgebase(this);
 0209            Operations = new Operations(this);
 0210            BaseUri = "{Endpoint}/qnamaker/v4.0";
 0211            SerializationSettings = new JsonSerializerSettings
 0212            {
 0213                Formatting = Newtonsoft.Json.Formatting.Indented,
 0214                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 0215                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 0216                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 0217                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 0218                ContractResolver = new ReadOnlyJsonContractResolver(),
 0219                Converters = new  List<JsonConverter>
 0220                    {
 0221                        new Iso8601TimeSpanConverter()
 0222                    }
 0223            };
 0224            DeserializationSettings = new JsonSerializerSettings
 0225            {
 0226                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 0227                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 0228                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 0229                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 0230                ContractResolver = new ReadOnlyJsonContractResolver(),
 0231                Converters = new List<JsonConverter>
 0232                    {
 0233                        new Iso8601TimeSpanConverter()
 0234                    }
 0235            };
 236            CustomInitialize();
 0237        }
 238    }
 239}