< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SecretBase
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SecretBase.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SecretBase.Serialization.cs
Covered lines:0
Uncovered lines:20
Coverable lines:20
Total lines:73
Line coverage:0% (0 of 20)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Type()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeSecretBase(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SecretBase.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.Analytics.Synapse.Artifacts.Models
 9{
 10    /// <summary> The base definition of a secret type. </summary>
 11    public partial class SecretBase
 12    {
 13        /// <summary> Initializes a new instance of SecretBase. </summary>
 014        public SecretBase()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of SecretBase. </summary>
 19        /// <param name="type"> Type of the secret. </param>
 020        internal SecretBase(string type)
 21        {
 022            Type = type;
 023        }
 24
 25        /// <summary> Type of the secret. </summary>
 026        internal string Type { get; set; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SecretBase.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.Analytics.Synapse.Artifacts.Models
 12{
 13    public partial class SecretBase : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("type");
 019            writer.WriteStringValue(Type);
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static SecretBase DeserializeSecretBase(JsonElement element)
 24        {
 025            if (element.TryGetProperty("type", out JsonElement discriminator))
 26            {
 027                switch (discriminator.GetString())
 28                {
 029                    case "AzureKeyVaultSecret": return AzureKeyVaultSecretReference.DeserializeAzureKeyVaultSecretRefere
 030                    case "SecureString": return SecureString.DeserializeSecureString(element);
 31                }
 32            }
 033            string type = default;
 034            foreach (var property in element.EnumerateObject())
 35            {
 036                if (property.NameEquals("type"))
 37                {
 038                    type = property.Value.GetString();
 39                    continue;
 40                }
 41            }
 042            return new SecretBase(type);
 43        }
 44    }
 45}