< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestServiceLinkedService.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> Rest Service linked service. </summary>
 14    public partial class RestServiceLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of RestServiceLinkedService. </summary>
 17        /// <param name="url"> The base URL of the REST service. </param>
 18        /// <param name="authenticationType"> Type of authentication used to connect to the REST service. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="url"/> is null. </exception>
 020        public RestServiceLinkedService(object url, RestServiceAuthenticationType authenticationType)
 21        {
 022            if (url == null)
 23            {
 024                throw new ArgumentNullException(nameof(url));
 25            }
 26
 027            Url = url;
 028            AuthenticationType = authenticationType;
 029            Type = "RestService";
 030        }
 31
 32        /// <summary> Initializes a new instance of RestServiceLinkedService. </summary>
 33        /// <param name="type"> Type of linked service. </param>
 34        /// <param name="connectVia"> The integration runtime reference. </param>
 35        /// <param name="description"> Linked service description. </param>
 36        /// <param name="parameters"> Parameters for linked service. </param>
 37        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 38        /// <param name="additionalProperties"> . </param>
 39        /// <param name="url"> The base URL of the REST service. </param>
 40        /// <param name="enableServerCertificateValidation"> Whether to validate server side SSL certificate when connec
 41        /// <param name="authenticationType"> Type of authentication used to connect to the REST service. </param>
 42        /// <param name="userName"> The user name used in Basic authentication type. </param>
 43        /// <param name="password"> The password used in Basic authentication type. </param>
 44        /// <param name="servicePrincipalId"> The application&apos;s client ID used in AadServicePrincipal authenticatio
 45        /// <param name="servicePrincipalKey"> The application&apos;s key used in AadServicePrincipal authentication typ
 46        /// <param name="tenant"> The tenant information (domain name or tenant ID) used in AadServicePrincipal authenti
 47        /// <param name="aadResourceId"> The resource you are requesting authorization to use. </param>
 48        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 049        internal RestServiceLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDict
 50        {
 051            Url = url;
 052            EnableServerCertificateValidation = enableServerCertificateValidation;
 053            AuthenticationType = authenticationType;
 054            UserName = userName;
 055            Password = password;
 056            ServicePrincipalId = servicePrincipalId;
 057            ServicePrincipalKey = servicePrincipalKey;
 058            Tenant = tenant;
 059            AadResourceId = aadResourceId;
 060            EncryptedCredential = encryptedCredential;
 061            Type = type ?? "RestService";
 062        }
 63
 64        /// <summary> The base URL of the REST service. </summary>
 065        public object Url { get; set; }
 66        /// <summary> Whether to validate server side SSL certificate when connecting to the endpoint.The default value 
 067        public object EnableServerCertificateValidation { get; set; }
 68        /// <summary> Type of authentication used to connect to the REST service. </summary>
 069        public RestServiceAuthenticationType AuthenticationType { get; set; }
 70        /// <summary> The user name used in Basic authentication type. </summary>
 071        public object UserName { get; set; }
 72        /// <summary> The password used in Basic authentication type. </summary>
 073        public SecretBase Password { get; set; }
 74        /// <summary> The application&apos;s client ID used in AadServicePrincipal authentication type. </summary>
 075        public object ServicePrincipalId { get; set; }
 76        /// <summary> The application&apos;s key used in AadServicePrincipal authentication type. </summary>
 077        public SecretBase ServicePrincipalKey { get; set; }
 78        /// <summary> The tenant information (domain name or tenant ID) used in AadServicePrincipal authentication type 
 079        public object Tenant { get; set; }
 80        /// <summary> The resource you are requesting authorization to use. </summary>
 081        public object AadResourceId { get; set; }
 82        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 083        public object EncryptedCredential { get; set; }
 84    }
 85}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\RestServiceLinkedService.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 RestServiceLinkedService : 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(EnableServerCertificateValidation))
 57            {
 058                writer.WritePropertyName("enableServerCertificateValidation");
 059                writer.WriteObjectValue(EnableServerCertificateValidation);
 60            }
 061            writer.WritePropertyName("authenticationType");
 062            writer.WriteStringValue(AuthenticationType.ToString());
 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(ServicePrincipalId))
 74            {
 075                writer.WritePropertyName("servicePrincipalId");
 076                writer.WriteObjectValue(ServicePrincipalId);
 77            }
 078            if (Optional.IsDefined(ServicePrincipalKey))
 79            {
 080                writer.WritePropertyName("servicePrincipalKey");
 081                writer.WriteObjectValue(ServicePrincipalKey);
 82            }
 083            if (Optional.IsDefined(Tenant))
 84            {
 085                writer.WritePropertyName("tenant");
 086                writer.WriteObjectValue(Tenant);
 87            }
 088            if (Optional.IsDefined(AadResourceId))
 89            {
 090                writer.WritePropertyName("aadResourceId");
 091                writer.WriteObjectValue(AadResourceId);
 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 RestServiceLinkedService DeserializeRestServiceLinkedService(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 url = default;
 0115            Optional<object> enableServerCertificateValidation = default;
 0116            RestServiceAuthenticationType authenticationType = default;
 0117            Optional<object> userName = default;
 0118            Optional<SecretBase> password = default;
 0119            Optional<object> servicePrincipalId = default;
 0120            Optional<SecretBase> servicePrincipalKey = default;
 0121            Optional<object> tenant = default;
 0122            Optional<object> aadResourceId = 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("url"))
 168                        {
 0169                            url = property0.Value.GetObject();
 0170                            continue;
 171                        }
 0172                        if (property0.NameEquals("enableServerCertificateValidation"))
 173                        {
 0174                            enableServerCertificateValidation = property0.Value.GetObject();
 0175                            continue;
 176                        }
 0177                        if (property0.NameEquals("authenticationType"))
 178                        {
 0179                            authenticationType = new RestServiceAuthenticationType(property0.Value.GetString());
 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("servicePrincipalId"))
 193                        {
 0194                            servicePrincipalId = property0.Value.GetObject();
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("servicePrincipalKey"))
 198                        {
 0199                            servicePrincipalKey = 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("aadResourceId"))
 208                        {
 0209                            aadResourceId = 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 RestServiceLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(paramet
 225        }
 226    }
 227}