< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_SubscriptionId()-0%100%
get_ResourceGroupName()-0%100%
get_MlWorkspaceName()-0%100%
get_ServicePrincipalId()-0%100%
get_ServicePrincipalKey()-0%100%
get_Tenant()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureMLServiceLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureMLServiceLinkedService.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 ML Service linked service. </summary>
 14    public partial class AzureMLServiceLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of AzureMLServiceLinkedService. </summary>
 17        /// <param name="subscriptionId"> Azure ML Service workspace subscription ID. Type: string (or Expression with r
 18        /// <param name="resourceGroupName"> Azure ML Service workspace resource group name. Type: string (or Expression
 19        /// <param name="mlWorkspaceName"> Azure ML Service workspace name. Type: string (or Expression with resultType 
 20        /// <exception cref="ArgumentNullException"> <paramref name="subscriptionId"/>, <paramref name="resourceGroupNam
 021        public AzureMLServiceLinkedService(object subscriptionId, object resourceGroupName, object mlWorkspaceName)
 22        {
 023            if (subscriptionId == null)
 24            {
 025                throw new ArgumentNullException(nameof(subscriptionId));
 26            }
 027            if (resourceGroupName == null)
 28            {
 029                throw new ArgumentNullException(nameof(resourceGroupName));
 30            }
 031            if (mlWorkspaceName == null)
 32            {
 033                throw new ArgumentNullException(nameof(mlWorkspaceName));
 34            }
 35
 036            SubscriptionId = subscriptionId;
 037            ResourceGroupName = resourceGroupName;
 038            MlWorkspaceName = mlWorkspaceName;
 039            Type = "AzureMLService";
 040        }
 41
 42        /// <summary> Initializes a new instance of AzureMLServiceLinkedService. </summary>
 43        /// <param name="type"> Type of linked service. </param>
 44        /// <param name="connectVia"> The integration runtime reference. </param>
 45        /// <param name="description"> Linked service description. </param>
 46        /// <param name="parameters"> Parameters for linked service. </param>
 47        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 48        /// <param name="additionalProperties"> . </param>
 49        /// <param name="subscriptionId"> Azure ML Service workspace subscription ID. Type: string (or Expression with r
 50        /// <param name="resourceGroupName"> Azure ML Service workspace resource group name. Type: string (or Expression
 51        /// <param name="mlWorkspaceName"> Azure ML Service workspace name. Type: string (or Expression with resultType 
 52        /// <param name="servicePrincipalId"> The ID of the service principal used to authenticate against the endpoint 
 53        /// <param name="servicePrincipalKey"> The key of the service principal used to authenticate against the endpoin
 54        /// <param name="tenant"> The name or ID of the tenant to which the service principal belongs. Type: string (or 
 55        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 056        internal AzureMLServiceLinkedService(string type, IntegrationRuntimeReference connectVia, string description, ID
 57        {
 058            SubscriptionId = subscriptionId;
 059            ResourceGroupName = resourceGroupName;
 060            MlWorkspaceName = mlWorkspaceName;
 061            ServicePrincipalId = servicePrincipalId;
 062            ServicePrincipalKey = servicePrincipalKey;
 063            Tenant = tenant;
 064            EncryptedCredential = encryptedCredential;
 065            Type = type ?? "AzureMLService";
 066        }
 67
 68        /// <summary> Azure ML Service workspace subscription ID. Type: string (or Expression with resultType string). <
 069        public object SubscriptionId { get; set; }
 70        /// <summary> Azure ML Service workspace resource group name. Type: string (or Expression with resultType string
 071        public object ResourceGroupName { get; set; }
 72        /// <summary> Azure ML Service workspace name. Type: string (or Expression with resultType string). </summary>
 073        public object MlWorkspaceName { get; set; }
 74        /// <summary> The ID of the service principal used to authenticate against the endpoint of a published Azure ML 
 075        public object ServicePrincipalId { get; set; }
 76        /// <summary> The key of the service principal used to authenticate against the endpoint of a published Azure ML
 077        public SecretBase ServicePrincipalKey { get; set; }
 78        /// <summary> The name or ID of the tenant to which the service principal belongs. Type: string (or Expression w
 079        public object Tenant { get; set; }
 80        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 081        public object EncryptedCredential { get; set; }
 82    }
 83}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AzureMLServiceLinkedService.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 AzureMLServiceLinkedService : 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("subscriptionId");
 055            writer.WriteObjectValue(SubscriptionId);
 056            writer.WritePropertyName("resourceGroupName");
 057            writer.WriteObjectValue(ResourceGroupName);
 058            writer.WritePropertyName("mlWorkspaceName");
 059            writer.WriteObjectValue(MlWorkspaceName);
 060            if (Optional.IsDefined(ServicePrincipalId))
 61            {
 062                writer.WritePropertyName("servicePrincipalId");
 063                writer.WriteObjectValue(ServicePrincipalId);
 64            }
 065            if (Optional.IsDefined(ServicePrincipalKey))
 66            {
 067                writer.WritePropertyName("servicePrincipalKey");
 068                writer.WriteObjectValue(ServicePrincipalKey);
 69            }
 070            if (Optional.IsDefined(Tenant))
 71            {
 072                writer.WritePropertyName("tenant");
 073                writer.WriteObjectValue(Tenant);
 74            }
 075            if (Optional.IsDefined(EncryptedCredential))
 76            {
 077                writer.WritePropertyName("encryptedCredential");
 078                writer.WriteObjectValue(EncryptedCredential);
 79            }
 080            writer.WriteEndObject();
 081            foreach (var item in AdditionalProperties)
 82            {
 083                writer.WritePropertyName(item.Key);
 084                writer.WriteObjectValue(item.Value);
 85            }
 086            writer.WriteEndObject();
 087        }
 88
 89        internal static AzureMLServiceLinkedService DeserializeAzureMLServiceLinkedService(JsonElement element)
 90        {
 091            string type = default;
 092            Optional<IntegrationRuntimeReference> connectVia = default;
 093            Optional<string> description = default;
 094            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 095            Optional<IList<object>> annotations = default;
 096            object subscriptionId = default;
 097            object resourceGroupName = default;
 098            object mlWorkspaceName = default;
 099            Optional<object> servicePrincipalId = default;
 0100            Optional<SecretBase> servicePrincipalKey = default;
 0101            Optional<object> tenant = default;
 0102            Optional<object> encryptedCredential = default;
 0103            IDictionary<string, object> additionalProperties = default;
 0104            Dictionary<string, object> additionalPropertiesDictionary = default;
 0105            foreach (var property in element.EnumerateObject())
 106            {
 0107                if (property.NameEquals("type"))
 108                {
 0109                    type = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("connectVia"))
 113                {
 0114                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0115                    continue;
 116                }
 0117                if (property.NameEquals("description"))
 118                {
 0119                    description = property.Value.GetString();
 0120                    continue;
 121                }
 0122                if (property.NameEquals("parameters"))
 123                {
 0124                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0125                    foreach (var property0 in property.Value.EnumerateObject())
 126                    {
 0127                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 128                    }
 0129                    parameters = dictionary;
 0130                    continue;
 131                }
 0132                if (property.NameEquals("annotations"))
 133                {
 0134                    List<object> array = new List<object>();
 0135                    foreach (var item in property.Value.EnumerateArray())
 136                    {
 0137                        array.Add(item.GetObject());
 138                    }
 0139                    annotations = array;
 0140                    continue;
 141                }
 0142                if (property.NameEquals("typeProperties"))
 143                {
 0144                    foreach (var property0 in property.Value.EnumerateObject())
 145                    {
 0146                        if (property0.NameEquals("subscriptionId"))
 147                        {
 0148                            subscriptionId = property0.Value.GetObject();
 0149                            continue;
 150                        }
 0151                        if (property0.NameEquals("resourceGroupName"))
 152                        {
 0153                            resourceGroupName = property0.Value.GetObject();
 0154                            continue;
 155                        }
 0156                        if (property0.NameEquals("mlWorkspaceName"))
 157                        {
 0158                            mlWorkspaceName = property0.Value.GetObject();
 0159                            continue;
 160                        }
 0161                        if (property0.NameEquals("servicePrincipalId"))
 162                        {
 0163                            servicePrincipalId = property0.Value.GetObject();
 0164                            continue;
 165                        }
 0166                        if (property0.NameEquals("servicePrincipalKey"))
 167                        {
 0168                            servicePrincipalKey = SecretBase.DeserializeSecretBase(property0.Value);
 0169                            continue;
 170                        }
 0171                        if (property0.NameEquals("tenant"))
 172                        {
 0173                            tenant = property0.Value.GetObject();
 0174                            continue;
 175                        }
 0176                        if (property0.NameEquals("encryptedCredential"))
 177                        {
 0178                            encryptedCredential = property0.Value.GetObject();
 179                            continue;
 180                        }
 181                    }
 182                    continue;
 183                }
 0184                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0185                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 186            }
 0187            additionalProperties = additionalPropertiesDictionary;
 0188            return new AzureMLServiceLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(para
 189        }
 190    }
 191}