< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Host()-0%100%
get_Port()-0%100%
get_ServerType()-0%100%
get_ThriftTransportProtocol()-0%100%
get_AuthenticationType()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_HttpPath()-0%100%
get_EnableSsl()-0%100%
get_TrustedCertPath()-0%100%
get_UseSystemTrustStore()-0%100%
get_AllowHostNameCNMismatch()-0%100%
get_AllowSelfSignedServerCert()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSparkLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkLinkedService.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> Spark Server linked service. </summary>
 14    public partial class SparkLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of SparkLinkedService. </summary>
 17        /// <param name="host"> IP address or host name of the Spark server. </param>
 18        /// <param name="port"> The TCP port that the Spark server uses to listen for client connections. </param>
 19        /// <param name="authenticationType"> The authentication method used to access the Spark server. </param>
 20        /// <exception cref="ArgumentNullException"> <paramref name="host"/> or <paramref name="port"/> is null. </excep
 021        public SparkLinkedService(object host, object port, SparkAuthenticationType authenticationType)
 22        {
 023            if (host == null)
 24            {
 025                throw new ArgumentNullException(nameof(host));
 26            }
 027            if (port == null)
 28            {
 029                throw new ArgumentNullException(nameof(port));
 30            }
 31
 032            Host = host;
 033            Port = port;
 034            AuthenticationType = authenticationType;
 035            Type = "Spark";
 036        }
 37
 38        /// <summary> Initializes a new instance of SparkLinkedService. </summary>
 39        /// <param name="type"> Type of linked service. </param>
 40        /// <param name="connectVia"> The integration runtime reference. </param>
 41        /// <param name="description"> Linked service description. </param>
 42        /// <param name="parameters"> Parameters for linked service. </param>
 43        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 44        /// <param name="additionalProperties"> . </param>
 45        /// <param name="host"> IP address or host name of the Spark server. </param>
 46        /// <param name="port"> The TCP port that the Spark server uses to listen for client connections. </param>
 47        /// <param name="serverType"> The type of Spark server. </param>
 48        /// <param name="thriftTransportProtocol"> The transport protocol to use in the Thrift layer. </param>
 49        /// <param name="authenticationType"> The authentication method used to access the Spark server. </param>
 50        /// <param name="username"> The user name that you use to access Spark Server. </param>
 51        /// <param name="password"> The password corresponding to the user name that you provided in the Username field.
 52        /// <param name="httpPath"> The partial URL corresponding to the Spark server. </param>
 53        /// <param name="enableSsl"> Specifies whether the connections to the server are encrypted using SSL. The defaul
 54        /// <param name="trustedCertPath"> The full path of the .pem file containing trusted CA certificates for verifyi
 55        /// <param name="useSystemTrustStore"> Specifies whether to use a CA certificate from the system trust store or 
 56        /// <param name="allowHostNameCNMismatch"> Specifies whether to require a CA-issued SSL certificate name to matc
 57        /// <param name="allowSelfSignedServerCert"> Specifies whether to allow self-signed certificates from the server
 58        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 059        internal SparkLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictionary
 60        {
 061            Host = host;
 062            Port = port;
 063            ServerType = serverType;
 064            ThriftTransportProtocol = thriftTransportProtocol;
 065            AuthenticationType = authenticationType;
 066            Username = username;
 067            Password = password;
 068            HttpPath = httpPath;
 069            EnableSsl = enableSsl;
 070            TrustedCertPath = trustedCertPath;
 071            UseSystemTrustStore = useSystemTrustStore;
 072            AllowHostNameCNMismatch = allowHostNameCNMismatch;
 073            AllowSelfSignedServerCert = allowSelfSignedServerCert;
 074            EncryptedCredential = encryptedCredential;
 075            Type = type ?? "Spark";
 076        }
 77
 78        /// <summary> IP address or host name of the Spark server. </summary>
 079        public object Host { get; set; }
 80        /// <summary> The TCP port that the Spark server uses to listen for client connections. </summary>
 081        public object Port { get; set; }
 82        /// <summary> The type of Spark server. </summary>
 083        public SparkServerType? ServerType { get; set; }
 84        /// <summary> The transport protocol to use in the Thrift layer. </summary>
 085        public SparkThriftTransportProtocol? ThriftTransportProtocol { get; set; }
 86        /// <summary> The authentication method used to access the Spark server. </summary>
 087        public SparkAuthenticationType AuthenticationType { get; set; }
 88        /// <summary> The user name that you use to access Spark Server. </summary>
 089        public object Username { get; set; }
 90        /// <summary> The password corresponding to the user name that you provided in the Username field. </summary>
 091        public SecretBase Password { get; set; }
 92        /// <summary> The partial URL corresponding to the Spark server. </summary>
 093        public object HttpPath { get; set; }
 94        /// <summary> Specifies whether the connections to the server are encrypted using SSL. The default value is fals
 095        public object EnableSsl { get; set; }
 96        /// <summary> The full path of the .pem file containing trusted CA certificates for verifying the server when co
 097        public object TrustedCertPath { get; set; }
 98        /// <summary> Specifies whether to use a CA certificate from the system trust store or from a specified PEM file
 099        public object UseSystemTrustStore { get; set; }
 100        /// <summary> Specifies whether to require a CA-issued SSL certificate name to match the host name of the server
 0101        public object AllowHostNameCNMismatch { get; set; }
 102        /// <summary> Specifies whether to allow self-signed certificates from the server. The default value is false. <
 0103        public object AllowSelfSignedServerCert { get; set; }
 104        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 0105        public object EncryptedCredential { get; set; }
 106    }
 107}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkLinkedService.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 SparkLinkedService : 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("host");
 055            writer.WriteObjectValue(Host);
 056            writer.WritePropertyName("port");
 057            writer.WriteObjectValue(Port);
 058            if (Optional.IsDefined(ServerType))
 59            {
 060                writer.WritePropertyName("serverType");
 061                writer.WriteStringValue(ServerType.Value.ToString());
 62            }
 063            if (Optional.IsDefined(ThriftTransportProtocol))
 64            {
 065                writer.WritePropertyName("thriftTransportProtocol");
 066                writer.WriteStringValue(ThriftTransportProtocol.Value.ToString());
 67            }
 068            writer.WritePropertyName("authenticationType");
 069            writer.WriteStringValue(AuthenticationType.ToString());
 070            if (Optional.IsDefined(Username))
 71            {
 072                writer.WritePropertyName("username");
 073                writer.WriteObjectValue(Username);
 74            }
 075            if (Optional.IsDefined(Password))
 76            {
 077                writer.WritePropertyName("password");
 078                writer.WriteObjectValue(Password);
 79            }
 080            if (Optional.IsDefined(HttpPath))
 81            {
 082                writer.WritePropertyName("httpPath");
 083                writer.WriteObjectValue(HttpPath);
 84            }
 085            if (Optional.IsDefined(EnableSsl))
 86            {
 087                writer.WritePropertyName("enableSsl");
 088                writer.WriteObjectValue(EnableSsl);
 89            }
 090            if (Optional.IsDefined(TrustedCertPath))
 91            {
 092                writer.WritePropertyName("trustedCertPath");
 093                writer.WriteObjectValue(TrustedCertPath);
 94            }
 095            if (Optional.IsDefined(UseSystemTrustStore))
 96            {
 097                writer.WritePropertyName("useSystemTrustStore");
 098                writer.WriteObjectValue(UseSystemTrustStore);
 99            }
 0100            if (Optional.IsDefined(AllowHostNameCNMismatch))
 101            {
 0102                writer.WritePropertyName("allowHostNameCNMismatch");
 0103                writer.WriteObjectValue(AllowHostNameCNMismatch);
 104            }
 0105            if (Optional.IsDefined(AllowSelfSignedServerCert))
 106            {
 0107                writer.WritePropertyName("allowSelfSignedServerCert");
 0108                writer.WriteObjectValue(AllowSelfSignedServerCert);
 109            }
 0110            if (Optional.IsDefined(EncryptedCredential))
 111            {
 0112                writer.WritePropertyName("encryptedCredential");
 0113                writer.WriteObjectValue(EncryptedCredential);
 114            }
 0115            writer.WriteEndObject();
 0116            foreach (var item in AdditionalProperties)
 117            {
 0118                writer.WritePropertyName(item.Key);
 0119                writer.WriteObjectValue(item.Value);
 120            }
 0121            writer.WriteEndObject();
 0122        }
 123
 124        internal static SparkLinkedService DeserializeSparkLinkedService(JsonElement element)
 125        {
 0126            string type = default;
 0127            Optional<IntegrationRuntimeReference> connectVia = default;
 0128            Optional<string> description = default;
 0129            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0130            Optional<IList<object>> annotations = default;
 0131            object host = default;
 0132            object port = default;
 0133            Optional<SparkServerType> serverType = default;
 0134            Optional<SparkThriftTransportProtocol> thriftTransportProtocol = default;
 0135            SparkAuthenticationType authenticationType = default;
 0136            Optional<object> username = default;
 0137            Optional<SecretBase> password = default;
 0138            Optional<object> httpPath = default;
 0139            Optional<object> enableSsl = default;
 0140            Optional<object> trustedCertPath = default;
 0141            Optional<object> useSystemTrustStore = default;
 0142            Optional<object> allowHostNameCNMismatch = default;
 0143            Optional<object> allowSelfSignedServerCert = default;
 0144            Optional<object> encryptedCredential = default;
 0145            IDictionary<string, object> additionalProperties = default;
 0146            Dictionary<string, object> additionalPropertiesDictionary = default;
 0147            foreach (var property in element.EnumerateObject())
 148            {
 0149                if (property.NameEquals("type"))
 150                {
 0151                    type = property.Value.GetString();
 0152                    continue;
 153                }
 0154                if (property.NameEquals("connectVia"))
 155                {
 0156                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0157                    continue;
 158                }
 0159                if (property.NameEquals("description"))
 160                {
 0161                    description = property.Value.GetString();
 0162                    continue;
 163                }
 0164                if (property.NameEquals("parameters"))
 165                {
 0166                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0167                    foreach (var property0 in property.Value.EnumerateObject())
 168                    {
 0169                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 170                    }
 0171                    parameters = dictionary;
 0172                    continue;
 173                }
 0174                if (property.NameEquals("annotations"))
 175                {
 0176                    List<object> array = new List<object>();
 0177                    foreach (var item in property.Value.EnumerateArray())
 178                    {
 0179                        array.Add(item.GetObject());
 180                    }
 0181                    annotations = array;
 0182                    continue;
 183                }
 0184                if (property.NameEquals("typeProperties"))
 185                {
 0186                    foreach (var property0 in property.Value.EnumerateObject())
 187                    {
 0188                        if (property0.NameEquals("host"))
 189                        {
 0190                            host = property0.Value.GetObject();
 0191                            continue;
 192                        }
 0193                        if (property0.NameEquals("port"))
 194                        {
 0195                            port = property0.Value.GetObject();
 0196                            continue;
 197                        }
 0198                        if (property0.NameEquals("serverType"))
 199                        {
 0200                            serverType = new SparkServerType(property0.Value.GetString());
 0201                            continue;
 202                        }
 0203                        if (property0.NameEquals("thriftTransportProtocol"))
 204                        {
 0205                            thriftTransportProtocol = new SparkThriftTransportProtocol(property0.Value.GetString());
 0206                            continue;
 207                        }
 0208                        if (property0.NameEquals("authenticationType"))
 209                        {
 0210                            authenticationType = new SparkAuthenticationType(property0.Value.GetString());
 0211                            continue;
 212                        }
 0213                        if (property0.NameEquals("username"))
 214                        {
 0215                            username = property0.Value.GetObject();
 0216                            continue;
 217                        }
 0218                        if (property0.NameEquals("password"))
 219                        {
 0220                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0221                            continue;
 222                        }
 0223                        if (property0.NameEquals("httpPath"))
 224                        {
 0225                            httpPath = property0.Value.GetObject();
 0226                            continue;
 227                        }
 0228                        if (property0.NameEquals("enableSsl"))
 229                        {
 0230                            enableSsl = property0.Value.GetObject();
 0231                            continue;
 232                        }
 0233                        if (property0.NameEquals("trustedCertPath"))
 234                        {
 0235                            trustedCertPath = property0.Value.GetObject();
 0236                            continue;
 237                        }
 0238                        if (property0.NameEquals("useSystemTrustStore"))
 239                        {
 0240                            useSystemTrustStore = property0.Value.GetObject();
 0241                            continue;
 242                        }
 0243                        if (property0.NameEquals("allowHostNameCNMismatch"))
 244                        {
 0245                            allowHostNameCNMismatch = property0.Value.GetObject();
 0246                            continue;
 247                        }
 0248                        if (property0.NameEquals("allowSelfSignedServerCert"))
 249                        {
 0250                            allowSelfSignedServerCert = property0.Value.GetObject();
 0251                            continue;
 252                        }
 0253                        if (property0.NameEquals("encryptedCredential"))
 254                        {
 0255                            encryptedCredential = property0.Value.GetObject();
 256                            continue;
 257                        }
 258                    }
 259                    continue;
 260                }
 0261                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0262                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 263            }
 0264            additionalProperties = additionalPropertiesDictionary;
 0265            return new SparkLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), 
 266        }
 267    }
 268}