< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Endpoint()-0%100%
get_ServicePrincipalId()-0%100%
get_ServicePrincipalKey()-0%100%
get_Database()-0%100%
get_Tenant()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureDataExplorerLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureDataExplorerLinkedService.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> Azure Data Explorer (Kusto) linked service. </summary>
 14    public partial class AzureDataExplorerLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of AzureDataExplorerLinkedService. </summary>
 17        /// <param name="endpoint"> The endpoint of Azure Data Explorer (the engine&apos;s endpoint). URL will be in the
 18        /// <param name="servicePrincipalId"> The ID of the service principal used to authenticate against Azure Data Ex
 19        /// <param name="servicePrincipalKey"> The key of the service principal used to authenticate against Kusto. </pa
 20        /// <param name="database"> Database name for connection. Type: string (or Expression with resultType string). <
 21        /// <param name="tenant"> The name or ID of the tenant to which the service principal belongs. Type: string (or 
 22        /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/>, <paramref name="servicePrincipalId"/>,
 023        public AzureDataExplorerLinkedService(object endpoint, object servicePrincipalId, SecretBase servicePrincipalKey
 24        {
 025            if (endpoint == null)
 26            {
 027                throw new ArgumentNullException(nameof(endpoint));
 28            }
 029            if (servicePrincipalId == null)
 30            {
 031                throw new ArgumentNullException(nameof(servicePrincipalId));
 32            }
 033            if (servicePrincipalKey == null)
 34            {
 035                throw new ArgumentNullException(nameof(servicePrincipalKey));
 36            }
 037            if (database == null)
 38            {
 039                throw new ArgumentNullException(nameof(database));
 40            }
 041            if (tenant == null)
 42            {
 043                throw new ArgumentNullException(nameof(tenant));
 44            }
 45
 046            Endpoint = endpoint;
 047            ServicePrincipalId = servicePrincipalId;
 048            ServicePrincipalKey = servicePrincipalKey;
 049            Database = database;
 050            Tenant = tenant;
 051            Type = "AzureDataExplorer";
 052        }
 53
 54        /// <summary> Initializes a new instance of AzureDataExplorerLinkedService. </summary>
 55        /// <param name="type"> Type of linked service. </param>
 56        /// <param name="connectVia"> The integration runtime reference. </param>
 57        /// <param name="description"> Linked service description. </param>
 58        /// <param name="parameters"> Parameters for linked service. </param>
 59        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 60        /// <param name="additionalProperties"> . </param>
 61        /// <param name="endpoint"> The endpoint of Azure Data Explorer (the engine&apos;s endpoint). URL will be in the
 62        /// <param name="servicePrincipalId"> The ID of the service principal used to authenticate against Azure Data Ex
 63        /// <param name="servicePrincipalKey"> The key of the service principal used to authenticate against Kusto. </pa
 64        /// <param name="database"> Database name for connection. Type: string (or Expression with resultType string). <
 65        /// <param name="tenant"> The name or ID of the tenant to which the service principal belongs. Type: string (or 
 066        internal AzureDataExplorerLinkedService(string type, IntegrationRuntimeReference connectVia, string description,
 67        {
 068            Endpoint = endpoint;
 069            ServicePrincipalId = servicePrincipalId;
 070            ServicePrincipalKey = servicePrincipalKey;
 071            Database = database;
 072            Tenant = tenant;
 073            Type = type ?? "AzureDataExplorer";
 074        }
 75
 76        /// <summary> The endpoint of Azure Data Explorer (the engine&apos;s endpoint). URL will be in the format https:
 077        public object Endpoint { get; set; }
 78        /// <summary> The ID of the service principal used to authenticate against Azure Data Explorer. Type: string (or
 079        public object ServicePrincipalId { get; set; }
 80        /// <summary> The key of the service principal used to authenticate against Kusto. </summary>
 081        public SecretBase ServicePrincipalKey { get; set; }
 82        /// <summary> Database name for connection. Type: string (or Expression with resultType string). </summary>
 083        public object Database { get; set; }
 84        /// <summary> The name or ID of the tenant to which the service principal belongs. Type: string (or Expression w
 085        public object Tenant { get; set; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureDataExplorerLinkedService.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 AzureDataExplorerLinkedService : 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("endpoint");
 055            writer.WriteObjectValue(Endpoint);
 056            writer.WritePropertyName("servicePrincipalId");
 057            writer.WriteObjectValue(ServicePrincipalId);
 058            writer.WritePropertyName("servicePrincipalKey");
 059            writer.WriteObjectValue(ServicePrincipalKey);
 060            writer.WritePropertyName("database");
 061            writer.WriteObjectValue(Database);
 062            writer.WritePropertyName("tenant");
 063            writer.WriteObjectValue(Tenant);
 064            writer.WriteEndObject();
 065            foreach (var item in AdditionalProperties)
 66            {
 067                writer.WritePropertyName(item.Key);
 068                writer.WriteObjectValue(item.Value);
 69            }
 070            writer.WriteEndObject();
 071        }
 72
 73        internal static AzureDataExplorerLinkedService DeserializeAzureDataExplorerLinkedService(JsonElement element)
 74        {
 075            string type = default;
 076            Optional<IntegrationRuntimeReference> connectVia = default;
 077            Optional<string> description = default;
 078            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 079            Optional<IList<object>> annotations = default;
 080            object endpoint = default;
 081            object servicePrincipalId = default;
 082            SecretBase servicePrincipalKey = default;
 083            object database = default;
 084            object tenant = default;
 085            IDictionary<string, object> additionalProperties = default;
 086            Dictionary<string, object> additionalPropertiesDictionary = default;
 087            foreach (var property in element.EnumerateObject())
 88            {
 089                if (property.NameEquals("type"))
 90                {
 091                    type = property.Value.GetString();
 092                    continue;
 93                }
 094                if (property.NameEquals("connectVia"))
 95                {
 096                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 097                    continue;
 98                }
 099                if (property.NameEquals("description"))
 100                {
 0101                    description = property.Value.GetString();
 0102                    continue;
 103                }
 0104                if (property.NameEquals("parameters"))
 105                {
 0106                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0107                    foreach (var property0 in property.Value.EnumerateObject())
 108                    {
 0109                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 110                    }
 0111                    parameters = dictionary;
 0112                    continue;
 113                }
 0114                if (property.NameEquals("annotations"))
 115                {
 0116                    List<object> array = new List<object>();
 0117                    foreach (var item in property.Value.EnumerateArray())
 118                    {
 0119                        array.Add(item.GetObject());
 120                    }
 0121                    annotations = array;
 0122                    continue;
 123                }
 0124                if (property.NameEquals("typeProperties"))
 125                {
 0126                    foreach (var property0 in property.Value.EnumerateObject())
 127                    {
 0128                        if (property0.NameEquals("endpoint"))
 129                        {
 0130                            endpoint = property0.Value.GetObject();
 0131                            continue;
 132                        }
 0133                        if (property0.NameEquals("servicePrincipalId"))
 134                        {
 0135                            servicePrincipalId = property0.Value.GetObject();
 0136                            continue;
 137                        }
 0138                        if (property0.NameEquals("servicePrincipalKey"))
 139                        {
 0140                            servicePrincipalKey = SecretBase.DeserializeSecretBase(property0.Value);
 0141                            continue;
 142                        }
 0143                        if (property0.NameEquals("database"))
 144                        {
 0145                            database = property0.Value.GetObject();
 0146                            continue;
 147                        }
 0148                        if (property0.NameEquals("tenant"))
 149                        {
 0150                            tenant = property0.Value.GetObject();
 151                            continue;
 152                        }
 153                    }
 154                    continue;
 155                }
 0156                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0157                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 158            }
 0159            additionalProperties = additionalPropertiesDictionary;
 0160            return new AzureDataExplorerLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(p
 161        }
 162    }
 163}