< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Host()-0%100%
get_Port()-0%100%
get_AuthenticationType()-0%100%
get_UserName()-0%100%
get_Password()-0%100%
get_EncryptedCredential()-0%100%
get_PrivateKeyPath()-0%100%
get_PrivateKeyContent()-0%100%
get_PassPhrase()-0%100%
get_SkipHostKeyValidation()-0%100%
get_HostKeyFingerprint()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSftpServerLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SftpServerLinkedService.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> A linked service for an SSH File Transfer Protocol (SFTP) server. </summary>
 14    public partial class SftpServerLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of SftpServerLinkedService. </summary>
 17        /// <param name="host"> The SFTP server host name. Type: string (or Expression with resultType string). </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="host"/> is null. </exception>
 019        public SftpServerLinkedService(object host)
 20        {
 021            if (host == null)
 22            {
 023                throw new ArgumentNullException(nameof(host));
 24            }
 25
 026            Host = host;
 027            Type = "Sftp";
 028        }
 29
 30        /// <summary> Initializes a new instance of SftpServerLinkedService. </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="host"> The SFTP server host name. Type: string (or Expression with resultType string). </param>
 38        /// <param name="port"> The TCP port number that the SFTP server uses to listen for client connections. Default 
 39        /// <param name="authenticationType"> The authentication type to be used to connect to the FTP server. </param>
 40        /// <param name="userName"> The username used to log on to the SFTP server. Type: string (or Expression with res
 41        /// <param name="password"> Password to logon the SFTP server for Basic authentication. </param>
 42        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 43        /// <param name="privateKeyPath"> The SSH private key file path for SshPublicKey authentication. Only valid for 
 44        /// <param name="privateKeyContent"> Base64 encoded SSH private key content for SshPublicKey authentication. For
 45        /// <param name="passPhrase"> The password to decrypt the SSH private key if the SSH private key is encrypted. <
 46        /// <param name="skipHostKeyValidation"> If true, skip the SSH host key validation. Default value is false. Type
 47        /// <param name="hostKeyFingerprint"> The host key finger-print of the SFTP server. When SkipHostKeyValidation i
 048        internal SftpServerLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDicti
 49        {
 050            Host = host;
 051            Port = port;
 052            AuthenticationType = authenticationType;
 053            UserName = userName;
 054            Password = password;
 055            EncryptedCredential = encryptedCredential;
 056            PrivateKeyPath = privateKeyPath;
 057            PrivateKeyContent = privateKeyContent;
 058            PassPhrase = passPhrase;
 059            SkipHostKeyValidation = skipHostKeyValidation;
 060            HostKeyFingerprint = hostKeyFingerprint;
 061            Type = type ?? "Sftp";
 062        }
 63
 64        /// <summary> The SFTP server host name. Type: string (or Expression with resultType string). </summary>
 065        public object Host { get; set; }
 66        /// <summary> The TCP port number that the SFTP server uses to listen for client connections. Default value is 2
 067        public object Port { get; set; }
 68        /// <summary> The authentication type to be used to connect to the FTP server. </summary>
 069        public SftpAuthenticationType? AuthenticationType { get; set; }
 70        /// <summary> The username used to log on to the SFTP server. Type: string (or Expression with resultType string
 071        public object UserName { get; set; }
 72        /// <summary> Password to logon the SFTP server for Basic authentication. </summary>
 073        public SecretBase Password { get; set; }
 74        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 075        public object EncryptedCredential { get; set; }
 76        /// <summary> The SSH private key file path for SshPublicKey authentication. Only valid for on-premises copy. Fo
 077        public object PrivateKeyPath { get; set; }
 78        /// <summary> Base64 encoded SSH private key content for SshPublicKey authentication. For on-premises copy with 
 079        public SecretBase PrivateKeyContent { get; set; }
 80        /// <summary> The password to decrypt the SSH private key if the SSH private key is encrypted. </summary>
 081        public SecretBase PassPhrase { get; set; }
 82        /// <summary> If true, skip the SSH host key validation. Default value is false. Type: boolean (or Expression wi
 083        public object SkipHostKeyValidation { get; set; }
 84        /// <summary> The host key finger-print of the SFTP server. When SkipHostKeyValidation is false, HostKeyFingerpr
 085        public object HostKeyFingerprint { get; set; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SftpServerLinkedService.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 SftpServerLinkedService : 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            if (Optional.IsDefined(Port))
 57            {
 058                writer.WritePropertyName("port");
 059                writer.WriteObjectValue(Port);
 60            }
 061            if (Optional.IsDefined(AuthenticationType))
 62            {
 063                writer.WritePropertyName("authenticationType");
 064                writer.WriteStringValue(AuthenticationType.Value.ToString());
 65            }
 066            if (Optional.IsDefined(UserName))
 67            {
 068                writer.WritePropertyName("userName");
 069                writer.WriteObjectValue(UserName);
 70            }
 071            if (Optional.IsDefined(Password))
 72            {
 073                writer.WritePropertyName("password");
 074                writer.WriteObjectValue(Password);
 75            }
 076            if (Optional.IsDefined(EncryptedCredential))
 77            {
 078                writer.WritePropertyName("encryptedCredential");
 079                writer.WriteObjectValue(EncryptedCredential);
 80            }
 081            if (Optional.IsDefined(PrivateKeyPath))
 82            {
 083                writer.WritePropertyName("privateKeyPath");
 084                writer.WriteObjectValue(PrivateKeyPath);
 85            }
 086            if (Optional.IsDefined(PrivateKeyContent))
 87            {
 088                writer.WritePropertyName("privateKeyContent");
 089                writer.WriteObjectValue(PrivateKeyContent);
 90            }
 091            if (Optional.IsDefined(PassPhrase))
 92            {
 093                writer.WritePropertyName("passPhrase");
 094                writer.WriteObjectValue(PassPhrase);
 95            }
 096            if (Optional.IsDefined(SkipHostKeyValidation))
 97            {
 098                writer.WritePropertyName("skipHostKeyValidation");
 099                writer.WriteObjectValue(SkipHostKeyValidation);
 100            }
 0101            if (Optional.IsDefined(HostKeyFingerprint))
 102            {
 0103                writer.WritePropertyName("hostKeyFingerprint");
 0104                writer.WriteObjectValue(HostKeyFingerprint);
 105            }
 0106            writer.WriteEndObject();
 0107            foreach (var item in AdditionalProperties)
 108            {
 0109                writer.WritePropertyName(item.Key);
 0110                writer.WriteObjectValue(item.Value);
 111            }
 0112            writer.WriteEndObject();
 0113        }
 114
 115        internal static SftpServerLinkedService DeserializeSftpServerLinkedService(JsonElement element)
 116        {
 0117            string type = default;
 0118            Optional<IntegrationRuntimeReference> connectVia = default;
 0119            Optional<string> description = default;
 0120            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 0121            Optional<IList<object>> annotations = default;
 0122            object host = default;
 0123            Optional<object> port = default;
 0124            Optional<SftpAuthenticationType> authenticationType = default;
 0125            Optional<object> userName = default;
 0126            Optional<SecretBase> password = default;
 0127            Optional<object> encryptedCredential = default;
 0128            Optional<object> privateKeyPath = default;
 0129            Optional<SecretBase> privateKeyContent = default;
 0130            Optional<SecretBase> passPhrase = default;
 0131            Optional<object> skipHostKeyValidation = default;
 0132            Optional<object> hostKeyFingerprint = default;
 0133            IDictionary<string, object> additionalProperties = default;
 0134            Dictionary<string, object> additionalPropertiesDictionary = default;
 0135            foreach (var property in element.EnumerateObject())
 136            {
 0137                if (property.NameEquals("type"))
 138                {
 0139                    type = property.Value.GetString();
 0140                    continue;
 141                }
 0142                if (property.NameEquals("connectVia"))
 143                {
 0144                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0145                    continue;
 146                }
 0147                if (property.NameEquals("description"))
 148                {
 0149                    description = property.Value.GetString();
 0150                    continue;
 151                }
 0152                if (property.NameEquals("parameters"))
 153                {
 0154                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0155                    foreach (var property0 in property.Value.EnumerateObject())
 156                    {
 0157                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 158                    }
 0159                    parameters = dictionary;
 0160                    continue;
 161                }
 0162                if (property.NameEquals("annotations"))
 163                {
 0164                    List<object> array = new List<object>();
 0165                    foreach (var item in property.Value.EnumerateArray())
 166                    {
 0167                        array.Add(item.GetObject());
 168                    }
 0169                    annotations = array;
 0170                    continue;
 171                }
 0172                if (property.NameEquals("typeProperties"))
 173                {
 0174                    foreach (var property0 in property.Value.EnumerateObject())
 175                    {
 0176                        if (property0.NameEquals("host"))
 177                        {
 0178                            host = property0.Value.GetObject();
 0179                            continue;
 180                        }
 0181                        if (property0.NameEquals("port"))
 182                        {
 0183                            port = property0.Value.GetObject();
 0184                            continue;
 185                        }
 0186                        if (property0.NameEquals("authenticationType"))
 187                        {
 0188                            authenticationType = new SftpAuthenticationType(property0.Value.GetString());
 0189                            continue;
 190                        }
 0191                        if (property0.NameEquals("userName"))
 192                        {
 0193                            userName = property0.Value.GetObject();
 0194                            continue;
 195                        }
 0196                        if (property0.NameEquals("password"))
 197                        {
 0198                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0199                            continue;
 200                        }
 0201                        if (property0.NameEquals("encryptedCredential"))
 202                        {
 0203                            encryptedCredential = property0.Value.GetObject();
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("privateKeyPath"))
 207                        {
 0208                            privateKeyPath = property0.Value.GetObject();
 0209                            continue;
 210                        }
 0211                        if (property0.NameEquals("privateKeyContent"))
 212                        {
 0213                            privateKeyContent = SecretBase.DeserializeSecretBase(property0.Value);
 0214                            continue;
 215                        }
 0216                        if (property0.NameEquals("passPhrase"))
 217                        {
 0218                            passPhrase = SecretBase.DeserializeSecretBase(property0.Value);
 0219                            continue;
 220                        }
 0221                        if (property0.NameEquals("skipHostKeyValidation"))
 222                        {
 0223                            skipHostKeyValidation = property0.Value.GetObject();
 0224                            continue;
 225                        }
 0226                        if (property0.NameEquals("hostKeyFingerprint"))
 227                        {
 0228                            hostKeyFingerprint = property0.Value.GetObject();
 229                            continue;
 230                        }
 231                    }
 232                    continue;
 233                }
 0234                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0235                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 236            }
 0237            additionalProperties = additionalPropertiesDictionary;
 0238            return new SftpServerLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(paramete
 239        }
 240    }
 241}