< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%0%
get_ConnectionString()-0%100%
get_AccountKey()-0%100%
get_SasUri()-0%100%
get_SasToken()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureStorageLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureStorageLinkedService.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.Collections.Generic;
 9
 10namespace Azure.Analytics.Synapse.Artifacts.Models
 11{
 12    /// <summary> The storage account linked service. </summary>
 13    public partial class AzureStorageLinkedService : LinkedService
 14    {
 15        /// <summary> Initializes a new instance of AzureStorageLinkedService. </summary>
 016        public AzureStorageLinkedService()
 17        {
 018            Type = "AzureStorage";
 019        }
 20
 21        /// <summary> Initializes a new instance of AzureStorageLinkedService. </summary>
 22        /// <param name="type"> Type of linked service. </param>
 23        /// <param name="connectVia"> The integration runtime reference. </param>
 24        /// <param name="description"> Linked service description. </param>
 25        /// <param name="parameters"> Parameters for linked service. </param>
 26        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 27        /// <param name="additionalProperties"> . </param>
 28        /// <param name="connectionString"> The connection string. It is mutually exclusive with sasUri property. Type: 
 29        /// <param name="accountKey"> The Azure key vault secret reference of accountKey in connection string. </param>
 30        /// <param name="sasUri"> SAS URI of the Azure Storage resource. It is mutually exclusive with connectionString 
 31        /// <param name="sasToken"> The Azure key vault secret reference of sasToken in sas uri. </param>
 32        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 033        internal AzureStorageLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDic
 34        {
 035            ConnectionString = connectionString;
 036            AccountKey = accountKey;
 037            SasUri = sasUri;
 038            SasToken = sasToken;
 039            EncryptedCredential = encryptedCredential;
 040            Type = type ?? "AzureStorage";
 041        }
 42
 43        /// <summary> The connection string. It is mutually exclusive with sasUri property. Type: string, SecureString o
 044        public object ConnectionString { get; set; }
 45        /// <summary> The Azure key vault secret reference of accountKey in connection string. </summary>
 046        public AzureKeyVaultSecretReference AccountKey { get; set; }
 47        /// <summary> SAS URI of the Azure Storage resource. It is mutually exclusive with connectionString property. Ty
 048        public object SasUri { get; set; }
 49        /// <summary> The Azure key vault secret reference of sasToken in sas uri. </summary>
 050        public AzureKeyVaultSecretReference SasToken { get; set; }
 51        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 052        public string EncryptedCredential { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureStorageLinkedService.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    public partial class AzureStorageLinkedService : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("type");
 020            writer.WriteStringValue(Type);
 021            if (Optional.IsDefined(ConnectVia))
 22            {
 023                writer.WritePropertyName("connectVia");
 024                writer.WriteObjectValue(ConnectVia);
 25            }
 026            if (Optional.IsDefined(Description))
 27            {
 028                writer.WritePropertyName("description");
 029                writer.WriteStringValue(Description);
 30            }
 031            if (Optional.IsCollectionDefined(Parameters))
 32            {
 033                writer.WritePropertyName("parameters");
 034                writer.WriteStartObject();
 035                foreach (var item in Parameters)
 36                {
 037                    writer.WritePropertyName(item.Key);
 038                    writer.WriteObjectValue(item.Value);
 39                }
 040                writer.WriteEndObject();
 41            }
 042            if (Optional.IsCollectionDefined(Annotations))
 43            {
 044                writer.WritePropertyName("annotations");
 045                writer.WriteStartArray();
 046                foreach (var item in Annotations)
 47                {
 048                    writer.WriteObjectValue(item);
 49                }
 050                writer.WriteEndArray();
 51            }
 052            writer.WritePropertyName("typeProperties");
 053            writer.WriteStartObject();
 054            if (Optional.IsDefined(ConnectionString))
 55            {
 056                writer.WritePropertyName("connectionString");
 057                writer.WriteObjectValue(ConnectionString);
 58            }
 059            if (Optional.IsDefined(AccountKey))
 60            {
 061                writer.WritePropertyName("accountKey");
 062                writer.WriteObjectValue(AccountKey);
 63            }
 064            if (Optional.IsDefined(SasUri))
 65            {
 066                writer.WritePropertyName("sasUri");
 067                writer.WriteObjectValue(SasUri);
 68            }
 069            if (Optional.IsDefined(SasToken))
 70            {
 071                writer.WritePropertyName("sasToken");
 072                writer.WriteObjectValue(SasToken);
 73            }
 074            if (Optional.IsDefined(EncryptedCredential))
 75            {
 076                writer.WritePropertyName("encryptedCredential");
 077                writer.WriteStringValue(EncryptedCredential);
 78            }
 079            writer.WriteEndObject();
 080            foreach (var item in AdditionalProperties)
 81            {
 082                writer.WritePropertyName(item.Key);
 083                writer.WriteObjectValue(item.Value);
 84            }
 085            writer.WriteEndObject();
 086        }
 87
 88        internal static AzureStorageLinkedService DeserializeAzureStorageLinkedService(JsonElement element)
 89        {
 090            string type = default;
 091            Optional<IntegrationRuntimeReference> connectVia = default;
 092            Optional<string> description = default;
 093            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 094            Optional<IList<object>> annotations = default;
 095            Optional<object> connectionString = default;
 096            Optional<AzureKeyVaultSecretReference> accountKey = default;
 097            Optional<object> sasUri = default;
 098            Optional<AzureKeyVaultSecretReference> sasToken = default;
 099            Optional<string> encryptedCredential = default;
 0100            IDictionary<string, object> additionalProperties = default;
 0101            Dictionary<string, object> additionalPropertiesDictionary = default;
 0102            foreach (var property in element.EnumerateObject())
 103            {
 0104                if (property.NameEquals("type"))
 105                {
 0106                    type = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("connectVia"))
 110                {
 0111                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0112                    continue;
 113                }
 0114                if (property.NameEquals("description"))
 115                {
 0116                    description = property.Value.GetString();
 0117                    continue;
 118                }
 0119                if (property.NameEquals("parameters"))
 120                {
 0121                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0122                    foreach (var property0 in property.Value.EnumerateObject())
 123                    {
 0124                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 125                    }
 0126                    parameters = dictionary;
 0127                    continue;
 128                }
 0129                if (property.NameEquals("annotations"))
 130                {
 0131                    List<object> array = new List<object>();
 0132                    foreach (var item in property.Value.EnumerateArray())
 133                    {
 0134                        array.Add(item.GetObject());
 135                    }
 0136                    annotations = array;
 0137                    continue;
 138                }
 0139                if (property.NameEquals("typeProperties"))
 140                {
 0141                    foreach (var property0 in property.Value.EnumerateObject())
 142                    {
 0143                        if (property0.NameEquals("connectionString"))
 144                        {
 0145                            connectionString = property0.Value.GetObject();
 0146                            continue;
 147                        }
 0148                        if (property0.NameEquals("accountKey"))
 149                        {
 0150                            accountKey = AzureKeyVaultSecretReference.DeserializeAzureKeyVaultSecretReference(property0.
 0151                            continue;
 152                        }
 0153                        if (property0.NameEquals("sasUri"))
 154                        {
 0155                            sasUri = property0.Value.GetObject();
 0156                            continue;
 157                        }
 0158                        if (property0.NameEquals("sasToken"))
 159                        {
 0160                            sasToken = AzureKeyVaultSecretReference.DeserializeAzureKeyVaultSecretReference(property0.Va
 0161                            continue;
 162                        }
 0163                        if (property0.NameEquals("encryptedCredential"))
 164                        {
 0165                            encryptedCredential = property0.Value.GetString();
 166                            continue;
 167                        }
 168                    }
 169                    continue;
 170                }
 0171                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0172                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 173            }
 0174            additionalProperties = additionalPropertiesDictionary;
 0175            return new AzureStorageLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parame
 176        }
 177    }
 178}