< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.ServiceNowLinkedService
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ServiceNowLinkedService.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ServiceNowLinkedService.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_Endpoint()-0%100%
get_AuthenticationType()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_ClientId()-0%100%
get_ClientSecret()-0%100%
get_UseEncryptedEndpoints()-0%100%
get_UseHostVerification()-0%100%
get_UsePeerVerification()-0%100%
get_EncryptedCredential()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeServiceNowLinkedService(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\ServiceNowLinkedService.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> ServiceNow server linked service. </summary>
 14    public partial class ServiceNowLinkedService : LinkedService
 15    {
 16        /// <summary> Initializes a new instance of ServiceNowLinkedService. </summary>
 17        /// <param name="endpoint"> The endpoint of the ServiceNow server. (i.e. &lt;instance&gt;.service-now.com). </pa
 18        /// <param name="authenticationType"> The authentication type to use. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="endpoint"/> is null. </exception>
 020        public ServiceNowLinkedService(object endpoint, ServiceNowAuthenticationType authenticationType)
 21        {
 022            if (endpoint == null)
 23            {
 024                throw new ArgumentNullException(nameof(endpoint));
 25            }
 26
 027            Endpoint = endpoint;
 028            AuthenticationType = authenticationType;
 029            Type = "ServiceNow";
 030        }
 31
 32        /// <summary> Initializes a new instance of ServiceNowLinkedService. </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="endpoint"> The endpoint of the ServiceNow server. (i.e. &lt;instance&gt;.service-now.com). </pa
 40        /// <param name="authenticationType"> The authentication type to use. </param>
 41        /// <param name="username"> The user name used to connect to the ServiceNow server for Basic and OAuth2 authenti
 42        /// <param name="password"> The password corresponding to the user name for Basic and OAuth2 authentication. </p
 43        /// <param name="clientId"> The client id for OAuth2 authentication. </param>
 44        /// <param name="clientSecret"> The client secret for OAuth2 authentication. </param>
 45        /// <param name="useEncryptedEndpoints"> Specifies whether the data source endpoints are encrypted using HTTPS. 
 46        /// <param name="useHostVerification"> Specifies whether to require the host name in the server&apos;s certifica
 47        /// <param name="usePeerVerification"> Specifies whether to verify the identity of the server when connecting ov
 48        /// <param name="encryptedCredential"> The encrypted credential used for authentication. Credentials are encrypt
 049        internal ServiceNowLinkedService(string type, IntegrationRuntimeReference connectVia, string description, IDicti
 50        {
 051            Endpoint = endpoint;
 052            AuthenticationType = authenticationType;
 053            Username = username;
 054            Password = password;
 055            ClientId = clientId;
 056            ClientSecret = clientSecret;
 057            UseEncryptedEndpoints = useEncryptedEndpoints;
 058            UseHostVerification = useHostVerification;
 059            UsePeerVerification = usePeerVerification;
 060            EncryptedCredential = encryptedCredential;
 061            Type = type ?? "ServiceNow";
 062        }
 63
 64        /// <summary> The endpoint of the ServiceNow server. (i.e. &lt;instance&gt;.service-now.com). </summary>
 065        public object Endpoint { get; set; }
 66        /// <summary> The authentication type to use. </summary>
 067        public ServiceNowAuthenticationType AuthenticationType { get; set; }
 68        /// <summary> The user name used to connect to the ServiceNow server for Basic and OAuth2 authentication. </summ
 069        public object Username { get; set; }
 70        /// <summary> The password corresponding to the user name for Basic and OAuth2 authentication. </summary>
 071        public SecretBase Password { get; set; }
 72        /// <summary> The client id for OAuth2 authentication. </summary>
 073        public object ClientId { get; set; }
 74        /// <summary> The client secret for OAuth2 authentication. </summary>
 075        public SecretBase ClientSecret { get; set; }
 76        /// <summary> Specifies whether the data source endpoints are encrypted using HTTPS. The default value is true. 
 077        public object UseEncryptedEndpoints { get; set; }
 78        /// <summary> Specifies whether to require the host name in the server&apos;s certificate to match the host name
 079        public object UseHostVerification { get; set; }
 80        /// <summary> Specifies whether to verify the identity of the server when connecting over SSL. The default value
 081        public object UsePeerVerification { 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\ServiceNowLinkedService.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 ServiceNowLinkedService : 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("endpoint");
 055            writer.WriteObjectValue(Endpoint);
 056            writer.WritePropertyName("authenticationType");
 057            writer.WriteStringValue(AuthenticationType.ToString());
 058            if (Optional.IsDefined(Username))
 59            {
 060                writer.WritePropertyName("username");
 061                writer.WriteObjectValue(Username);
 62            }
 063            if (Optional.IsDefined(Password))
 64            {
 065                writer.WritePropertyName("password");
 066                writer.WriteObjectValue(Password);
 67            }
 068            if (Optional.IsDefined(ClientId))
 69            {
 070                writer.WritePropertyName("clientId");
 071                writer.WriteObjectValue(ClientId);
 72            }
 073            if (Optional.IsDefined(ClientSecret))
 74            {
 075                writer.WritePropertyName("clientSecret");
 076                writer.WriteObjectValue(ClientSecret);
 77            }
 078            if (Optional.IsDefined(UseEncryptedEndpoints))
 79            {
 080                writer.WritePropertyName("useEncryptedEndpoints");
 081                writer.WriteObjectValue(UseEncryptedEndpoints);
 82            }
 083            if (Optional.IsDefined(UseHostVerification))
 84            {
 085                writer.WritePropertyName("useHostVerification");
 086                writer.WriteObjectValue(UseHostVerification);
 87            }
 088            if (Optional.IsDefined(UsePeerVerification))
 89            {
 090                writer.WritePropertyName("usePeerVerification");
 091                writer.WriteObjectValue(UsePeerVerification);
 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 ServiceNowLinkedService DeserializeServiceNowLinkedService(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 endpoint = default;
 0115            ServiceNowAuthenticationType authenticationType = default;
 0116            Optional<object> username = default;
 0117            Optional<SecretBase> password = default;
 0118            Optional<object> clientId = default;
 0119            Optional<SecretBase> clientSecret = default;
 0120            Optional<object> useEncryptedEndpoints = default;
 0121            Optional<object> useHostVerification = default;
 0122            Optional<object> usePeerVerification = 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("endpoint"))
 168                        {
 0169                            endpoint = property0.Value.GetObject();
 0170                            continue;
 171                        }
 0172                        if (property0.NameEquals("authenticationType"))
 173                        {
 0174                            authenticationType = new ServiceNowAuthenticationType(property0.Value.GetString());
 0175                            continue;
 176                        }
 0177                        if (property0.NameEquals("username"))
 178                        {
 0179                            username = property0.Value.GetObject();
 0180                            continue;
 181                        }
 0182                        if (property0.NameEquals("password"))
 183                        {
 0184                            password = SecretBase.DeserializeSecretBase(property0.Value);
 0185                            continue;
 186                        }
 0187                        if (property0.NameEquals("clientId"))
 188                        {
 0189                            clientId = property0.Value.GetObject();
 0190                            continue;
 191                        }
 0192                        if (property0.NameEquals("clientSecret"))
 193                        {
 0194                            clientSecret = SecretBase.DeserializeSecretBase(property0.Value);
 0195                            continue;
 196                        }
 0197                        if (property0.NameEquals("useEncryptedEndpoints"))
 198                        {
 0199                            useEncryptedEndpoints = property0.Value.GetObject();
 0200                            continue;
 201                        }
 0202                        if (property0.NameEquals("useHostVerification"))
 203                        {
 0204                            useHostVerification = property0.Value.GetObject();
 0205                            continue;
 206                        }
 0207                        if (property0.NameEquals("usePeerVerification"))
 208                        {
 0209                            usePeerVerification = 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 ServiceNowLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(paramete
 225        }
 226    }
 227}