< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.LUISRuntimeClient
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\LUISRuntimeClient.cs
Covered lines:43
Uncovered lines:21
Coverable lines:64
Total lines:212
Line coverage:67.1% (43 of 64)
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_Prediction()-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\Language.LUIS.Runtime\src\Generated\LUISRuntimeClient.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.Language.LUIS.Runtime
 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    public partial class LUISRuntimeClient : ServiceClient<LUISRuntimeClient>, ILUISRuntimeClient
 23    {
 24        /// <summary>
 25        /// The base URI of the service.
 26        /// </summary>
 1427        internal string BaseUri {get; set;}
 28
 29        /// <summary>
 30        /// Gets or sets json serialization settings.
 31        /// </summary>
 2832        public JsonSerializerSettings SerializationSettings { get; private set; }
 33
 34        /// <summary>
 35        /// Gets or sets json deserialization settings.
 36        /// </summary>
 1437        public JsonSerializerSettings DeserializationSettings { get; private set; }
 38
 39        /// <summary>
 40        /// Supported Cognitive Services endpoints (protocol and hostname, for example:
 41        /// https://westus.api.cognitive.microsoft.com).
 42        /// </summary>
 2243        public string Endpoint { get; set; }
 44
 45        /// <summary>
 46        /// Subscription credentials which uniquely identify client subscription.
 47        /// </summary>
 3648        public ServiceClientCredentials Credentials { get; private set; }
 49
 50        /// <summary>
 51        /// Gets the IPredictionOperations.
 52        /// </summary>
 1653        public virtual IPredictionOperations Prediction { get; private set; }
 54
 55        /// <summary>
 56        /// Initializes a new instance of the LUISRuntimeClient class.
 57        /// </summary>
 58        /// <param name='httpClient'>
 59        /// HttpClient to be used
 60        /// </param>
 61        /// <param name='disposeHttpClient'>
 62        /// True: will dispose the provided httpClient on calling LUISRuntimeClient.Dispose(). False: will not dispose p
 063        protected LUISRuntimeClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
 64        {
 065            Initialize();
 066        }
 67
 68        /// <summary>
 69        /// Initializes a new instance of the LUISRuntimeClient class.
 70        /// </summary>
 71        /// <param name='handlers'>
 72        /// Optional. The delegating handlers to add to the http client pipeline.
 73        /// </param>
 874        protected LUISRuntimeClient(params DelegatingHandler[] handlers) : base(handlers)
 75        {
 876            Initialize();
 877        }
 78
 79        /// <summary>
 80        /// Initializes a new instance of the LUISRuntimeClient class.
 81        /// </summary>
 82        /// <param name='rootHandler'>
 83        /// Optional. The http client handler used to handle http transport.
 84        /// </param>
 85        /// <param name='handlers'>
 86        /// Optional. The delegating handlers to add to the http client pipeline.
 87        /// </param>
 088        protected LUISRuntimeClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandl
 89        {
 090            Initialize();
 091        }
 92
 93        /// <summary>
 94        /// Initializes a new instance of the LUISRuntimeClient class.
 95        /// </summary>
 96        /// <param name='credentials'>
 97        /// Required. Subscription credentials which uniquely identify client subscription.
 98        /// </param>
 99        /// <param name='handlers'>
 100        /// Optional. The delegating handlers to add to the http client pipeline.
 101        /// </param>
 102        /// <exception cref="System.ArgumentNullException">
 103        /// Thrown when a required parameter is null
 104        /// </exception>
 8105        public LUISRuntimeClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handl
 106        {
 8107            if (credentials == null)
 108            {
 0109                throw new System.ArgumentNullException("credentials");
 110            }
 8111            Credentials = credentials;
 8112            if (Credentials != null)
 113            {
 8114                Credentials.InitializeServiceClient(this);
 115            }
 8116        }
 117
 118        /// <summary>
 119        /// Initializes a new instance of the LUISRuntimeClient class.
 120        /// </summary>
 121        /// <param name='credentials'>
 122        /// Required. Subscription credentials which uniquely identify client subscription.
 123        /// </param>
 124        /// <param name='httpClient'>
 125        /// HttpClient to be used
 126        /// </param>
 127        /// <param name='disposeHttpClient'>
 128        /// True: will dispose the provided httpClient on calling LUISRuntimeClient.Dispose(). False: will not dispose p
 129        /// <exception cref="System.ArgumentNullException">
 130        /// Thrown when a required parameter is null
 131        /// </exception>
 0132        public LUISRuntimeClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : 
 133        {
 0134            if (credentials == null)
 135            {
 0136                throw new System.ArgumentNullException("credentials");
 137            }
 0138            Credentials = credentials;
 0139            if (Credentials != null)
 140            {
 0141                Credentials.InitializeServiceClient(this);
 142            }
 0143        }
 144
 145        /// <summary>
 146        /// Initializes a new instance of the LUISRuntimeClient class.
 147        /// </summary>
 148        /// <param name='credentials'>
 149        /// Required. Subscription credentials which uniquely identify client subscription.
 150        /// </param>
 151        /// <param name='rootHandler'>
 152        /// Optional. The http client handler used to handle http transport.
 153        /// </param>
 154        /// <param name='handlers'>
 155        /// Optional. The delegating handlers to add to the http client pipeline.
 156        /// </param>
 157        /// <exception cref="System.ArgumentNullException">
 158        /// Thrown when a required parameter is null
 159        /// </exception>
 0160        public LUISRuntimeClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingH
 161        {
 0162            if (credentials == null)
 163            {
 0164                throw new System.ArgumentNullException("credentials");
 165            }
 0166            Credentials = credentials;
 0167            if (Credentials != null)
 168            {
 0169                Credentials.InitializeServiceClient(this);
 170            }
 0171        }
 172
 173        /// <summary>
 174        /// An optional partial-method to perform custom initialization.
 175        ///</summary>
 176        partial void CustomInitialize();
 177        /// <summary>
 178        /// Initializes client properties.
 179        /// </summary>
 180        private void Initialize()
 181        {
 8182            Prediction = new PredictionOperations(this);
 8183            BaseUri = "{Endpoint}/luis/prediction/v3.0";
 8184            SerializationSettings = new JsonSerializerSettings
 8185            {
 8186                Formatting = Newtonsoft.Json.Formatting.Indented,
 8187                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 8188                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 8189                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 8190                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 8191                ContractResolver = new ReadOnlyJsonContractResolver(),
 8192                Converters = new  List<JsonConverter>
 8193                    {
 8194                        new Iso8601TimeSpanConverter()
 8195                    }
 8196            };
 8197            DeserializationSettings = new JsonSerializerSettings
 8198            {
 8199                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 8200                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 8201                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 8202                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 8203                ContractResolver = new ReadOnlyJsonContractResolver(),
 8204                Converters = new List<JsonConverter>
 8205                    {
 8206                        new Iso8601TimeSpanConverter()
 8207                    }
 8208            };
 209            CustomInitialize();
 8210        }
 211    }
 212}