< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.ApplicationInsightsDataClient
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\ApplicationInsightsDataClient.cs
C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\ApplicationInsightsDataClient.cs
Covered lines:55
Uncovered lines:60
Coverable lines:115
Total lines:385
Line coverage:47.8% (55 of 115)
Covered branches:4
Total branches:30
Branch coverage:13.3% (4 of 30)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
CustomInitialize()-88.89%50%
get_AdditionalApplications()-0%100%
get_Preferences()-0%100%
get_NameHeader()-0%100%
get_RequestId()-0%100%
get_BaseUri()-100%100%
get_SerializationSettings()-100%100%
get_DeserializationSettings()-100%100%
get_Credentials()-100%100%
get_Metrics()-0%100%
get_Events()-100%100%
get_Query()-0%100%
.ctor(...)-0%100%
.ctor(...)-100%100%
.ctor(...)-0%100%
.ctor(...)-0%0%
.ctor(...)-0%0%
.ctor(...)-85.71%75%
.ctor(...)-0%0%
.ctor(...)-0%0%
.ctor(...)-0%0%
.ctor(...)-0%0%
Initialize()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\ApplicationInsightsDataClient.cs

#LineLine coverage
 1using Microsoft.Azure.ApplicationInsights.Query.Models;
 2using Microsoft.Rest;
 3using System.Collections.Generic;
 4using System.Linq;
 5using System.Net.Http;
 6using System.Threading;
 7using System.Threading.Tasks;
 8
 9namespace Microsoft.Azure.ApplicationInsights.Query
 10{
 11    public partial class ApplicationInsightsDataClient : ServiceClient<ApplicationInsightsDataClient>, IApplicationInsig
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 15        /// </summary>
 16        /// <param name='credentials'>
 17        /// Required. Subscription credentials which uniquely identify client subscription.
 18        /// </param>
 19        /// <exception cref="System.ArgumentNullException">
 20        /// Thrown when a required parameter is null
 21        /// </exception>
 022        public ApplicationInsightsDataClient(ServiceClientCredentials credentials) : this(credentials, (DelegatingHandle
 23        {
 024        }
 25
 26        partial void CustomInitialize()
 27        {
 2028            var firstHandler = this.FirstMessageHandler as DelegatingHandler;
 029            if (firstHandler == null) return;
 30
 2031            var customHandler = new CustomDelegatingHandler
 2032            {
 2033                InnerHandler = firstHandler.InnerHandler,
 2034                Client = this,
 2035            };
 36
 2037            firstHandler.InnerHandler = customHandler;
 2038        }
 39
 040        public IList<string> AdditionalApplications { get; set; } = new List<string>();
 41
 042        public ApiPreferences Preferences { get; set; } = new ApiPreferences();
 43
 044        public string NameHeader { get; set; }
 45
 046        public string RequestId { get; set; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\ApplicationInsightsDataClient.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.ApplicationInsights.Query
 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    /// Composite Swagger for Application Insights Data Client
 24    /// </summary>
 25    public partial class ApplicationInsightsDataClient : ServiceClient<ApplicationInsightsDataClient>, IApplicationInsig
 26    {
 27        /// <summary>
 28        /// The base URI of the service.
 29        /// </summary>
 8030        public System.Uri BaseUri { get; set; }
 31
 32        /// <summary>
 33        /// Gets or sets json serialization settings.
 34        /// </summary>
 6035        public JsonSerializerSettings SerializationSettings { get; private set; }
 36
 37        /// <summary>
 38        /// Gets or sets json deserialization settings.
 39        /// </summary>
 8040        public JsonSerializerSettings DeserializationSettings { get; private set; }
 41
 42        /// <summary>
 43        /// Subscription credentials which uniquely identify client subscription.
 44        /// </summary>
 14045        public ServiceClientCredentials Credentials { get; private set; }
 46
 47        /// <summary>
 48        /// Gets the IMetrics.
 49        /// </summary>
 050        public virtual IMetrics Metrics { get; private set; }
 51
 52        /// <summary>
 53        /// Gets the IEvents.
 54        /// </summary>
 6055        public virtual IEvents Events { get; private set; }
 56
 57        /// <summary>
 58        /// Gets the IQueryOperations.
 59        /// </summary>
 060        public virtual IQueryOperations Query { get; private set; }
 61
 62        /// <summary>
 63        /// Initializes a new instance of the ApplicationInsightsDataClient 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 ApplicationInsightsDataClient.Dispose(). False: will n
 070        protected ApplicationInsightsDataClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, dispos
 71        {
 072            Initialize();
 073        }
 74
 75        /// <summary>
 76        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 77        /// </summary>
 78        /// <param name='handlers'>
 79        /// Optional. The delegating handlers to add to the http client pipeline.
 80        /// </param>
 2081        protected ApplicationInsightsDataClient(params DelegatingHandler[] handlers) : base(handlers)
 82        {
 2083            Initialize();
 2084        }
 85
 86        /// <summary>
 87        /// Initializes a new instance of the ApplicationInsightsDataClient 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 ApplicationInsightsDataClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : ba
 96        {
 097            Initialize();
 098        }
 99
 100        /// <summary>
 101        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 102        /// </summary>
 103        /// <param name='baseUri'>
 104        /// Optional. The base URI of the service.
 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>
 0112        protected ApplicationInsightsDataClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers
 113        {
 0114            if (baseUri == null)
 115            {
 0116                throw new System.ArgumentNullException("baseUri");
 117            }
 0118            BaseUri = baseUri;
 0119        }
 120
 121        /// <summary>
 122        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 123        /// </summary>
 124        /// <param name='baseUri'>
 125        /// Optional. The base URI of the service.
 126        /// </param>
 127        /// <param name='rootHandler'>
 128        /// Optional. The http client handler used to handle http transport.
 129        /// </param>
 130        /// <param name='handlers'>
 131        /// Optional. The delegating handlers to add to the http client pipeline.
 132        /// </param>
 133        /// <exception cref="System.ArgumentNullException">
 134        /// Thrown when a required parameter is null
 135        /// </exception>
 0136        protected ApplicationInsightsDataClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHand
 137        {
 0138            if (baseUri == null)
 139            {
 0140                throw new System.ArgumentNullException("baseUri");
 141            }
 0142            BaseUri = baseUri;
 0143        }
 144
 145        /// <summary>
 146        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 147        /// </summary>
 148        /// <param name='credentials'>
 149        /// Required. Subscription credentials which uniquely identify client subscription.
 150        /// </param>
 151        /// <param name='handlers'>
 152        /// Optional. The delegating handlers to add to the http client pipeline.
 153        /// </param>
 154        /// <exception cref="System.ArgumentNullException">
 155        /// Thrown when a required parameter is null
 156        /// </exception>
 20157        public ApplicationInsightsDataClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) 
 158        {
 20159            if (credentials == null)
 160            {
 0161                throw new System.ArgumentNullException("credentials");
 162            }
 20163            Credentials = credentials;
 20164            if (Credentials != null)
 165            {
 20166                Credentials.InitializeServiceClient(this);
 167            }
 20168        }
 169
 170        /// <summary>
 171        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 172        /// </summary>
 173        /// <param name='credentials'>
 174        /// Required. Subscription credentials which uniquely identify client subscription.
 175        /// </param>
 176        /// <param name='httpClient'>
 177        /// HttpClient to be used
 178        /// </param>
 179        /// <param name='disposeHttpClient'>
 180        /// True: will dispose the provided httpClient on calling ApplicationInsightsDataClient.Dispose(). False: will n
 181        /// <exception cref="System.ArgumentNullException">
 182        /// Thrown when a required parameter is null
 183        /// </exception>
 0184        public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHt
 185        {
 0186            if (credentials == null)
 187            {
 0188                throw new System.ArgumentNullException("credentials");
 189            }
 0190            Credentials = credentials;
 0191            if (Credentials != null)
 192            {
 0193                Credentials.InitializeServiceClient(this);
 194            }
 0195        }
 196
 197        /// <summary>
 198        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 199        /// </summary>
 200        /// <param name='credentials'>
 201        /// Required. Subscription credentials which uniquely identify client subscription.
 202        /// </param>
 203        /// <param name='rootHandler'>
 204        /// Optional. The http client handler used to handle http transport.
 205        /// </param>
 206        /// <param name='handlers'>
 207        /// Optional. The delegating handlers to add to the http client pipeline.
 208        /// </param>
 209        /// <exception cref="System.ArgumentNullException">
 210        /// Thrown when a required parameter is null
 211        /// </exception>
 0212        public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params
 213        {
 0214            if (credentials == null)
 215            {
 0216                throw new System.ArgumentNullException("credentials");
 217            }
 0218            Credentials = credentials;
 0219            if (Credentials != null)
 220            {
 0221                Credentials.InitializeServiceClient(this);
 222            }
 0223        }
 224
 225        /// <summary>
 226        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 227        /// </summary>
 228        /// <param name='baseUri'>
 229        /// Optional. The base URI of the service.
 230        /// </param>
 231        /// <param name='credentials'>
 232        /// Required. Subscription credentials which uniquely identify client subscription.
 233        /// </param>
 234        /// <param name='handlers'>
 235        /// Optional. The delegating handlers to add to the http client pipeline.
 236        /// </param>
 237        /// <exception cref="System.ArgumentNullException">
 238        /// Thrown when a required parameter is null
 239        /// </exception>
 0240        public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, params Delegating
 241        {
 0242            if (baseUri == null)
 243            {
 0244                throw new System.ArgumentNullException("baseUri");
 245            }
 0246            if (credentials == null)
 247            {
 0248                throw new System.ArgumentNullException("credentials");
 249            }
 0250            BaseUri = baseUri;
 0251            Credentials = credentials;
 0252            if (Credentials != null)
 253            {
 0254                Credentials.InitializeServiceClient(this);
 255            }
 0256        }
 257
 258        /// <summary>
 259        /// Initializes a new instance of the ApplicationInsightsDataClient class.
 260        /// </summary>
 261        /// <param name='baseUri'>
 262        /// Optional. The base URI of the service.
 263        /// </param>
 264        /// <param name='credentials'>
 265        /// Required. Subscription credentials which uniquely identify client subscription.
 266        /// </param>
 267        /// <param name='rootHandler'>
 268        /// Optional. The http client handler used to handle http transport.
 269        /// </param>
 270        /// <param name='handlers'>
 271        /// Optional. The delegating handlers to add to the http client pipeline.
 272        /// </param>
 273        /// <exception cref="System.ArgumentNullException">
 274        /// Thrown when a required parameter is null
 275        /// </exception>
 0276        public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler
 277        {
 0278            if (baseUri == null)
 279            {
 0280                throw new System.ArgumentNullException("baseUri");
 281            }
 0282            if (credentials == null)
 283            {
 0284                throw new System.ArgumentNullException("credentials");
 285            }
 0286            BaseUri = baseUri;
 0287            Credentials = credentials;
 0288            if (Credentials != null)
 289            {
 0290                Credentials.InitializeServiceClient(this);
 291            }
 0292        }
 293
 294        /// <summary>
 295        /// An optional partial-method to perform custom initialization.
 296        ///</summary>
 297        partial void CustomInitialize();
 298        /// <summary>
 299        /// Initializes client properties.
 300        /// </summary>
 301        private void Initialize()
 302        {
 20303            Metrics = new Metrics(this);
 20304            Events = new Events(this);
 20305            Query = new QueryOperations(this);
 20306            BaseUri = new System.Uri("https://api.applicationinsights.io/v1");
 20307            SerializationSettings = new JsonSerializerSettings
 20308            {
 20309                Formatting = Newtonsoft.Json.Formatting.Indented,
 20310                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 20311                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 20312                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 20313                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 20314                ContractResolver = new ReadOnlyJsonContractResolver(),
 20315                Converters = new  List<JsonConverter>
 20316                    {
 20317                        new Iso8601TimeSpanConverter()
 20318                    }
 20319            };
 20320            DeserializationSettings = new JsonSerializerSettings
 20321            {
 20322                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 20323                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 20324                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 20325                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 20326                ContractResolver = new ReadOnlyJsonContractResolver(),
 20327                Converters = new List<JsonConverter>
 20328                    {
 20329                        new Iso8601TimeSpanConverter()
 20330                    }
 20331            };
 20332            SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<EventsResultData>("type"));
 20333            DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter<EventsResultData>("type"));
 20334            CustomInitialize();
 20335        }
 336    }
 337}