< Summary

Class:Azure.Search.Documents.Indexes.Models.DefaultCognitiveServicesAccount
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DefaultCognitiveServicesAccount.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DefaultCognitiveServicesAccount.Serialization.cs
Covered lines:21
Uncovered lines:2
Coverable lines:23
Total lines:75
Line coverage:91.3% (21 of 23)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%50%
Azure.Core.IUtf8JsonSerializable.Write(...)-75%50%
DeserializeDefaultCognitiveServicesAccount(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DefaultCognitiveServicesAccount.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.Search.Documents.Indexes.Models
 9{
 10    /// <summary> An empty object that represents the default cognitive service resource for a skillset. </summary>
 11    public partial class DefaultCognitiveServicesAccount : CognitiveServicesAccount
 12    {
 13        /// <summary> Initializes a new instance of DefaultCognitiveServicesAccount. </summary>
 214        public DefaultCognitiveServicesAccount()
 15        {
 216            ODataType = "#Microsoft.Azure.Search.DefaultCognitiveServices";
 217        }
 18
 19        /// <summary> Initializes a new instance of DefaultCognitiveServicesAccount. </summary>
 20        /// <param name="oDataType"> Identifies the concrete type of the cognitive service resource attached to a skills
 21        /// <param name="description"> Description of the cognitive service resource attached to a skillset. </param>
 622        internal DefaultCognitiveServicesAccount(string oDataType, string description) : base(oDataType, description)
 23        {
 624            ODataType = oDataType ?? "#Microsoft.Azure.Search.DefaultCognitiveServices";
 625        }
 26    }
 27}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\DefaultCognitiveServicesAccount.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class DefaultCognitiveServicesAccount : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 417            writer.WriteStartObject();
 418            writer.WritePropertyName("@odata.type");
 419            writer.WriteStringValue(ODataType);
 420            if (Optional.IsDefined(Description))
 21            {
 022                writer.WritePropertyName("description");
 023                writer.WriteStringValue(Description);
 24            }
 425            writer.WriteEndObject();
 426        }
 27
 28        internal static DefaultCognitiveServicesAccount DeserializeDefaultCognitiveServicesAccount(JsonElement element)
 29        {
 630            string odataType = default;
 631            Optional<string> description = default;
 3632            foreach (var property in element.EnumerateObject())
 33            {
 1234                if (property.NameEquals("@odata.type"))
 35                {
 636                    odataType = property.Value.GetString();
 637                    continue;
 38                }
 639                if (property.NameEquals("description"))
 40                {
 641                    description = property.Value.GetString();
 42                    continue;
 43                }
 44            }
 645            return new DefaultCognitiveServicesAccount(odataType, description.Value);
 46        }
 47    }
 48}