< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Url()-0%100%
get_AuthenticationType()-0%100%
get_UserName()-0%100%
get_Password()-0%100%
get_Tenant()-0%100%
get_ServicePrincipalId()-0%100%
get_AadResourceId()-0%100%
get_AadServicePrincipalCredentialType()-0%100%
get_ServicePrincipalKey()-0%100%
get_ServicePrincipalEmbeddedCert()-0%100%
get_ServicePrincipalEmbeddedCertPassword()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeODataLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ODataLinkedService.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> Open Data Protocol (OData) linked service. </summary>
 14    public partial class ODataLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of ODataLinkedService. </summary>
 17        /// <param name="url"> The URL of the OData service endpoint. Type: string (or Expression with resultType string
 18        /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception>
 019        public ODataLinkedService(object url)
 20        {
 021            if (url == null)
 22            {
 023                throw new ArgumentNullException(nameof(url));
 24            }
 25
 026            Url = url;
 027            Type = "OData";
 028        }
 29
 30        /// <summary> Initializes a new instance of ODataLinkedService. </summary>
 31        /// <param name="type"> Type of linked service. </param>
 32        /// <param name="connectVia"> The integration runtime reference. </param>
 33        /// <param name="description"> Linked service description. </param>
 34        /// <param name="parameters"> Parameters for linked service. </param>
 35        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 36        /// <param name="additionalProperties"> . </param>
 37        /// <param name="url"> The URL of the OData service endpoint. Type: string (or Expression with resultType string
 38        /// <param name="authenticationType"> Type of authentication used to connect to the OData service. </param>
 39        /// <param name="userName"> User name of the OData service. Type: string (or Expression with resultType string).
 40        /// <param name="password"> Password of the OData service. </param>
 41        /// <param name="tenant"> Specify the tenant information (domain name or tenant ID) under which your application
 42        /// <param name="servicePrincipalId"> Specify the application id of your application registered in Azure Active 
 43        /// <param name="aadResourceId"> Specify the resource you are requesting authorization to use Directory. Type: s
 44        /// <param name="aadServicePrincipalCredentialType"> Specify the credential type (key or cert) is used for servi
 45        /// <param name="servicePrincipalKey"> Specify the secret of your application registered in Azure Active Directo
 46        /// <param name="servicePrincipalEmbeddedCert"> Specify the base64 encoded certificate of your application regis
 47        /// <param name="servicePrincipalEmbeddedCertPassword"> Specify the password of your certificate if your certifi
 48        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 049        internal ODataLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictionary
 50        {
 051            Url = url;
 052            AuthenticationType = authenticationType;
 053            UserName = userName;
 054            Password = password;
 055            Tenant = tenant;
 056            ServicePrincipalId = servicePrincipalId;
 057            AadResourceId = aadResourceId;
 058            AadServicePrincipalCredentialType = aadServicePrincipalCredentialType;
 059            ServicePrincipalKey = servicePrincipalKey;
 060            ServicePrincipalEmbeddedCert = servicePrincipalEmbeddedCert;
 061            ServicePrincipalEmbeddedCertPassword = servicePrincipalEmbeddedCertPassword;
 062            EncryptedCredential = encryptedCredential;
 063            Type = type ?? "OData";
 064        }
 65
 66        /// <summary> The URL of the OData service endpoint. Type: string (or Expression with resultType string). </summ
 067        public object Url { get; set; }
 68        /// <summary> Type of authentication used to connect to the OData service. </summary>
 069        public ODataAuthenticationType? AuthenticationType { get; set; }
 70        /// <summary> User name of the OData service. Type: string (or Expression with resultType string). </summary>
 071        public object UserName { get; set; }
 72        /// <summary> Password of the OData service. </summary>
 073        public SecretBase Password { get; set; }
 74        /// <summary> Specify the tenant information (domain name or tenant ID) under which your application resides. Ty
 075        public object Tenant { get; set; }
 76        /// <summary> Specify the application id of your application registered in Azure Active Directory. Type: string 
 077        public object ServicePrincipalId { get; set; }
 78        /// <summary> Specify the resource you are requesting authorization to use Directory. Type: string (or Expressio
 079        public object AadResourceId { get; set; }
 80        /// <summary> Specify the credential type (key or cert) is used for service principal. </summary>
 081        public ODataAadServicePrincipalCredentialType? AadServicePrincipalCredentialType { get; set; }
 82        /// <summary> Specify the secret of your application registered in Azure Active Directory. Type: string (or Expr
 083        public SecretBase ServicePrincipalKey { get; set; }
 84        /// <summary> Specify the base64 encoded certificate of your application registered in Azure Active Directory. T
 085        public SecretBase ServicePrincipalEmbeddedCert { get; set; }
 86        /// <summary> Specify the password of your certificate if your certificate has a password and you are using AadS
 087        public SecretBase ServicePrincipalEmbeddedCertPassword { get; set; }
 88        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 089        public object EncryptedCredential { get; set; }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ODataLinkedService.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 ODataLinkedService : 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("url");
 055            writer.WriteObjectValue(Url);
 056            if (Optional.IsDefined(AuthenticationType))
 57            {
 058                writer.WritePropertyName("authenticationType");
 059                writer.WriteStringValue(AuthenticationType.Value.ToString());
 60            }
 061            if (Optional.IsDefined(UserName))
 62            {
 063                writer.WritePropertyName("userName");
 064                writer.WriteObjectValue(UserName);
 65            }
 066            if (Optional.IsDefined(Password))
 67            {
 068                writer.WritePropertyName("password");
 069                writer.WriteObjectValue(Password);
 70            }
 071            if (Optional.IsDefined(Tenant))
 72            {
 073                writer.WritePropertyName("tenant");
 074                writer.WriteObjectValue(Tenant);
 75            }
 076            if (Optional.IsDefined(ServicePrincipalId))
 77            {
 078                writer.WritePropertyName("servicePrincipalId");
 079                writer.WriteObjectValue(ServicePrincipalId);
 80            }
 081            if (Optional.IsDefined(AadResourceId))
 82            {
 083                writer.WritePropertyName("aadResourceId");
 084                writer.WriteObjectValue(AadResourceId);
 85            }
 086            if (Optional.IsDefined(AadServicePrincipalCredentialType))
 87            {
 088                writer.WritePropertyName("aadServicePrincipalCredentialType");
 089                writer.WriteStringValue(AadServicePrincipalCredentialType.Value.ToString());
 90            }
 091            if (Optional.IsDefined(ServicePrincipalKey))
 92            {
 093                writer.WritePropertyName("servicePrincipalKey");
 094                writer.WriteObjectValue(ServicePrincipalKey);
 95            }
 096            if (Optional.IsDefined(ServicePrincipalEmbeddedCert))
 97            {
 098                writer.WritePropertyName("servicePrincipalEmbeddedCert");
 099                writer.WriteObjectValue(ServicePrincipalEmbeddedCert);
 100            }
 0101            if (Optional.IsDefined(ServicePrincipalEmbeddedCertPassword))
 102            {
 0103                writer.WritePropertyName("servicePrincipalEmbeddedCertPassword");
 0104                writer.WriteObjectValue(ServicePrincipalEmbeddedCertPassword);
 105            }
 0106            if (Optional.IsDefined(EncryptedCredential))
 107            {
 0108                writer.WritePropertyName("encryptedCredential");
 0109                writer.WriteObjectValue(EncryptedCredential);
 110            }
 0111            writer.WriteEndObject();
 0112            foreach (var item in AdditionalProperties)
 113            {
 0114                writer.WritePropertyName(item.Key);
 0115                writer.WriteObjectValue(item.Value);
 116            }
 0117            writer.WriteEndObject();
 0118        }
 119
 120        internal static ODataLinkedService DeserializeODataLinkedService(JsonElement element)
 121        {
 0122            string type = default;
 0123            Optional<IntegrationRuntimeReference> connectVia = default;
 0124            Optional<string> description = default;
 0125            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0126            Optional<IList<object>> annotations = default;
 0127            object url = default;
 0128            Optional<ODataAuthenticationType> authenticationType = default;
 0129            Optional<object> userName = default;
 0130            Optional<SecretBase> password = default;
 0131            Optional<object> tenant = default;
 0132            Optional<object> servicePrincipalId = default;
 0133            Optional<object> aadResourceId = default;
 0134            Optional<ODataAadServicePrincipalCredentialType> aadServicePrincipalCredentialType = default;
 0135            Optional<SecretBase> servicePrincipalKey = default;
 0136            Optional<SecretBase> servicePrincipalEmbeddedCert = default;
 0137            Optional<SecretBase> servicePrincipalEmbeddedCertPassword = default;
 0138            Optional<object> encryptedCredential = default;
 0139            IDictionary<string, object> additionalProperties = default;
 0140            Dictionary<string, object> additionalPropertiesDictionary = default;
 0141            foreach (var property in element.EnumerateObject())
 142            {
 0143                if (property.NameEquals("type"))
 144                {
 0145                    type = property.Value.GetString();
 0146                    continue;
 147                }
 0148                if (property.NameEquals("connectVia"))
 149                {
 0150                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0151                    continue;
 152                }
 0153                if (property.NameEquals("description"))
 154                {
 0155                    description = property.Value.GetString();
 0156                    continue;
 157                }
 0158                if (property.NameEquals("parameters"))
 159                {
 0160                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0161                    foreach (var property0 in property.Value.EnumerateObject())
 162                    {
 0163                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 164                    }
 0165                    parameters = dictionary;
 0166                    continue;
 167                }
 0168                if (property.NameEquals("annotations"))
 169                {
 0170                    List<object> array = new List<object>();
 0171                    foreach (var item in property.Value.EnumerateArray())
 172                    {
 0173                        array.Add(item.GetObject());
 174                    }
 0175                    annotations = array;
 0176                    continue;
 177                }
 0178                if (property.NameEquals("typeProperties"))
 179                {
 0180                    foreach (var property0 in property.Value.EnumerateObject())
 181                    {
 0182                        if (property0.NameEquals("url"))
 183                        {
 0184                            url = property0.Value.GetObject();
 0185                            continue;
 186                        }
 0187                        if (property0.NameEquals("authenticationType"))
 188                        {
 0189                            authenticationType = new ODataAuthenticationType(property0.Value.GetString());
 0190                            continue;
 191                        }
 0192                        if (property0.NameEquals("userName"))
 193                        {
 0194                            userName = property0.Value.GetObject();
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("password"))
 198                        {
 0199                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0200                            continue;
 201                        }
 0202                        if (property0.NameEquals("tenant"))
 203                        {
 0204                            tenant = property0.Value.GetObject();
 0205                            continue;
 206                        }
 0207                        if (property0.NameEquals("servicePrincipalId"))
 208                        {
 0209                            servicePrincipalId = property0.Value.GetObject();
 0210                            continue;
 211                        }
 0212                        if (property0.NameEquals("aadResourceId"))
 213                        {
 0214                            aadResourceId = property0.Value.GetObject();
 0215                            continue;
 216                        }
 0217                        if (property0.NameEquals("aadServicePrincipalCredentialType"))
 218                        {
 0219                            aadServicePrincipalCredentialType = new ODataAadServicePrincipalCredentialType(property0.Val
 0220                            continue;
 221                        }
 0222                        if (property0.NameEquals("servicePrincipalKey"))
 223                        {
 0224                            servicePrincipalKey = SecretBase.DeserializeSecretBase(property0.Value);
 0225                            continue;
 226                        }
 0227                        if (property0.NameEquals("servicePrincipalEmbeddedCert"))
 228                        {
 0229                            servicePrincipalEmbeddedCert = SecretBase.DeserializeSecretBase(property0.Value);
 0230                            continue;
 231                        }
 0232                        if (property0.NameEquals("servicePrincipalEmbeddedCertPassword"))
 233                        {
 0234                            servicePrincipalEmbeddedCertPassword = SecretBase.DeserializeSecretBase(property0.Value);
 0235                            continue;
 236                        }
 0237                        if (property0.NameEquals("encryptedCredential"))
 238                        {
 0239                            encryptedCredential = property0.Value.GetObject();
 240                            continue;
 241                        }
 242                    }
 243                    continue;
 244                }
 0245                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0246                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 247            }
 0248            additionalProperties = additionalPropertiesDictionary;
 0249            return new ODataLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), 
 250        }
 251    }
 252}