< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Server()-0%100%
get_Database()-0%100%
get_AuthenticationType()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_PackageCollection()-0%100%
get_CertificateCommonName()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDb2LinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Db2LinkedService.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    /// <summary> Linked service for DB2 data source. </summary>
 14    public partial class Db2LinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of Db2LinkedService. </summary>
 17        /// <param name="server"> Server name for connection. Type: string (or Expression with resultType string). </par
 18        /// <param name="database"> Database name for connection. Type: string (or Expression with resultType string). <
 19        /// <exception cref="ArgumentNullException"> <paramref name="server"/> or <paramref name="database"/> is null. <
 020        public Db2LinkedService(object server, object database)
 21        {
 022            if (server == null)
 23            {
 024                throw new ArgumentNullException(nameof(server));
 25            }
 026            if (database == null)
 27            {
 028                throw new ArgumentNullException(nameof(database));
 29            }
 30
 031            Server = server;
 032            Database = database;
 033            Type = "Db2";
 034        }
 35
 36        /// <summary> Initializes a new instance of Db2LinkedService. </summary>
 37        /// <param name="type"> Type of linked service. </param>
 38        /// <param name="connectVia"> The integration runtime reference. </param>
 39        /// <param name="description"> Linked service description. </param>
 40        /// <param name="parameters"> Parameters for linked service. </param>
 41        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 42        /// <param name="additionalProperties"> . </param>
 43        /// <param name="server"> Server name for connection. Type: string (or Expression with resultType string). </par
 44        /// <param name="database"> Database name for connection. Type: string (or Expression with resultType string). <
 45        /// <param name="authenticationType"> AuthenticationType to be used for connection. </param>
 46        /// <param name="username"> Username for authentication. Type: string (or Expression with resultType string). </
 47        /// <param name="password"> Password for authentication. </param>
 48        /// <param name="packageCollection"> Under where packages are created when querying database. Type: string (or E
 49        /// <param name="certificateCommonName"> Certificate Common Name when TLS is enabled. Type: string (or Expressio
 50        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 051        internal Db2LinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictionary<s
 52        {
 053            Server = server;
 054            Database = database;
 055            AuthenticationType = authenticationType;
 056            Username = username;
 057            Password = password;
 058            PackageCollection = packageCollection;
 059            CertificateCommonName = certificateCommonName;
 060            EncryptedCredential = encryptedCredential;
 061            Type = type ?? "Db2";
 062        }
 63
 64        /// <summary> Server name for connection. Type: string (or Expression with resultType string). </summary>
 065        public object Server { get; set; }
 66        /// <summary> Database name for connection. Type: string (or Expression with resultType string). </summary>
 067        public object Database { get; set; }
 68        /// <summary> AuthenticationType to be used for connection. </summary>
 069        public Db2AuthenticationType? AuthenticationType { get; set; }
 70        /// <summary> Username for authentication. Type: string (or Expression with resultType string). </summary>
 071        public object Username { get; set; }
 72        /// <summary> Password for authentication. </summary>
 073        public SecretBase Password { get; set; }
 74        /// <summary> Under where packages are created when querying database. Type: string (or Expression with resultTy
 075        public object PackageCollection { get; set; }
 76        /// <summary> Certificate Common Name when TLS is enabled. Type: string (or Expression with resultType string). 
 077        public object CertificateCommonName { get; set; }
 78        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 079        public object EncryptedCredential { get; set; }
 80    }
 81}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\Db2LinkedService.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 Db2LinkedService : 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            writer.WritePropertyName("server");
 055            writer.WriteObjectValue(Server);
 056            writer.WritePropertyName("database");
 057            writer.WriteObjectValue(Database);
 058            if (Optional.IsDefined(AuthenticationType))
 59            {
 060                writer.WritePropertyName("authenticationType");
 061                writer.WriteStringValue(AuthenticationType.Value.ToString());
 62            }
 063            if (Optional.IsDefined(Username))
 64            {
 065                writer.WritePropertyName("username");
 066                writer.WriteObjectValue(Username);
 67            }
 068            if (Optional.IsDefined(Password))
 69            {
 070                writer.WritePropertyName("password");
 071                writer.WriteObjectValue(Password);
 72            }
 073            if (Optional.IsDefined(PackageCollection))
 74            {
 075                writer.WritePropertyName("packageCollection");
 076                writer.WriteObjectValue(PackageCollection);
 77            }
 078            if (Optional.IsDefined(CertificateCommonName))
 79            {
 080                writer.WritePropertyName("certificateCommonName");
 081                writer.WriteObjectValue(CertificateCommonName);
 82            }
 083            if (Optional.IsDefined(EncryptedCredential))
 84            {
 085                writer.WritePropertyName("encryptedCredential");
 086                writer.WriteObjectValue(EncryptedCredential);
 87            }
 088            writer.WriteEndObject();
 089            foreach (var item in AdditionalProperties)
 90            {
 091                writer.WritePropertyName(item.Key);
 092                writer.WriteObjectValue(item.Value);
 93            }
 094            writer.WriteEndObject();
 095        }
 96
 97        internal static Db2LinkedService DeserializeDb2LinkedService(JsonElement element)
 98        {
 099            string type = default;
 0100            Optional<IntegrationRuntimeReference> connectVia = default;
 0101            Optional<string> description = default;
 0102            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0103            Optional<IList<object>> annotations = default;
 0104            object server = default;
 0105            object database = default;
 0106            Optional<Db2AuthenticationType> authenticationType = default;
 0107            Optional<object> username = default;
 0108            Optional<SecretBase> password = default;
 0109            Optional<object> packageCollection = default;
 0110            Optional<object> certificateCommonName = default;
 0111            Optional<object> encryptedCredential = default;
 0112            IDictionary<string, object> additionalProperties = default;
 0113            Dictionary<string, object> additionalPropertiesDictionary = default;
 0114            foreach (var property in element.EnumerateObject())
 115            {
 0116                if (property.NameEquals("type"))
 117                {
 0118                    type = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("connectVia"))
 122                {
 0123                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0124                    continue;
 125                }
 0126                if (property.NameEquals("description"))
 127                {
 0128                    description = property.Value.GetString();
 0129                    continue;
 130                }
 0131                if (property.NameEquals("parameters"))
 132                {
 0133                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0134                    foreach (var property0 in property.Value.EnumerateObject())
 135                    {
 0136                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 137                    }
 0138                    parameters = dictionary;
 0139                    continue;
 140                }
 0141                if (property.NameEquals("annotations"))
 142                {
 0143                    List<object> array = new List<object>();
 0144                    foreach (var item in property.Value.EnumerateArray())
 145                    {
 0146                        array.Add(item.GetObject());
 147                    }
 0148                    annotations = array;
 0149                    continue;
 150                }
 0151                if (property.NameEquals("typeProperties"))
 152                {
 0153                    foreach (var property0 in property.Value.EnumerateObject())
 154                    {
 0155                        if (property0.NameEquals("server"))
 156                        {
 0157                            server = property0.Value.GetObject();
 0158                            continue;
 159                        }
 0160                        if (property0.NameEquals("database"))
 161                        {
 0162                            database = property0.Value.GetObject();
 0163                            continue;
 164                        }
 0165                        if (property0.NameEquals("authenticationType"))
 166                        {
 0167                            authenticationType = new Db2AuthenticationType(property0.Value.GetString());
 0168                            continue;
 169                        }
 0170                        if (property0.NameEquals("username"))
 171                        {
 0172                            username = property0.Value.GetObject();
 0173                            continue;
 174                        }
 0175                        if (property0.NameEquals("password"))
 176                        {
 0177                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0178                            continue;
 179                        }
 0180                        if (property0.NameEquals("packageCollection"))
 181                        {
 0182                            packageCollection = property0.Value.GetObject();
 0183                            continue;
 184                        }
 0185                        if (property0.NameEquals("certificateCommonName"))
 186                        {
 0187                            certificateCommonName = property0.Value.GetObject();
 0188                            continue;
 189                        }
 0190                        if (property0.NameEquals("encryptedCredential"))
 191                        {
 0192                            encryptedCredential = property0.Value.GetObject();
 193                            continue;
 194                        }
 195                    }
 196                    continue;
 197                }
 0198                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0199                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 200            }
 0201            additionalProperties = additionalPropertiesDictionary;
 0202            return new Db2LinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), Op
 203        }
 204    }
 205}