< Summary

Class:Microsoft.Azure.Search.Models.CognitiveServicesByKey
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\CognitiveServicesByKey.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:66
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:2
Branch coverage:0% (0 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Key()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\Models\CognitiveServicesByKey.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.Search.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// A cognitive service resource provisioned with a key that is attached to
 19    /// a skillset.
 20    /// </summary>
 21    [Newtonsoft.Json.JsonObject("#Microsoft.Azure.Search.CognitiveServicesByKey")]
 22    public partial class CognitiveServicesByKey : CognitiveServices
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the CognitiveServicesByKey class.
 26        /// </summary>
 027        public CognitiveServicesByKey()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the CognitiveServicesByKey class.
 34        /// </summary>
 35        public CognitiveServicesByKey(string key, string description = default(string))
 036            : base(description)
 37        {
 038            Key = key;
 39            CustomInit();
 040        }
 41
 42        /// <summary>
 43        /// An initialization method that performs custom operations like setting defaults
 44        /// </summary>
 45        partial void CustomInit();
 46
 47        /// <summary>
 48        /// </summary>
 49        [JsonProperty(PropertyName = "key")]
 050        public string Key { get; set; }
 51
 52        /// <summary>
 53        /// Validate the object.
 54        /// </summary>
 55        /// <exception cref="ValidationException">
 56        /// Thrown if validation fails
 57        /// </exception>
 58        public virtual void Validate()
 59        {
 060            if (Key == null)
 61            {
 062                throw new ValidationException(ValidationRules.CannotBeNull, "Key");
 63            }
 064        }
 65    }
 66}

Methods/Properties

.ctor()
.ctor(...)
get_Key()
Validate()