< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.CosmosDbLinkedService
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CosmosDbLinkedService.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CosmosDbLinkedService.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_AccountEndpoint()-0%100%
get_Database()-0%100%
get_AccountKey()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeCosmosDbLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CosmosDbLinkedService.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> Microsoft Azure Cosmos Database (CosmosDB) linked service. </summary>
 13    public partial class CosmosDbLinkedService : LinkedService
 14    {
 15        /// <summary> Initializes a new instance of CosmosDbLinkedService. </summary>
 016        public CosmosDbLinkedService()
 17        {
 018            Type = "CosmosDb";
 019        }
 20
 21        /// <summary> Initializes a new instance of CosmosDbLinkedService. </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. Type: string, SecureString or AzureKeyVaultSecretRefe
 29        /// <param name="accountEndpoint"> The endpoint of the Azure CosmosDB account. Type: string (or Expression with 
 30        /// <param name="database"> The name of the database. Type: string (or Expression with resultType string). </par
 31        /// <param name="accountKey"> The account key of the Azure CosmosDB account. Type: SecureString or AzureKeyVault
 32        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 033        internal CosmosDbLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDiction
 34        {
 035            ConnectionString = connectionString;
 036            AccountEndpoint = accountEndpoint;
 037            Database = database;
 038            AccountKey = accountKey;
 039            EncryptedCredential = encryptedCredential;
 040            Type = type ?? "CosmosDb";
 041        }
 42
 43        /// <summary> The connection string. Type: string, SecureString or AzureKeyVaultSecretReference. </summary>
 044        public object ConnectionString { get; set; }
 45        /// <summary> The endpoint of the Azure CosmosDB account. Type: string (or Expression with resultType string). <
 046        public object AccountEndpoint { get; set; }
 47        /// <summary> The name of the database. Type: string (or Expression with resultType string). </summary>
 048        public object Database { get; set; }
 49        /// <summary> The account key of the Azure CosmosDB account. Type: SecureString or AzureKeyVaultSecretReference.
 050        public SecretBase AccountKey { get; set; }
 51        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 052        public object EncryptedCredential { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\CosmosDbLinkedService.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 CosmosDbLinkedService : 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(AccountEndpoint))
 60            {
 061                writer.WritePropertyName("accountEndpoint");
 062                writer.WriteObjectValue(AccountEndpoint);
 63            }
 064            if (Optional.IsDefined(Database))
 65            {
 066                writer.WritePropertyName("database");
 067                writer.WriteObjectValue(Database);
 68            }
 069            if (Optional.IsDefined(AccountKey))
 70            {
 071                writer.WritePropertyName("accountKey");
 072                writer.WriteObjectValue(AccountKey);
 73            }
 074            if (Optional.IsDefined(EncryptedCredential))
 75            {
 076                writer.WritePropertyName("encryptedCredential");
 077                writer.WriteObjectValue(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 CosmosDbLinkedService DeserializeCosmosDbLinkedService(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<object> accountEndpoint = default;
 097            Optional<object> database = default;
 098            Optional<SecretBase> accountKey = default;
 099            Optional<object> 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("accountEndpoint"))
 149                        {
 0150                            accountEndpoint = property0.Value.GetObject();
 0151                            continue;
 152                        }
 0153                        if (property0.NameEquals("database"))
 154                        {
 0155                            database = property0.Value.GetObject();
 0156                            continue;
 157                        }
 0158                        if (property0.NameEquals("accountKey"))
 159                        {
 0160                            accountKey = SecretBase.DeserializeSecretBase(property0.Value);
 0161                            continue;
 162                        }
 0163                        if (property0.NameEquals("encryptedCredential"))
 164                        {
 0165                            encryptedCredential = property0.Value.GetObject();
 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 CosmosDbLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters
 176        }
 177    }
 178}