< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Type()-0%100%
get_Pfx()-0%100%
get_Username()-0%100%
get_Password()-0%100%
get_Resource()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeWebActivityAuthentication(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebActivityAuthentication.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> Web activity authentication properties. </summary>
 13    public partial class WebActivityAuthentication
 14    {
 15        /// <summary> Initializes a new instance of WebActivityAuthentication. </summary>
 16        /// <param name="type"> Web activity authentication (Basic/ClientCertificate/MSI). </param>
 17        /// <exception cref="ArgumentNullException"> <paramref name="type"/> is null. </exception>
 018        public WebActivityAuthentication(string type)
 19        {
 020            if (type == null)
 21            {
 022                throw new ArgumentNullException(nameof(type));
 23            }
 24
 025            Type = type;
 026        }
 27
 28        /// <summary> Initializes a new instance of WebActivityAuthentication. </summary>
 29        /// <param name="type"> Web activity authentication (Basic/ClientCertificate/MSI). </param>
 30        /// <param name="pfx"> Base64-encoded contents of a PFX file. </param>
 31        /// <param name="username"> Web activity authentication user name for basic authentication. </param>
 32        /// <param name="password"> Password for the PFX file or basic authentication. </param>
 33        /// <param name="resource"> Resource for which Azure Auth token will be requested when using MSI Authentication.
 034        internal WebActivityAuthentication(string type, SecretBase pfx, string username, SecretBase password, string res
 35        {
 036            Type = type;
 037            Pfx = pfx;
 038            Username = username;
 039            Password = password;
 040            Resource = resource;
 041        }
 42
 43        /// <summary> Web activity authentication (Basic/ClientCertificate/MSI). </summary>
 044        public string Type { get; set; }
 45        /// <summary> Base64-encoded contents of a PFX file. </summary>
 046        public SecretBase Pfx { get; set; }
 47        /// <summary> Web activity authentication user name for basic authentication. </summary>
 048        public string Username { get; set; }
 49        /// <summary> Password for the PFX file or basic authentication. </summary>
 050        public SecretBase Password { get; set; }
 51        /// <summary> Resource for which Azure Auth token will be requested when using MSI Authentication. </summary>
 052        public string Resource { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\WebActivityAuthentication.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 WebActivityAuthentication : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("type");
 019            writer.WriteStringValue(Type);
 020            if (Optional.IsDefined(Pfx))
 21            {
 022                writer.WritePropertyName("pfx");
 023                writer.WriteObjectValue(Pfx);
 24            }
 025            if (Optional.IsDefined(Username))
 26            {
 027                writer.WritePropertyName("username");
 028                writer.WriteStringValue(Username);
 29            }
 030            if (Optional.IsDefined(Password))
 31            {
 032                writer.WritePropertyName("password");
 033                writer.WriteObjectValue(Password);
 34            }
 035            if (Optional.IsDefined(Resource))
 36            {
 037                writer.WritePropertyName("resource");
 038                writer.WriteStringValue(Resource);
 39            }
 040            writer.WriteEndObject();
 041        }
 42
 43        internal static WebActivityAuthentication DeserializeWebActivityAuthentication(JsonElement element)
 44        {
 045            string type = default;
 046            Optional<SecretBase> pfx = default;
 047            Optional<string> username = default;
 048            Optional<SecretBase> password = default;
 049            Optional<string> resource = default;
 050            foreach (var property in element.EnumerateObject())
 51            {
 052                if (property.NameEquals("type"))
 53                {
 054                    type = property.Value.GetString();
 055                    continue;
 56                }
 057                if (property.NameEquals("pfx"))
 58                {
 059                    pfx = SecretBase.DeserializeSecretBase(property.Value);
 060                    continue;
 61                }
 062                if (property.NameEquals("username"))
 63                {
 064                    username = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("password"))
 68                {
 069                    password = SecretBase.DeserializeSecretBase(property.Value);
 070                    continue;
 71                }
 072                if (property.NameEquals("resource"))
 73                {
 074                    resource = property.Value.GetString();
 75                    continue;
 76                }
 77            }
 078            return new WebActivityAuthentication(type, pfx.Value, username.Value, password.Value, resource.Value);
 79        }
 80    }
 81}