< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Server()-0%100%
get_AuthenticationType()-0%100%
get_DatabaseName()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_AuthSource()-0%100%
get_Port()-0%100%
get_EnableSsl()-0%100%
get_AllowSelfSignedServerCert()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMongoDbLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\MongoDbLinkedService.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 MongoDb data source. </summary>
 14    public partial class MongoDbLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of MongoDbLinkedService. </summary>
 17        /// <param name="server"> The IP address or server name of the MongoDB server. Type: string (or Expression with 
 18        /// <param name="databaseName"> The name of the MongoDB database that you want to access. Type: string (or Expre
 19        /// <exception cref="ArgumentNullException"> <paramref name="server"/> or <paramref name="databaseName"/> is nul
 020        public MongoDbLinkedService(object server, object databaseName)
 21        {
 022            if (server == null)
 23            {
 024                throw new ArgumentNullException(nameof(server));
 25            }
 026            if (databaseName == null)
 27            {
 028                throw new ArgumentNullException(nameof(databaseName));
 29            }
 30
 031            Server = server;
 032            DatabaseName = databaseName;
 033            Type = "MongoDb";
 034        }
 35
 36        /// <summary> Initializes a new instance of MongoDbLinkedService. </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"> The IP address or server name of the MongoDB server. Type: string (or Expression with 
 44        /// <param name="authenticationType"> The authentication type to be used to connect to the MongoDB database. </p
 45        /// <param name="databaseName"> The name of the MongoDB database that you want to access. Type: string (or Expre
 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="authSource"> Database to verify the username and password. Type: string (or Expression with res
 49        /// <param name="port"> The TCP port number that the MongoDB server uses to listen for client connections. The d
 50        /// <param name="enableSsl"> Specifies whether the connections to the server are encrypted using SSL. The defaul
 51        /// <param name="allowSelfSignedServerCert"> Specifies whether to allow self-signed certificates from the server
 52        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 053        internal MongoDbLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictiona
 54        {
 055            Server = server;
 056            AuthenticationType = authenticationType;
 057            DatabaseName = databaseName;
 058            Username = username;
 059            Password = password;
 060            AuthSource = authSource;
 061            Port = port;
 062            EnableSsl = enableSsl;
 063            AllowSelfSignedServerCert = allowSelfSignedServerCert;
 064            EncryptedCredential = encryptedCredential;
 065            Type = type ?? "MongoDb";
 066        }
 67
 68        /// <summary> The IP address or server name of the MongoDB server. Type: string (or Expression with resultType s
 069        public object Server { get; set; }
 70        /// <summary> The authentication type to be used to connect to the MongoDB database. </summary>
 071        public MongoDbAuthenticationType? AuthenticationType { get; set; }
 72        /// <summary> The name of the MongoDB database that you want to access. Type: string (or Expression with resultT
 073        public object DatabaseName { get; set; }
 74        /// <summary> Username for authentication. Type: string (or Expression with resultType string). </summary>
 075        public object Username { get; set; }
 76        /// <summary> Password for authentication. </summary>
 077        public SecretBase Password { get; set; }
 78        /// <summary> Database to verify the username and password. Type: string (or Expression with resultType string).
 079        public object AuthSource { get; set; }
 80        /// <summary> The TCP port number that the MongoDB server uses to listen for client connections. The default val
 081        public object Port { get; set; }
 82        /// <summary> Specifies whether the connections to the server are encrypted using SSL. The default value is fals
 083        public object EnableSsl { get; set; }
 84        /// <summary> Specifies whether to allow self-signed certificates from the server. The default value is false. T
 085        public object AllowSelfSignedServerCert { get; set; }
 86        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 087        public object EncryptedCredential { get; set; }
 88    }
 89}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\MongoDbLinkedService.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 MongoDbLinkedService : 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            if (Optional.IsDefined(AuthenticationType))
 57            {
 058                writer.WritePropertyName("authenticationType");
 059                writer.WriteStringValue(AuthenticationType.Value.ToString());
 60            }
 061            writer.WritePropertyName("databaseName");
 062            writer.WriteObjectValue(DatabaseName);
 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(AuthSource))
 74            {
 075                writer.WritePropertyName("authSource");
 076                writer.WriteObjectValue(AuthSource);
 77            }
 078            if (Optional.IsDefined(Port))
 79            {
 080                writer.WritePropertyName("port");
 081                writer.WriteObjectValue(Port);
 82            }
 083            if (Optional.IsDefined(EnableSsl))
 84            {
 085                writer.WritePropertyName("enableSsl");
 086                writer.WriteObjectValue(EnableSsl);
 87            }
 088            if (Optional.IsDefined(AllowSelfSignedServerCert))
 89            {
 090                writer.WritePropertyName("allowSelfSignedServerCert");
 091                writer.WriteObjectValue(AllowSelfSignedServerCert);
 92            }
 093            if (Optional.IsDefined(EncryptedCredential))
 94            {
 095                writer.WritePropertyName("encryptedCredential");
 096                writer.WriteObjectValue(EncryptedCredential);
 97            }
 098            writer.WriteEndObject();
 099            foreach (var item in AdditionalProperties)
 100            {
 0101                writer.WritePropertyName(item.Key);
 0102                writer.WriteObjectValue(item.Value);
 103            }
 0104            writer.WriteEndObject();
 0105        }
 106
 107        internal static MongoDbLinkedService DeserializeMongoDbLinkedService(JsonElement element)
 108        {
 0109            string type = default;
 0110            Optional<IntegrationRuntimeReference> connectVia = default;
 0111            Optional<string> description = default;
 0112            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0113            Optional<IList<object>> annotations = default;
 0114            object server = default;
 0115            Optional<MongoDbAuthenticationType> authenticationType = default;
 0116            object databaseName = default;
 0117            Optional<object> username = default;
 0118            Optional<SecretBase> password = default;
 0119            Optional<object> authSource = default;
 0120            Optional<object> port = default;
 0121            Optional<object> enableSsl = default;
 0122            Optional<object> allowSelfSignedServerCert = default;
 0123            Optional<object> encryptedCredential = default;
 0124            IDictionary<string, object> additionalProperties = default;
 0125            Dictionary<string, object> additionalPropertiesDictionary = default;
 0126            foreach (var property in element.EnumerateObject())
 127            {
 0128                if (property.NameEquals("type"))
 129                {
 0130                    type = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("connectVia"))
 134                {
 0135                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0136                    continue;
 137                }
 0138                if (property.NameEquals("description"))
 139                {
 0140                    description = property.Value.GetString();
 0141                    continue;
 142                }
 0143                if (property.NameEquals("parameters"))
 144                {
 0145                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0146                    foreach (var property0 in property.Value.EnumerateObject())
 147                    {
 0148                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 149                    }
 0150                    parameters = dictionary;
 0151                    continue;
 152                }
 0153                if (property.NameEquals("annotations"))
 154                {
 0155                    List<object> array = new List<object>();
 0156                    foreach (var item in property.Value.EnumerateArray())
 157                    {
 0158                        array.Add(item.GetObject());
 159                    }
 0160                    annotations = array;
 0161                    continue;
 162                }
 0163                if (property.NameEquals("typeProperties"))
 164                {
 0165                    foreach (var property0 in property.Value.EnumerateObject())
 166                    {
 0167                        if (property0.NameEquals("server"))
 168                        {
 0169                            server = property0.Value.GetObject();
 0170                            continue;
 171                        }
 0172                        if (property0.NameEquals("authenticationType"))
 173                        {
 0174                            authenticationType = new MongoDbAuthenticationType(property0.Value.GetString());
 0175                            continue;
 176                        }
 0177                        if (property0.NameEquals("databaseName"))
 178                        {
 0179                            databaseName = property0.Value.GetObject();
 0180                            continue;
 181                        }
 0182                        if (property0.NameEquals("username"))
 183                        {
 0184                            username = property0.Value.GetObject();
 0185                            continue;
 186                        }
 0187                        if (property0.NameEquals("password"))
 188                        {
 0189                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0190                            continue;
 191                        }
 0192                        if (property0.NameEquals("authSource"))
 193                        {
 0194                            authSource = property0.Value.GetObject();
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("port"))
 198                        {
 0199                            port = property0.Value.GetObject();
 0200                            continue;
 201                        }
 0202                        if (property0.NameEquals("enableSsl"))
 203                        {
 0204                            enableSsl = property0.Value.GetObject();
 0205                            continue;
 206                        }
 0207                        if (property0.NameEquals("allowSelfSignedServerCert"))
 208                        {
 0209                            allowSelfSignedServerCert = property0.Value.GetObject();
 0210                            continue;
 211                        }
 0212                        if (property0.NameEquals("encryptedCredential"))
 213                        {
 0214                            encryptedCredential = property0.Value.GetObject();
 215                            continue;
 216                        }
 217                    }
 218                    continue;
 219                }
 0220                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0221                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 222            }
 0223            additionalProperties = additionalPropertiesDictionary;
 0224            return new MongoDbLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters)
 225        }
 226    }
 227}