< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Pfx()-0%100%
get_Password()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeWebClientCertificateAuthentication(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebClientCertificateAuthentication.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;
 9
 10namespace Azure.Analytics.Synapse.Artifacts.Models
 11{
 12    /// <summary> A WebLinkedService that uses client certificate based authentication to communicate with an HTTP endpo
 13    public partial class WebClientCertificateAuthentication : WebLinkedServiceTypeProperties
 14    {
 15        /// <summary> Initializes a new instance of WebClientCertificateAuthentication. </summary>
 16        /// <param name="url"> The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Exp
 17        /// <param name="pfx"> Base64-encoded contents of a PFX file. </param>
 18        /// <param name="password"> Password for the PFX file. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="url"/>, <paramref name="pfx"/>, or <paramref name="
 020        public WebClientCertificateAuthentication(object url, SecretBase pfx, SecretBase password) : base(url)
 21        {
 022            if (url == null)
 23            {
 024                throw new ArgumentNullException(nameof(url));
 25            }
 026            if (pfx == null)
 27            {
 028                throw new ArgumentNullException(nameof(pfx));
 29            }
 030            if (password == null)
 31            {
 032                throw new ArgumentNullException(nameof(password));
 33            }
 34
 035            Pfx = pfx;
 036            Password = password;
 037            AuthenticationType = WebAuthenticationType.ClientCertificate;
 038        }
 39
 40        /// <summary> Initializes a new instance of WebClientCertificateAuthentication. </summary>
 41        /// <param name="url"> The URL of the web service endpoint, e.g. http://www.microsoft.com . Type: string (or Exp
 42        /// <param name="authenticationType"> Type of authentication used to connect to the web table source. </param>
 43        /// <param name="pfx"> Base64-encoded contents of a PFX file. </param>
 44        /// <param name="password"> Password for the PFX file. </param>
 045        internal WebClientCertificateAuthentication(object url, WebAuthenticationType authenticationType, SecretBase pfx
 46        {
 047            Pfx = pfx;
 048            Password = password;
 049            AuthenticationType = authenticationType;
 050        }
 51
 52        /// <summary> Base64-encoded contents of a PFX file. </summary>
 053        public SecretBase Pfx { get; set; }
 54        /// <summary> Password for the PFX file. </summary>
 055        public SecretBase Password { get; set; }
 56    }
 57}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebClientCertificateAuthentication.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Analytics.Synapse.Artifacts.Models
 12{
 13    public partial class WebClientCertificateAuthentication : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("pfx");
 019            writer.WriteObjectValue(Pfx);
 020            writer.WritePropertyName("password");
 021            writer.WriteObjectValue(Password);
 022            writer.WritePropertyName("url");
 023            writer.WriteObjectValue(Url);
 024            writer.WritePropertyName("authenticationType");
 025            writer.WriteStringValue(AuthenticationType.ToString());
 026            writer.WriteEndObject();
 027        }
 28
 29        internal static WebClientCertificateAuthentication DeserializeWebClientCertificateAuthentication(JsonElement ele
 30        {
 031            SecretBase pfx = default;
 032            SecretBase password = default;
 033            object url = default;
 034            WebAuthenticationType authenticationType = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("pfx"))
 38                {
 039                    pfx = SecretBase.DeserializeSecretBase(property.Value);
 040                    continue;
 41                }
 042                if (property.NameEquals("password"))
 43                {
 044                    password = SecretBase.DeserializeSecretBase(property.Value);
 045                    continue;
 46                }
 047                if (property.NameEquals("url"))
 48                {
 049                    url = property.Value.GetObject();
 050                    continue;
 51                }
 052                if (property.NameEquals("authenticationType"))
 53                {
 054                    authenticationType = new WebAuthenticationType(property.Value.GetString());
 55                    continue;
 56                }
 57            }
 058            return new WebClientCertificateAuthentication(url, authenticationType, pfx, password);
 59        }
 60    }
 61}