< Summary

Class:Azure.ResourceManager.Network.Models.FirewallPolicyTransportSecurity
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyTransportSecurity.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyTransportSecurity.Serialization.cs
Covered lines:0
Uncovered lines:54
Coverable lines:54
Total lines:147
Line coverage:0% (0 of 54)
Covered branches:0
Total branches:32
Branch coverage:0% (0 of 32)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_CertificateAuthority()-0%100%
get_ExcludedDomains()-0%100%
get_TrustedRootCertificates()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFirewallPolicyTransportSecurity(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyTransportSecurity.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;
 9
 10namespace Azure.ResourceManager.Network.Models
 11{
 12    /// <summary> Configuration needed to perform TLS termination &amp; initiation. </summary>
 13    public partial class FirewallPolicyTransportSecurity
 14    {
 15        /// <summary> Initializes a new instance of FirewallPolicyTransportSecurity. </summary>
 016        public FirewallPolicyTransportSecurity()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FirewallPolicyTransportSecurity. </summary>
 21        /// <param name="certificateAuthority"> The CA used for intermediate CA generation. </param>
 22        /// <param name="excludedDomains"> List of domains which are excluded from TLS termination. </param>
 23        /// <param name="trustedRootCertificates"> Certificates which are to be trusted by the firewall. </param>
 024        internal FirewallPolicyTransportSecurity(FirewallPolicyCertificateAuthority certificateAuthority, IList<string> 
 25        {
 026            CertificateAuthority = certificateAuthority;
 027            ExcludedDomains = excludedDomains;
 028            TrustedRootCertificates = trustedRootCertificates;
 029        }
 30
 31        /// <summary> The CA used for intermediate CA generation. </summary>
 032        public FirewallPolicyCertificateAuthority CertificateAuthority { get; set; }
 33        /// <summary> List of domains which are excluded from TLS termination. </summary>
 034        public IList<string> ExcludedDomains { get; set; }
 35        /// <summary> Certificates which are to be trusted by the firewall. </summary>
 036        public IList<FirewallPolicyTrustedRootCertificate> TrustedRootCertificates { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyTransportSecurity.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.ResourceManager.Network.Models
 13{
 14    public partial class FirewallPolicyTransportSecurity : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (CertificateAuthority != null)
 20            {
 021                writer.WritePropertyName("certificateAuthority");
 022                writer.WriteObjectValue(CertificateAuthority);
 23            }
 024            if (ExcludedDomains != null)
 25            {
 026                writer.WritePropertyName("excludedDomains");
 027                writer.WriteStartArray();
 028                foreach (var item in ExcludedDomains)
 29                {
 030                    writer.WriteStringValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            if (TrustedRootCertificates != null)
 35            {
 036                writer.WritePropertyName("trustedRootCertificates");
 037                writer.WriteStartArray();
 038                foreach (var item in TrustedRootCertificates)
 39                {
 040                    writer.WriteObjectValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 044            writer.WriteEndObject();
 045        }
 46
 47        internal static FirewallPolicyTransportSecurity DeserializeFirewallPolicyTransportSecurity(JsonElement element)
 48        {
 049            FirewallPolicyCertificateAuthority certificateAuthority = default;
 050            IList<string> excludedDomains = default;
 051            IList<FirewallPolicyTrustedRootCertificate> trustedRootCertificates = default;
 052            foreach (var property in element.EnumerateObject())
 53            {
 054                if (property.NameEquals("certificateAuthority"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    certificateAuthority = FirewallPolicyCertificateAuthority.DeserializeFirewallPolicyCertificateAuthor
 061                    continue;
 62                }
 063                if (property.NameEquals("excludedDomains"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    List<string> array = new List<string>();
 070                    foreach (var item in property.Value.EnumerateArray())
 71                    {
 072                        if (item.ValueKind == JsonValueKind.Null)
 73                        {
 074                            array.Add(null);
 75                        }
 76                        else
 77                        {
 078                            array.Add(item.GetString());
 79                        }
 80                    }
 081                    excludedDomains = array;
 082                    continue;
 83                }
 084                if (property.NameEquals("trustedRootCertificates"))
 85                {
 086                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 090                    List<FirewallPolicyTrustedRootCertificate> array = new List<FirewallPolicyTrustedRootCertificate>();
 091                    foreach (var item in property.Value.EnumerateArray())
 92                    {
 093                        if (item.ValueKind == JsonValueKind.Null)
 94                        {
 095                            array.Add(null);
 96                        }
 97                        else
 98                        {
 099                            array.Add(FirewallPolicyTrustedRootCertificate.DeserializeFirewallPolicyTrustedRootCertifica
 100                        }
 101                    }
 0102                    trustedRootCertificates = array;
 103                    continue;
 104                }
 105            }
 0106            return new FirewallPolicyTransportSecurity(certificateAuthority, excludedDomains, trustedRootCertificates);
 107        }
 108    }
 109}