< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.PrestoLinkedService
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\PrestoLinkedService.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\PrestoLinkedService.Serialization.cs
Covered lines:0
Uncovered lines:202
Coverable lines:202
Total lines:378
Line coverage:0% (0 of 202)
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_ServerVersion()-0%100%
get_Catalog()-0%100%
get_Port()-0%100%
get_AuthenticationType()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_EnableSsl()-0%100%
get_TrustedCertPath()-0%100%
get_UseSystemTrustStore()-0%100%
get_AllowHostNameCNMismatch()-0%100%
get_AllowSelfSignedServerCert()-0%100%
get_TimeZoneID()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePrestoLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\PrestoLinkedService.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> Presto server linked service. </summary>
 14    public partial class PrestoLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of PrestoLinkedService. </summary>
 17        /// <param name="host"> The IP address or host name of the Presto server. (i.e. 192.168.222.160). </param>
 18        /// <param name="serverVersion"> The version of the Presto server. (i.e. 0.148-t). </param>
 19        /// <param name="catalog"> The catalog context for all request against the server. </param>
 20        /// <param name="authenticationType"> The authentication mechanism used to connect to the Presto server. </param
 21        /// <exception cref="ArgumentNullException"> <paramref name="host"/>, <paramref name="serverVersion"/>, or <para
 022        public PrestoLinkedService(object host, object serverVersion, object catalog, PrestoAuthenticationType authentic
 23        {
 024            if (host == null)
 25            {
 026                throw new ArgumentNullException(nameof(host));
 27            }
 028            if (serverVersion == null)
 29            {
 030                throw new ArgumentNullException(nameof(serverVersion));
 31            }
 032            if (catalog == null)
 33            {
 034                throw new ArgumentNullException(nameof(catalog));
 35            }
 36
 037            Host = host;
 038            ServerVersion = serverVersion;
 039            Catalog = catalog;
 040            AuthenticationType = authenticationType;
 041            Type = "Presto";
 042        }
 43
 44        /// <summary> Initializes a new instance of PrestoLinkedService. </summary>
 45        /// <param name="type"> Type of linked service. </param>
 46        /// <param name="connectVia"> The integration runtime reference. </param>
 47        /// <param name="description"> Linked service description. </param>
 48        /// <param name="parameters"> Parameters for linked service. </param>
 49        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 50        /// <param name="additionalProperties"> . </param>
 51        /// <param name="host"> The IP address or host name of the Presto server. (i.e. 192.168.222.160). </param>
 52        /// <param name="serverVersion"> The version of the Presto server. (i.e. 0.148-t). </param>
 53        /// <param name="catalog"> The catalog context for all request against the server. </param>
 54        /// <param name="port"> The TCP port that the Presto server uses to listen for client connections. The default v
 55        /// <param name="authenticationType"> The authentication mechanism used to connect to the Presto server. </param
 56        /// <param name="username"> The user name used to connect to the Presto server. </param>
 57        /// <param name="password"> The password corresponding to the user name. </param>
 58        /// <param name="enableSsl"> Specifies whether the connections to the server are encrypted using SSL. The defaul
 59        /// <param name="trustedCertPath"> The full path of the .pem file containing trusted CA certificates for verifyi
 60        /// <param name="useSystemTrustStore"> Specifies whether to use a CA certificate from the system trust store or 
 61        /// <param name="allowHostNameCNMismatch"> Specifies whether to require a CA-issued SSL certificate name to matc
 62        /// <param name="allowSelfSignedServerCert"> Specifies whether to allow self-signed certificates from the server
 63        /// <param name="timeZoneID"> The local time zone used by the connection. Valid values for this option are speci
 64        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 065        internal PrestoLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDictionar
 66        {
 067            Host = host;
 068            ServerVersion = serverVersion;
 069            Catalog = catalog;
 070            Port = port;
 071            AuthenticationType = authenticationType;
 072            Username = username;
 073            Password = password;
 074            EnableSsl = enableSsl;
 075            TrustedCertPath = trustedCertPath;
 076            UseSystemTrustStore = useSystemTrustStore;
 077            AllowHostNameCNMismatch = allowHostNameCNMismatch;
 078            AllowSelfSignedServerCert = allowSelfSignedServerCert;
 079            TimeZoneID = timeZoneID;
 080            EncryptedCredential = encryptedCredential;
 081            Type = type ?? "Presto";
 082        }
 83
 84        /// <summary> The IP address or host name of the Presto server. (i.e. 192.168.222.160). </summary>
 085        public object Host { get; set; }
 86        /// <summary> The version of the Presto server. (i.e. 0.148-t). </summary>
 087        public object ServerVersion { get; set; }
 88        /// <summary> The catalog context for all request against the server. </summary>
 089        public object Catalog { get; set; }
 90        /// <summary> The TCP port that the Presto server uses to listen for client connections. The default value is 80
 091        public object Port { get; set; }
 92        /// <summary> The authentication mechanism used to connect to the Presto server. </summary>
 093        public PrestoAuthenticationType AuthenticationType { get; set; }
 94        /// <summary> The user name used to connect to the Presto server. </summary>
 095        public object Username { get; set; }
 96        /// <summary> The password corresponding to the user name. </summary>
 097        public SecretBase Password { get; set; }
 98        /// <summary> Specifies whether the connections to the server are encrypted using SSL. The default value is fals
 099        public object EnableSsl { get; set; }
 100        /// <summary> The full path of the .pem file containing trusted CA certificates for verifying the server when co
 0101        public object TrustedCertPath { get; set; }
 102        /// <summary> Specifies whether to use a CA certificate from the system trust store or from a specified PEM file
 0103        public object UseSystemTrustStore { get; set; }
 104        /// <summary> Specifies whether to require a CA-issued SSL certificate name to match the host name of the server
 0105        public object AllowHostNameCNMismatch { get; set; }
 106        /// <summary> Specifies whether to allow self-signed certificates from the server. The default value is false. <
 0107        public object AllowSelfSignedServerCert { get; set; }
 108        /// <summary> The local time zone used by the connection. Valid values for this option are specified in the IANA
 0109        public object TimeZoneID { get; set; }
 110        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 0111        public object EncryptedCredential { get; set; }
 112    }
 113}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\PrestoLinkedService.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 PrestoLinkedService : 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("serverVersion");
 057            writer.WriteObjectValue(ServerVersion);
 058            writer.WritePropertyName("catalog");
 059            writer.WriteObjectValue(Catalog);
 060            if (Optional.IsDefined(Port))
 61            {
 062                writer.WritePropertyName("port");
 063                writer.WriteObjectValue(Port);
 64            }
 065            writer.WritePropertyName("authenticationType");
 066            writer.WriteStringValue(AuthenticationType.ToString());
 067            if (Optional.IsDefined(Username))
 68            {
 069                writer.WritePropertyName("username");
 070                writer.WriteObjectValue(Username);
 71            }
 072            if (Optional.IsDefined(Password))
 73            {
 074                writer.WritePropertyName("password");
 075                writer.WriteObjectValue(Password);
 76            }
 077            if (Optional.IsDefined(EnableSsl))
 78            {
 079                writer.WritePropertyName("enableSsl");
 080                writer.WriteObjectValue(EnableSsl);
 81            }
 082            if (Optional.IsDefined(TrustedCertPath))
 83            {
 084                writer.WritePropertyName("trustedCertPath");
 085                writer.WriteObjectValue(TrustedCertPath);
 86            }
 087            if (Optional.IsDefined(UseSystemTrustStore))
 88            {
 089                writer.WritePropertyName("useSystemTrustStore");
 090                writer.WriteObjectValue(UseSystemTrustStore);
 91            }
 092            if (Optional.IsDefined(AllowHostNameCNMismatch))
 93            {
 094                writer.WritePropertyName("allowHostNameCNMismatch");
 095                writer.WriteObjectValue(AllowHostNameCNMismatch);
 96            }
 097            if (Optional.IsDefined(AllowSelfSignedServerCert))
 98            {
 099                writer.WritePropertyName("allowSelfSignedServerCert");
 0100                writer.WriteObjectValue(AllowSelfSignedServerCert);
 101            }
 0102            if (Optional.IsDefined(TimeZoneID))
 103            {
 0104                writer.WritePropertyName("timeZoneID");
 0105                writer.WriteObjectValue(TimeZoneID);
 106            }
 0107            if (Optional.IsDefined(EncryptedCredential))
 108            {
 0109                writer.WritePropertyName("encryptedCredential");
 0110                writer.WriteObjectValue(EncryptedCredential);
 111            }
 0112            writer.WriteEndObject();
 0113            foreach (var item in AdditionalProperties)
 114            {
 0115                writer.WritePropertyName(item.Key);
 0116                writer.WriteObjectValue(item.Value);
 117            }
 0118            writer.WriteEndObject();
 0119        }
 120
 121        internal static PrestoLinkedService DeserializePrestoLinkedService(JsonElement element)
 122        {
 0123            string type = default;
 0124            Optional<IntegrationRuntimeReference> connectVia = default;
 0125            Optional<string> description = default;
 0126            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0127            Optional<IList<object>> annotations = default;
 0128            object host = default;
 0129            object serverVersion = default;
 0130            object catalog = default;
 0131            Optional<object> port = default;
 0132            PrestoAuthenticationType authenticationType = default;
 0133            Optional<object> username = default;
 0134            Optional<SecretBase> password = default;
 0135            Optional<object> enableSsl = default;
 0136            Optional<object> trustedCertPath = default;
 0137            Optional<object> useSystemTrustStore = default;
 0138            Optional<object> allowHostNameCNMismatch = default;
 0139            Optional<object> allowSelfSignedServerCert = default;
 0140            Optional<object> timeZoneID = default;
 0141            Optional<object> encryptedCredential = default;
 0142            IDictionary<string, object> additionalProperties = default;
 0143            Dictionary<string, object> additionalPropertiesDictionary = default;
 0144            foreach (var property in element.EnumerateObject())
 145            {
 0146                if (property.NameEquals("type"))
 147                {
 0148                    type = property.Value.GetString();
 0149                    continue;
 150                }
 0151                if (property.NameEquals("connectVia"))
 152                {
 0153                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0154                    continue;
 155                }
 0156                if (property.NameEquals("description"))
 157                {
 0158                    description = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("parameters"))
 162                {
 0163                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0164                    foreach (var property0 in property.Value.EnumerateObject())
 165                    {
 0166                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 167                    }
 0168                    parameters = dictionary;
 0169                    continue;
 170                }
 0171                if (property.NameEquals("annotations"))
 172                {
 0173                    List<object> array = new List<object>();
 0174                    foreach (var item in property.Value.EnumerateArray())
 175                    {
 0176                        array.Add(item.GetObject());
 177                    }
 0178                    annotations = array;
 0179                    continue;
 180                }
 0181                if (property.NameEquals("typeProperties"))
 182                {
 0183                    foreach (var property0 in property.Value.EnumerateObject())
 184                    {
 0185                        if (property0.NameEquals("host"))
 186                        {
 0187                            host = property0.Value.GetObject();
 0188                            continue;
 189                        }
 0190                        if (property0.NameEquals("serverVersion"))
 191                        {
 0192                            serverVersion = property0.Value.GetObject();
 0193                            continue;
 194                        }
 0195                        if (property0.NameEquals("catalog"))
 196                        {
 0197                            catalog = property0.Value.GetObject();
 0198                            continue;
 199                        }
 0200                        if (property0.NameEquals("port"))
 201                        {
 0202                            port = property0.Value.GetObject();
 0203                            continue;
 204                        }
 0205                        if (property0.NameEquals("authenticationType"))
 206                        {
 0207                            authenticationType = new PrestoAuthenticationType(property0.Value.GetString());
 0208                            continue;
 209                        }
 0210                        if (property0.NameEquals("username"))
 211                        {
 0212                            username = property0.Value.GetObject();
 0213                            continue;
 214                        }
 0215                        if (property0.NameEquals("password"))
 216                        {
 0217                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0218                            continue;
 219                        }
 0220                        if (property0.NameEquals("enableSsl"))
 221                        {
 0222                            enableSsl = property0.Value.GetObject();
 0223                            continue;
 224                        }
 0225                        if (property0.NameEquals("trustedCertPath"))
 226                        {
 0227                            trustedCertPath = property0.Value.GetObject();
 0228                            continue;
 229                        }
 0230                        if (property0.NameEquals("useSystemTrustStore"))
 231                        {
 0232                            useSystemTrustStore = property0.Value.GetObject();
 0233                            continue;
 234                        }
 0235                        if (property0.NameEquals("allowHostNameCNMismatch"))
 236                        {
 0237                            allowHostNameCNMismatch = property0.Value.GetObject();
 0238                            continue;
 239                        }
 0240                        if (property0.NameEquals("allowSelfSignedServerCert"))
 241                        {
 0242                            allowSelfSignedServerCert = property0.Value.GetObject();
 0243                            continue;
 244                        }
 0245                        if (property0.NameEquals("timeZoneID"))
 246                        {
 0247                            timeZoneID = property0.Value.GetObject();
 0248                            continue;
 249                        }
 0250                        if (property0.NameEquals("encryptedCredential"))
 251                        {
 0252                            encryptedCredential = property0.Value.GetObject();
 253                            continue;
 254                        }
 255                    }
 256                    continue;
 257                }
 0258                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0259                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 260            }
 0261            additionalProperties = additionalPropertiesDictionary;
 0262            return new PrestoLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters),
 263        }
 264    }
 265}