< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Store()-0%100%
get_SecretName()-0%100%
get_SecretVersion()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureKeyVaultSecretReference(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureKeyVaultSecretReference.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;
 9
 10namespace Azure.Analytics.Synapse.Artifacts.Models
 11{
 12    /// <summary> Azure Key Vault secret reference. </summary>
 13    public partial class AzureKeyVaultSecretReference : SecretBase
 14    {
 15        /// <summary> Initializes a new instance of AzureKeyVaultSecretReference. </summary>
 16        /// <param name="store"> The Azure Key Vault linked service reference. </param>
 17        /// <param name="secretName"> The name of the secret in Azure Key Vault. Type: string (or Expression with result
 18        /// <exception cref="ArgumentNullException"> <paramref name="store"/> or <paramref name="secretName"/> is null. 
 019        public AzureKeyVaultSecretReference(LinkedServiceReference store, object secretName)
 20        {
 021            if (store == null)
 22            {
 023                throw new ArgumentNullException(nameof(store));
 24            }
 025            if (secretName == null)
 26            {
 027                throw new ArgumentNullException(nameof(secretName));
 28            }
 29
 030            Store = store;
 031            SecretName = secretName;
 032            Type = "AzureKeyVaultSecret";
 033        }
 34
 35        /// <summary> Initializes a new instance of AzureKeyVaultSecretReference. </summary>
 36        /// <param name="type"> Type of the secret. </param>
 37        /// <param name="store"> The Azure Key Vault linked service reference. </param>
 38        /// <param name="secretName"> The name of the secret in Azure Key Vault. Type: string (or Expression with result
 39        /// <param name="secretVersion"> The version of the secret in Azure Key Vault. The default value is the latest v
 040        internal AzureKeyVaultSecretReference(string type, LinkedServiceReference store, object secretName, object secre
 41        {
 042            Store = store;
 043            SecretName = secretName;
 044            SecretVersion = secretVersion;
 045            Type = type ?? "AzureKeyVaultSecret";
 046        }
 47
 48        /// <summary> The Azure Key Vault linked service reference. </summary>
 049        public LinkedServiceReference Store { get; set; }
 50        /// <summary> The name of the secret in Azure Key Vault. Type: string (or Expression with resultType string). </
 051        public object SecretName { get; set; }
 52        /// <summary> The version of the secret in Azure Key Vault. The default value is the latest version of the secre
 053        public object SecretVersion { get; set; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureKeyVaultSecretReference.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 AzureKeyVaultSecretReference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("store");
 019            writer.WriteObjectValue(Store);
 020            writer.WritePropertyName("secretName");
 021            writer.WriteObjectValue(SecretName);
 022            if (Optional.IsDefined(SecretVersion))
 23            {
 024                writer.WritePropertyName("secretVersion");
 025                writer.WriteObjectValue(SecretVersion);
 26            }
 027            writer.WritePropertyName("type");
 028            writer.WriteStringValue(Type);
 029            writer.WriteEndObject();
 030        }
 31
 32        internal static AzureKeyVaultSecretReference DeserializeAzureKeyVaultSecretReference(JsonElement element)
 33        {
 034            LinkedServiceReference store = default;
 035            object secretName = default;
 036            Optional<object> secretVersion = default;
 037            string type = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("store"))
 41                {
 042                    store = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
 043                    continue;
 44                }
 045                if (property.NameEquals("secretName"))
 46                {
 047                    secretName = property.Value.GetObject();
 048                    continue;
 49                }
 050                if (property.NameEquals("secretVersion"))
 51                {
 052                    secretVersion = property.Value.GetObject();
 053                    continue;
 54                }
 055                if (property.NameEquals("type"))
 56                {
 057                    type = property.Value.GetString();
 58                    continue;
 59                }
 60            }
 061            return new AzureKeyVaultSecretReference(type, store, secretName, secretVersion.Value);
 62        }
 63    }
 64}