< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.WebBasicAuthentication
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebBasicAuthentication.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebBasicAuthentication.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_Username()-0%100%
get_Password()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeWebBasicAuthentication(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebBasicAuthentication.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 basic authentication to communicate with an HTTP endpoint. </summary>
 13    public partial class WebBasicAuthentication : WebLinkedServiceTypeProperties
 14    {
 15        /// <summary> Initializes a new instance of WebBasicAuthentication. </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="username"> User name for Basic authentication. Type: string (or Expression with resultType stri
 18        /// <param name="password"> The password for Basic authentication. </param>
 19        /// <exception cref="ArgumentNullException"> <paramref name="url"/>, <paramref name="username"/>, or <paramref n
 020        public WebBasicAuthentication(object url, object username, SecretBase password) : base(url)
 21        {
 022            if (url == null)
 23            {
 024                throw new ArgumentNullException(nameof(url));
 25            }
 026            if (username == null)
 27            {
 028                throw new ArgumentNullException(nameof(username));
 29            }
 030            if (password == null)
 31            {
 032                throw new ArgumentNullException(nameof(password));
 33            }
 34
 035            Username = username;
 036            Password = password;
 037            AuthenticationType = WebAuthenticationType.Basic;
 038        }
 39
 40        /// <summary> Initializes a new instance of WebBasicAuthentication. </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="username"> User name for Basic authentication. Type: string (or Expression with resultType stri
 44        /// <param name="password"> The password for Basic authentication. </param>
 045        internal WebBasicAuthentication(object url, WebAuthenticationType authenticationType, object username, SecretBas
 46        {
 047            Username = username;
 048            Password = password;
 049            AuthenticationType = authenticationType;
 050        }
 51
 52        /// <summary> User name for Basic authentication. Type: string (or Expression with resultType string). </summary
 053        public object Username { get; set; }
 54        /// <summary> The password for Basic authentication. </summary>
 055        public SecretBase Password { get; set; }
 56    }
 57}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebBasicAuthentication.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 WebBasicAuthentication : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("username");
 019            writer.WriteObjectValue(Username);
 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 WebBasicAuthentication DeserializeWebBasicAuthentication(JsonElement element)
 30        {
 031            object username = 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("username"))
 38                {
 039                    username = property.Value.GetObject();
 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 WebBasicAuthentication(url, authenticationType, username, password);
 59        }
 60    }
 61}