< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.Face.FaceClient
Assembly:Microsoft.Azure.CognitiveServices.Vision.Face
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.Face\src\Generated\FaceClient.cs
Covered lines:57
Uncovered lines:21
Coverable lines:78
Total lines:257
Line coverage:73% (57 of 78)
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_Face()-100%100%
get_PersonGroupPerson()-100%100%
get_PersonGroup()-100%100%
get_FaceList()-100%100%
get_LargePersonGroupPerson()-100%100%
get_LargePersonGroup()-100%100%
get_LargeFaceList()-100%100%
get_Snapshot()-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\Vision.Face\src\Generated\FaceClient.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.Vision.Face
 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 face detection, verification, and identification.
 24    /// </summary>
 25    public partial class FaceClient : ServiceClient<FaceClient>, IFaceClient
 26    {
 27        /// <summary>
 28        /// The base URI of the service.
 29        /// </summary>
 39430        internal string BaseUri {get; set;}
 31
 32        /// <summary>
 33        /// Gets or sets json serialization settings.
 34        /// </summary>
 49035        public JsonSerializerSettings SerializationSettings { get; private set; }
 36
 37        /// <summary>
 38        /// Gets or sets json deserialization settings.
 39        /// </summary>
 31840        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>
 75446        public string Endpoint { get; set; }
 47
 48        /// <summary>
 49        /// Subscription credentials which uniquely identify client subscription.
 50        /// </summary>
 82251        public ServiceClientCredentials Credentials { get; private set; }
 52
 53        /// <summary>
 54        /// Gets the IFaceOperations.
 55        /// </summary>
 14656        public virtual IFaceOperations Face { get; private set; }
 57
 58        /// <summary>
 59        /// Gets the IPersonGroupPerson.
 60        /// </summary>
 6661        public virtual IPersonGroupPerson PersonGroupPerson { get; private set; }
 62
 63        /// <summary>
 64        /// Gets the IPersonGroupOperations.
 65        /// </summary>
 6466        public virtual IPersonGroupOperations PersonGroup { get; private set; }
 67
 68        /// <summary>
 69        /// Gets the IFaceListOperations.
 70        /// </summary>
 6071        public virtual IFaceListOperations FaceList { get; private set; }
 72
 73        /// <summary>
 74        /// Gets the ILargePersonGroupPerson.
 75        /// </summary>
 6676        public virtual ILargePersonGroupPerson LargePersonGroupPerson { get; private set; }
 77
 78        /// <summary>
 79        /// Gets the ILargePersonGroupOperations.
 80        /// </summary>
 6681        public virtual ILargePersonGroupOperations LargePersonGroup { get; private set; }
 82
 83        /// <summary>
 84        /// Gets the ILargeFaceListOperations.
 85        /// </summary>
 7486        public virtual ILargeFaceListOperations LargeFaceList { get; private set; }
 87
 88        /// <summary>
 89        /// Gets the ISnapshotOperations.
 90        /// </summary>
 9091        public virtual ISnapshotOperations Snapshot { get; private set; }
 92
 93        /// <summary>
 94        /// Initializes a new instance of the FaceClient class.
 95        /// </summary>
 96        /// <param name='httpClient'>
 97        /// HttpClient to be used
 98        /// </param>
 99        /// <param name='disposeHttpClient'>
 100        /// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided
 0101        protected FaceClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
 102        {
 0103            Initialize();
 0104        }
 105
 106        /// <summary>
 107        /// Initializes a new instance of the FaceClient class.
 108        /// </summary>
 109        /// <param name='handlers'>
 110        /// Optional. The delegating handlers to add to the http client pipeline.
 111        /// </param>
 34112        protected FaceClient(params DelegatingHandler[] handlers) : base(handlers)
 113        {
 34114            Initialize();
 34115        }
 116
 117        /// <summary>
 118        /// Initializes a new instance of the FaceClient class.
 119        /// </summary>
 120        /// <param name='rootHandler'>
 121        /// Optional. The http client handler used to handle http transport.
 122        /// </param>
 123        /// <param name='handlers'>
 124        /// Optional. The delegating handlers to add to the http client pipeline.
 125        /// </param>
 0126        protected FaceClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, han
 127        {
 0128            Initialize();
 0129        }
 130
 131        /// <summary>
 132        /// Initializes a new instance of the FaceClient class.
 133        /// </summary>
 134        /// <param name='credentials'>
 135        /// Required. Subscription credentials which uniquely identify client subscription.
 136        /// </param>
 137        /// <param name='handlers'>
 138        /// Optional. The delegating handlers to add to the http client pipeline.
 139        /// </param>
 140        /// <exception cref="System.ArgumentNullException">
 141        /// Thrown when a required parameter is null
 142        /// </exception>
 34143        public FaceClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
 144        {
 34145            if (credentials == null)
 146            {
 0147                throw new System.ArgumentNullException("credentials");
 148            }
 34149            Credentials = credentials;
 34150            if (Credentials != null)
 151            {
 34152                Credentials.InitializeServiceClient(this);
 153            }
 34154        }
 155
 156        /// <summary>
 157        /// Initializes a new instance of the FaceClient class.
 158        /// </summary>
 159        /// <param name='credentials'>
 160        /// Required. Subscription credentials which uniquely identify client subscription.
 161        /// </param>
 162        /// <param name='httpClient'>
 163        /// HttpClient to be used
 164        /// </param>
 165        /// <param name='disposeHttpClient'>
 166        /// True: will dispose the provided httpClient on calling FaceClient.Dispose(). False: will not dispose provided
 167        /// <exception cref="System.ArgumentNullException">
 168        /// Thrown when a required parameter is null
 169        /// </exception>
 0170        public FaceClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(ht
 171        {
 0172            if (credentials == null)
 173            {
 0174                throw new System.ArgumentNullException("credentials");
 175            }
 0176            Credentials = credentials;
 0177            if (Credentials != null)
 178            {
 0179                Credentials.InitializeServiceClient(this);
 180            }
 0181        }
 182
 183        /// <summary>
 184        /// Initializes a new instance of the FaceClient class.
 185        /// </summary>
 186        /// <param name='credentials'>
 187        /// Required. Subscription credentials which uniquely identify client subscription.
 188        /// </param>
 189        /// <param name='rootHandler'>
 190        /// Optional. The http client handler used to handle http transport.
 191        /// </param>
 192        /// <param name='handlers'>
 193        /// Optional. The delegating handlers to add to the http client pipeline.
 194        /// </param>
 195        /// <exception cref="System.ArgumentNullException">
 196        /// Thrown when a required parameter is null
 197        /// </exception>
 0198        public FaceClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[
 199        {
 0200            if (credentials == null)
 201            {
 0202                throw new System.ArgumentNullException("credentials");
 203            }
 0204            Credentials = credentials;
 0205            if (Credentials != null)
 206            {
 0207                Credentials.InitializeServiceClient(this);
 208            }
 0209        }
 210
 211        /// <summary>
 212        /// An optional partial-method to perform custom initialization.
 213        ///</summary>
 214        partial void CustomInitialize();
 215        /// <summary>
 216        /// Initializes client properties.
 217        /// </summary>
 218        private void Initialize()
 219        {
 34220            Face = new FaceOperations(this);
 34221            PersonGroupPerson = new PersonGroupPerson(this);
 34222            PersonGroup = new PersonGroupOperations(this);
 34223            FaceList = new FaceListOperations(this);
 34224            LargePersonGroupPerson = new LargePersonGroupPerson(this);
 34225            LargePersonGroup = new LargePersonGroupOperations(this);
 34226            LargeFaceList = new LargeFaceListOperations(this);
 34227            Snapshot = new SnapshotOperations(this);
 34228            BaseUri = "{Endpoint}/face/v1.0";
 34229            SerializationSettings = new JsonSerializerSettings
 34230            {
 34231                Formatting = Newtonsoft.Json.Formatting.Indented,
 34232                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 34233                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 34234                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 34235                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 34236                ContractResolver = new ReadOnlyJsonContractResolver(),
 34237                Converters = new  List<JsonConverter>
 34238                    {
 34239                        new Iso8601TimeSpanConverter()
 34240                    }
 34241            };
 34242            DeserializationSettings = new JsonSerializerSettings
 34243            {
 34244                DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
 34245                DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
 34246                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
 34247                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
 34248                ContractResolver = new ReadOnlyJsonContractResolver(),
 34249                Converters = new List<JsonConverter>
 34250                    {
 34251                        new Iso8601TimeSpanConverter()
 34252                    }
 34253            };
 254            CustomInitialize();
 34255        }
 256    }
 257}