< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_ConnectionString()-0%100%
get_Database()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMongoDbV2LinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\MongoDbV2LinkedService.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 MongoDbV2LinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of MongoDbV2LinkedService. </summary>
 17        /// <param name="connectionString"> The MongoDB connection string. Type: string, SecureString or AzureKeyVaultSe
 18        /// <param name="database"> The name of the MongoDB database that you want to access. Type: string (or Expressio
 19        /// <exception cref="ArgumentNullException"> <paramref name="connectionString"/> or <paramref name="database"/> 
 020        public MongoDbV2LinkedService(object connectionString, object database)
 21        {
 022            if (connectionString == null)
 23            {
 024                throw new ArgumentNullException(nameof(connectionString));
 25            }
 026            if (database == null)
 27            {
 028                throw new ArgumentNullException(nameof(database));
 29            }
 30
 031            ConnectionString = connectionString;
 032            Database = database;
 033            Type = "MongoDbV2";
 034        }
 35
 36        /// <summary> Initializes a new instance of MongoDbV2LinkedService. </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="connectionString"> The MongoDB connection string. Type: string, SecureString or AzureKeyVaultSe
 44        /// <param name="database"> The name of the MongoDB database that you want to access. Type: string (or Expressio
 045        internal MongoDbV2LinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictio
 46        {
 047            ConnectionString = connectionString;
 048            Database = database;
 049            Type = type ?? "MongoDbV2";
 050        }
 51
 52        /// <summary> The MongoDB connection string. Type: string, SecureString or AzureKeyVaultSecretReference. Type: s
 053        public object ConnectionString { get; set; }
 54        /// <summary> The name of the MongoDB database that you want to access. Type: string (or Expression with resultT
 055        public object Database { get; set; }
 56    }
 57}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\MongoDbV2LinkedService.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 MongoDbV2LinkedService : 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("connectionString");
 055            writer.WriteObjectValue(ConnectionString);
 056            writer.WritePropertyName("database");
 057            writer.WriteObjectValue(Database);
 058            writer.WriteEndObject();
 059            foreach (var item in AdditionalProperties)
 60            {
 061                writer.WritePropertyName(item.Key);
 062                writer.WriteObjectValue(item.Value);
 63            }
 064            writer.WriteEndObject();
 065        }
 66
 67        internal static MongoDbV2LinkedService DeserializeMongoDbV2LinkedService(JsonElement element)
 68        {
 069            string type = default;
 070            Optional<IntegrationRuntimeReference> connectVia = default;
 071            Optional<string> description = default;
 072            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 073            Optional<IList<object>> annotations = default;
 074            object connectionString = default;
 075            object database = default;
 076            IDictionary<string, object> additionalProperties = default;
 077            Dictionary<string, object> additionalPropertiesDictionary = default;
 078            foreach (var property in element.EnumerateObject())
 79            {
 080                if (property.NameEquals("type"))
 81                {
 082                    type = property.Value.GetString();
 083                    continue;
 84                }
 085                if (property.NameEquals("connectVia"))
 86                {
 087                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 088                    continue;
 89                }
 090                if (property.NameEquals("description"))
 91                {
 092                    description = property.Value.GetString();
 093                    continue;
 94                }
 095                if (property.NameEquals("parameters"))
 96                {
 097                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 098                    foreach (var property0 in property.Value.EnumerateObject())
 99                    {
 0100                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 101                    }
 0102                    parameters = dictionary;
 0103                    continue;
 104                }
 0105                if (property.NameEquals("annotations"))
 106                {
 0107                    List<object> array = new List<object>();
 0108                    foreach (var item in property.Value.EnumerateArray())
 109                    {
 0110                        array.Add(item.GetObject());
 111                    }
 0112                    annotations = array;
 0113                    continue;
 114                }
 0115                if (property.NameEquals("typeProperties"))
 116                {
 0117                    foreach (var property0 in property.Value.EnumerateObject())
 118                    {
 0119                        if (property0.NameEquals("connectionString"))
 120                        {
 0121                            connectionString = property0.Value.GetObject();
 0122                            continue;
 123                        }
 0124                        if (property0.NameEquals("database"))
 125                        {
 0126                            database = property0.Value.GetObject();
 127                            continue;
 128                        }
 129                    }
 130                    continue;
 131                }
 0132                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0133                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 134            }
 0135            additionalProperties = additionalPropertiesDictionary;
 0136            return new MongoDbV2LinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameter
 137        }
 138    }
 139}