< Summary

Class:Microsoft.Azure.Attestation.AttestationClient
Assembly:Microsoft.Azure.Attestation
File(s):C:\Git\azure-sdk-for-net\sdk\attestation\Microsoft.Azure.Attestation\src\Customized\AttestationClient.cs
C:\Git\azure-sdk-for-net\sdk\attestation\Microsoft.Azure.Attestation\src\Generated\AttestationClient.cs
Covered lines:72
Uncovered lines:28
Coverable lines:100
Total lines:298
Line coverage:72% (72 of 100)
Covered branches:5
Total branches:16
Branch coverage:31.2% (5 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
CustomInitialize()-88.89%50%
.ctor(...)-0%100%
CustomInitialize()-90%50%
get_BaseUri()-100%100%
get_SerializationSettings()-100%100%
get_DeserializationSettings()-100%100%
get_Credentials()-100%100%
get_ApiVersion()-100%100%
get_AcceptLanguage()-100%100%
get_LongRunningOperationRetryTimeout()-0%100%
get_GenerateClientRequestId()-100%100%
get_Policy()-100%100%
get_PolicyCertificates()-100%100%
get_SigningCertificates()-100%100%
get_MetadataConfiguration()-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\attestation\Microsoft.Azure.Attestation\src\Customized\AttestationClient.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3
 4
 5using Microsoft.Rest;
 6using Microsoft.Rest.Azure;
 7using System.Net.Http;
 8
 9namespace Microsoft.Azure.Attestation
 10{
 11    public partial class AttestationClient : ServiceClient<AttestationClient>, IAttestationClient, IAzureClient
 12    {
 13        /// <summary>
 14        /// Initializes a new instance of the AttestationClient 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>
 22        public AttestationClient(ServiceClientCredentials credentials)
 023            : this(credentials, (DelegatingHandler[])null)
 24        {
 025        }
 26
 27        partial void CustomInitialize()
 28        {
 429            var firstHandler = this.FirstMessageHandler as DelegatingHandler;
 030            if (firstHandler == null) return;
 31
 432            var customHandler = new CustomDelegatingHandler
 433            {
 434                InnerHandler = firstHandler.InnerHandler,
 435                Client = this,
 436            };
 37
 438            firstHandler.InnerHandler = customHandler;
 439        }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\attestation\Microsoft.Azure.Attestation\src\Generated\AttestationClient.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.Attestation
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Azure;
 15    using Microsoft.Rest.Serialization;
 16    using Models;
 17    using Newtonsoft.Json;
 18    using System.Collections;
 19    using System.Collections.Generic;
 20    using System.Linq;
 21    using System.Net;
 22    using System.Net.Http;
 023
 24    /// <summary>
 025    /// Describes the interface for the per-tenant enclave service.
 26    /// </summary>
 27    public partial class AttestationClient : ServiceClient<AttestationClient>, IAttestationClient, IAzureClient
 28    {
 429        /// <summary>
 030        /// The base URI of the service.
 31        /// </summary>
 3232        internal string BaseUri {get; set;}
 433
 434        /// <summary>
 435        /// Gets or sets json serialization settings.
 436        /// </summary>
 1837        public JsonSerializerSettings SerializationSettings { get; private set; }
 438
 439        /// <summary>
 40        /// Gets or sets json deserialization settings.
 41        /// </summary>
 3442        public JsonSerializerSettings DeserializationSettings { get; private set; }
 43
 44        /// <summary>
 45        /// Credentials needed for the client to connect to Azure.
 46        /// </summary>
 6447        public ServiceClientCredentials Credentials { get; private set; }
 48
 49        /// <summary>
 50        /// Client API version.
 51        /// </summary>
 4052        public string ApiVersion { get; private set; }
 53
 54        /// <summary>
 55        /// The preferred language for the response.
 56        /// </summary>
 4857        public string AcceptLanguage { get; set; }
 58
 59        /// <summary>
 60        /// The retry timeout in seconds for Long Running Operations. Default value is
 61        /// 30.
 62        /// </summary>
 063        public int? LongRunningOperationRetryTimeout { get; set; }
 64
 65        /// <summary>
 66        /// Whether a unique x-ms-client-request-id should be generated. When set to
 67        /// true a unique x-ms-client-request-id value is generated and included in
 68        /// each request. Default is true.
 69        /// </summary>
 4870        public bool? GenerateClientRequestId { get; set; }
 71
 72        /// <summary>
 73        /// Gets the IPolicyOperations.
 74        /// </summary>
 1675        public virtual IPolicyOperations Policy { get; private set; }
 76
 77        /// <summary>
 78        /// Gets the IPolicyCertificatesOperations.
 79        /// </summary>
 1680        public virtual IPolicyCertificatesOperations PolicyCertificates { get; private set; }
 81
 82        /// <summary>
 83        /// Gets the ISigningCertificatesOperations.
 84        /// </summary>
 1085        public virtual ISigningCertificatesOperations SigningCertificates { get; private set; }
 86
 87        /// <summary>
 88        /// Gets the IMetadataConfigurationOperations.
 89        /// </summary>
 1090        public virtual IMetadataConfigurationOperations MetadataConfiguration { get; private set; }
 91
 92        /// <summary>
 93        /// Initializes a new instance of the AttestationClient class.
 94        /// </summary>
 95        /// <param name='httpClient'>
 96        /// HttpClient to be used
 97        /// </param>
 98        /// <param name='disposeHttpClient'>
 99        /// True: will dispose the provided httpClient on calling AttestationClient.Dispose(). False: will not dispose p
 0100        protected AttestationClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
 101        {
 0102            Initialize();
 0103        }
 104
 105        /// <summary>
 106        /// Initializes a new instance of the AttestationClient class.
 107        /// </summary>
 108        /// <param name='handlers'>
 109        /// Optional. The delegating handlers to add to the http client pipeline.
 110        /// </param>
 8111        protected AttestationClient(params DelegatingHandler[] handlers) : base(handlers)
 112        {
 8113            Initialize();
 8114        }
 115
 116        /// <summary>
 117        /// Initializes a new instance of the AttestationClient class.
 118        /// </summary>
 119        /// <param name='rootHandler'>
 120        /// Optional. The http client handler used to handle http transport.
 121        /// </param>
 122        /// <param name='handlers'>
 123        /// Optional. The delegating handlers to add to the http client pipeline.
 124        /// </param>
 0125        protected AttestationClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandl
 126        {
 0127            Initialize();
 0128        }
 129
 130        /// <summary>
 131        /// Initializes a new instance of the AttestationClient class.
 132        /// </summary>
 133        /// <param name='credentials'>
 134        /// Required. Credentials needed for the client to connect to Azure.
 135        /// </param>
 136        /// <param name='handlers'>
 137        /// Optional. The delegating handlers to add to the http client pipeline.
 138        /// </param>
 139        /// <exception cref="System.ArgumentNullException">
 140        /// Thrown when a required parameter is null
 141        /// </exception>
 8142        public AttestationClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handl
 143        {
 8144            if (credentials == null)
 145            {
 0146                throw new System.ArgumentNullException("credentials");
 147            }
 8148            Credentials = credentials;
 8149            if (Credentials != null)
 150            {
 8151                Credentials.InitializeServiceClient(this);
 152            }
 8153        }
 154
 155        /// <summary>
 156        /// Initializes a new instance of the AttestationClient class.
 157        /// </summary>
 158        /// <param name='credentials'>
 159        /// Required. Credentials needed for the client to connect to Azure.
 160        /// </param>
 161        /// <param name='httpClient'>
 162        /// HttpClient to be used
 163        /// </param>
 164        /// <param name='disposeHttpClient'>
 165        /// True: will dispose the provided httpClient on calling AttestationClient.Dispose(). False: will not dispose p
 166        /// <exception cref="System.ArgumentNullException">
 167        /// Thrown when a required parameter is null
 168        /// </exception>
 0169        public AttestationClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : 
 170        {
 0171            if (credentials == null)
 172            {
 0173                throw new System.ArgumentNullException("credentials");
 174            }
 0175            Credentials = credentials;
 0176            if (Credentials != null)
 177            {
 0178                Credentials.InitializeServiceClient(this);
 179            }
 0180        }
 181
 182        /// <summary>
 183        /// Initializes a new instance of the AttestationClient class.
 184        /// </summary>
 185        /// <param name='credentials'>
 186        /// Required. Credentials needed for the client to connect to Azure.
 187        /// </param>
 188        /// <param name='rootHandler'>
 189        /// Optional. The http client handler used to handle http transport.
 190        /// </param>
 191        /// <param name='handlers'>
 192        /// Optional. The delegating handlers to add to the http client pipeline.
 193        /// </param>
 194        /// <exception cref="System.ArgumentNullException">
 195        /// Thrown when a required parameter is null
 196        /// </exception>
 0197        public AttestationClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingH
 198        {
 0199            if (credentials == null)
 200            {
 0201                throw new System.ArgumentNullException("credentials");
 202            }
 0203            Credentials = credentials;
 0204            if (Credentials != null)
 205            {
 0206                Credentials.InitializeServiceClient(this);
 207            }
 0208        }
 209
 210        /// <summary>
 211        /// An optional partial-method to perform custom initialization.
 212        /// </summary>
 213        partial void CustomInitialize();
 214        /// <summary>
 215        /// Initializes client properties.
 216        /// </summary>
 217        private void Initialize()
 218        {
 8219            Policy = new PolicyOperations(this);
 8220            PolicyCertificates = new PolicyCertificatesOperations(this);
 8221            SigningCertificates = new SigningCertificatesOperations(this);
 8222            MetadataConfiguration = new MetadataConfigurationOperations(this);
 8223            BaseUri = "{tenantBaseUrl}";
 8224            ApiVersion = "2018-09-01-preview";
 8225            AcceptLanguage = "en-US";
 8226            LongRunningOperationRetryTimeout = 30;
 8227            GenerateClientRequestId = true;
 8228            SerializationSettings = new JsonSerializerSettings
 8229            {
 8230                Formatting = Newtonsoft.Json.Formatting.Indented,
 8231                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 8232                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 8233                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 8234                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 8235                ContractResolver = new ReadOnlyJsonContractResolver(),
 8236                Converters = new List<JsonConverter>
 8237                    {
 8238                        new Iso8601TimeSpanConverter()
 8239                    }
 8240            };
 8241            DeserializationSettings = new JsonSerializerSettings
 8242            {
 8243                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 8244                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 8245                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 8246                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 8247                ContractResolver = new ReadOnlyJsonContractResolver(),
 8248                Converters = new List<JsonConverter>
 8249                    {
 8250                        new Iso8601TimeSpanConverter()
 8251                    }
 8252            };
 8253            CustomInitialize();
 8254            DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 8255        }
 256    }
 257}