< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_IpAddresses()-0%100%
get_Fqdns()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFirewallPolicyThreatIntelWhitelist(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyThreatIntelWhitelist.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> ThreatIntel Whitelist for Firewall Policy. </summary>
 13    public partial class FirewallPolicyThreatIntelWhitelist
 14    {
 15        /// <summary> Initializes a new instance of FirewallPolicyThreatIntelWhitelist. </summary>
 016        public FirewallPolicyThreatIntelWhitelist()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FirewallPolicyThreatIntelWhitelist. </summary>
 21        /// <param name="ipAddresses"> List of IP addresses for the ThreatIntel Whitelist. </param>
 22        /// <param name="fqdns"> List of FQDNs for the ThreatIntel Whitelist. </param>
 023        internal FirewallPolicyThreatIntelWhitelist(IList<string> ipAddresses, IList<string> fqdns)
 24        {
 025            IpAddresses = ipAddresses;
 026            Fqdns = fqdns;
 027        }
 28
 29        /// <summary> List of IP addresses for the ThreatIntel Whitelist. </summary>
 030        public IList<string> IpAddresses { get; set; }
 31        /// <summary> List of FQDNs for the ThreatIntel Whitelist. </summary>
 032        public IList<string> Fqdns { get; set; }
 33    }
 34}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyThreatIntelWhitelist.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 FirewallPolicyThreatIntelWhitelist : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (IpAddresses != null)
 20            {
 021                writer.WritePropertyName("ipAddresses");
 022                writer.WriteStartArray();
 023                foreach (var item in IpAddresses)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (Fqdns != null)
 30            {
 031                writer.WritePropertyName("fqdns");
 032                writer.WriteStartArray();
 033                foreach (var item in Fqdns)
 34                {
 035                    writer.WriteStringValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            writer.WriteEndObject();
 040        }
 41
 42        internal static FirewallPolicyThreatIntelWhitelist DeserializeFirewallPolicyThreatIntelWhitelist(JsonElement ele
 43        {
 044            IList<string> ipAddresses = default;
 045            IList<string> fqdns = default;
 046            foreach (var property in element.EnumerateObject())
 47            {
 048                if (property.NameEquals("ipAddresses"))
 49                {
 050                    if (property.Value.ValueKind == JsonValueKind.Null)
 51                    {
 52                        continue;
 53                    }
 054                    List<string> array = new List<string>();
 055                    foreach (var item in property.Value.EnumerateArray())
 56                    {
 057                        if (item.ValueKind == JsonValueKind.Null)
 58                        {
 059                            array.Add(null);
 60                        }
 61                        else
 62                        {
 063                            array.Add(item.GetString());
 64                        }
 65                    }
 066                    ipAddresses = array;
 067                    continue;
 68                }
 069                if (property.NameEquals("fqdns"))
 70                {
 071                    if (property.Value.ValueKind == JsonValueKind.Null)
 72                    {
 73                        continue;
 74                    }
 075                    List<string> array = new List<string>();
 076                    foreach (var item in property.Value.EnumerateArray())
 77                    {
 078                        if (item.ValueKind == JsonValueKind.Null)
 79                        {
 080                            array.Add(null);
 81                        }
 82                        else
 83                        {
 084                            array.Add(item.GetString());
 85                        }
 86                    }
 087                    fqdns = array;
 88                    continue;
 89                }
 90            }
 091            return new FirewallPolicyThreatIntelWhitelist(ipAddresses, fqdns);
 92        }
 93    }
 94}