< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_Server()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_Database()-0%100%
get_Port()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAmazonRedshiftLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AmazonRedshiftLinkedService.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> Linked service for Amazon Redshift. </summary>
 14    public partial class AmazonRedshiftLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of AmazonRedshiftLinkedService. </summary>
 17        /// <param name="server"> The name of the Amazon Redshift server. Type: string (or Expression with resultType st
 18        /// <param name="database"> The database name of the Amazon Redshift source. Type: string (or Expression with re
 19        /// <exception cref="ArgumentNullException"> <paramref name="server"/> or <paramref name="database"/> is null. <
 020        public AmazonRedshiftLinkedService(object server, object database)
 21        {
 022            if (server == null)
 23            {
 024                throw new ArgumentNullException(nameof(server));
 25            }
 026            if (database == null)
 27            {
 028                throw new ArgumentNullException(nameof(database));
 29            }
 30
 031            Server = server;
 032            Database = database;
 033            Type = "AmazonRedshift";
 034        }
 35
 36        /// <summary> Initializes a new instance of AmazonRedshiftLinkedService. </summary>
 37        /// <param name="type"> Type of linked service. </param>
 38        /// <param name="connectVia"> The integration runtime reference. </param>
 39        /// <param name="description"> Linked service description. </param>
 40        /// <param name="parameters"> Parameters for linked service. </param>
 41        /// <param name="annotations"> List of tags that can be used for describing the linked service. </param>
 42        /// <param name="additionalProperties"> . </param>
 43        /// <param name="server"> The name of the Amazon Redshift server. Type: string (or Expression with resultType st
 44        /// <param name="username"> The username of the Amazon Redshift source. Type: string (or Expression with resultT
 45        /// <param name="password"> The password of the Amazon Redshift source. </param>
 46        /// <param name="database"> The database name of the Amazon Redshift source. Type: string (or Expression with re
 47        /// <param name="port"> The TCP port number that the Amazon Redshift server uses to listen for client connection
 48        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 049        internal AmazonRedshiftLinkedService(string type, IntegrationRuntimeReference connectVia, string description, ID
 50        {
 051            Server = server;
 052            Username = username;
 053            Password = password;
 054            Database = database;
 055            Port = port;
 056            EncryptedCredential = encryptedCredential;
 057            Type = type ?? "AmazonRedshift";
 058        }
 59
 60        /// <summary> The name of the Amazon Redshift server. Type: string (or Expression with resultType string). </sum
 061        public object Server { get; set; }
 62        /// <summary> The username of the Amazon Redshift source. Type: string (or Expression with resultType string). <
 063        public object Username { get; set; }
 64        /// <summary> The password of the Amazon Redshift source. </summary>
 065        public SecretBase Password { get; set; }
 66        /// <summary> The database name of the Amazon Redshift source. Type: string (or Expression with resultType strin
 067        public object Database { get; set; }
 68        /// <summary> The TCP port number that the Amazon Redshift server uses to listen for client connections. The def
 069        public object Port { get; set; }
 70        /// <summary> The encrypted credential used for authentication. Credentials are encrypted using the integration 
 071        public object EncryptedCredential { get; set; }
 72    }
 73}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\AmazonRedshiftLinkedService.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 AmazonRedshiftLinkedService : 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("server");
 055            writer.WriteObjectValue(Server);
 056            if (Optional.IsDefined(Username))
 57            {
 058                writer.WritePropertyName("username");
 059                writer.WriteObjectValue(Username);
 60            }
 061            if (Optional.IsDefined(Password))
 62            {
 063                writer.WritePropertyName("password");
 064                writer.WriteObjectValue(Password);
 65            }
 066            writer.WritePropertyName("database");
 067            writer.WriteObjectValue(Database);
 068            if (Optional.IsDefined(Port))
 69            {
 070                writer.WritePropertyName("port");
 071                writer.WriteObjectValue(Port);
 72            }
 073            if (Optional.IsDefined(EncryptedCredential))
 74            {
 075                writer.WritePropertyName("encryptedCredential");
 076                writer.WriteObjectValue(EncryptedCredential);
 77            }
 078            writer.WriteEndObject();
 079            foreach (var item in AdditionalProperties)
 80            {
 081                writer.WritePropertyName(item.Key);
 082                writer.WriteObjectValue(item.Value);
 83            }
 084            writer.WriteEndObject();
 085        }
 86
 87        internal static AmazonRedshiftLinkedService DeserializeAmazonRedshiftLinkedService(JsonElement element)
 88        {
 089            string type = default;
 090            Optional<IntegrationRuntimeReference> connectVia = default;
 091            Optional<string> description = default;
 092            Optional<IDictionary<string, ParameterSpecification>> parameters = default;
 093            Optional<IList<object>> annotations = default;
 094            object server = default;
 095            Optional<object> username = default;
 096            Optional<SecretBase> password = default;
 097            object database = default;
 098            Optional<object> port = default;
 099            Optional<object> encryptedCredential = default;
 0100            IDictionary<string, object> additionalProperties = default;
 0101            Dictionary<string, object> additionalPropertiesDictionary = default;
 0102            foreach (var property in element.EnumerateObject())
 103            {
 0104                if (property.NameEquals("type"))
 105                {
 0106                    type = property.Value.GetString();
 0107                    continue;
 108                }
 0109                if (property.NameEquals("connectVia"))
 110                {
 0111                    connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value);
 0112                    continue;
 113                }
 0114                if (property.NameEquals("description"))
 115                {
 0116                    description = property.Value.GetString();
 0117                    continue;
 118                }
 0119                if (property.NameEquals("parameters"))
 120                {
 0121                    Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio
 0122                    foreach (var property0 in property.Value.EnumerateObject())
 123                    {
 0124                        dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property
 125                    }
 0126                    parameters = dictionary;
 0127                    continue;
 128                }
 0129                if (property.NameEquals("annotations"))
 130                {
 0131                    List<object> array = new List<object>();
 0132                    foreach (var item in property.Value.EnumerateArray())
 133                    {
 0134                        array.Add(item.GetObject());
 135                    }
 0136                    annotations = array;
 0137                    continue;
 138                }
 0139                if (property.NameEquals("typeProperties"))
 140                {
 0141                    foreach (var property0 in property.Value.EnumerateObject())
 142                    {
 0143                        if (property0.NameEquals("server"))
 144                        {
 0145                            server = property0.Value.GetObject();
 0146                            continue;
 147                        }
 0148                        if (property0.NameEquals("username"))
 149                        {
 0150                            username = property0.Value.GetObject();
 0151                            continue;
 152                        }
 0153                        if (property0.NameEquals("password"))
 154                        {
 0155                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0156                            continue;
 157                        }
 0158                        if (property0.NameEquals("database"))
 159                        {
 0160                            database = property0.Value.GetObject();
 0161                            continue;
 162                        }
 0163                        if (property0.NameEquals("port"))
 164                        {
 0165                            port = property0.Value.GetObject();
 0166                            continue;
 167                        }
 0168                        if (property0.NameEquals("encryptedCredential"))
 169                        {
 0170                            encryptedCredential = property0.Value.GetObject();
 171                            continue;
 172                        }
 173                    }
 174                    continue;
 175                }
 0176                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0177                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 178            }
 0179            additionalProperties = additionalPropertiesDictionary;
 0180            return new AmazonRedshiftLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(para
 181        }
 182    }
 183}