< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Description()-0%100%
get_Protocols()-0%100%
get_SourceAddresses()-0%100%
get_DestinationAddresses()-0%100%
get_DestinationPorts()-0%100%
get_DestinationFqdns()-0%100%
get_SourceIpGroups()-0%100%
get_DestinationIpGroups()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureFirewallNetworkRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewallNetworkRule.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> Properties of the network rule. </summary>
 13    public partial class AzureFirewallNetworkRule
 14    {
 15        /// <summary> Initializes a new instance of AzureFirewallNetworkRule. </summary>
 016        public AzureFirewallNetworkRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of AzureFirewallNetworkRule. </summary>
 21        /// <param name="name"> Name of the network rule. </param>
 22        /// <param name="description"> Description of the rule. </param>
 23        /// <param name="protocols"> Array of AzureFirewallNetworkRuleProtocols. </param>
 24        /// <param name="sourceAddresses"> List of source IP addresses for this rule. </param>
 25        /// <param name="destinationAddresses"> List of destination IP addresses. </param>
 26        /// <param name="destinationPorts"> List of destination ports. </param>
 27        /// <param name="destinationFqdns"> List of destination FQDNs. </param>
 28        /// <param name="sourceIpGroups"> List of source IpGroups for this rule. </param>
 29        /// <param name="destinationIpGroups"> List of destination IpGroups for this rule. </param>
 030        internal AzureFirewallNetworkRule(string name, string description, IList<AzureFirewallNetworkRuleProtocol> proto
 31        {
 032            Name = name;
 033            Description = description;
 034            Protocols = protocols;
 035            SourceAddresses = sourceAddresses;
 036            DestinationAddresses = destinationAddresses;
 037            DestinationPorts = destinationPorts;
 038            DestinationFqdns = destinationFqdns;
 039            SourceIpGroups = sourceIpGroups;
 040            DestinationIpGroups = destinationIpGroups;
 041        }
 42
 43        /// <summary> Name of the network rule. </summary>
 044        public string Name { get; set; }
 45        /// <summary> Description of the rule. </summary>
 046        public string Description { get; set; }
 47        /// <summary> Array of AzureFirewallNetworkRuleProtocols. </summary>
 048        public IList<AzureFirewallNetworkRuleProtocol> Protocols { get; set; }
 49        /// <summary> List of source IP addresses for this rule. </summary>
 050        public IList<string> SourceAddresses { get; set; }
 51        /// <summary> List of destination IP addresses. </summary>
 052        public IList<string> DestinationAddresses { get; set; }
 53        /// <summary> List of destination ports. </summary>
 054        public IList<string> DestinationPorts { get; set; }
 55        /// <summary> List of destination FQDNs. </summary>
 056        public IList<string> DestinationFqdns { get; set; }
 57        /// <summary> List of source IpGroups for this rule. </summary>
 058        public IList<string> SourceIpGroups { get; set; }
 59        /// <summary> List of destination IpGroups for this rule. </summary>
 060        public IList<string> DestinationIpGroups { get; set; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewallNetworkRule.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 AzureFirewallNetworkRule : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Description != null)
 25            {
 026                writer.WritePropertyName("description");
 027                writer.WriteStringValue(Description);
 28            }
 029            if (Protocols != null)
 30            {
 031                writer.WritePropertyName("protocols");
 032                writer.WriteStartArray();
 033                foreach (var item in Protocols)
 34                {
 035                    writer.WriteStringValue(item.ToString());
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (SourceAddresses != null)
 40            {
 041                writer.WritePropertyName("sourceAddresses");
 042                writer.WriteStartArray();
 043                foreach (var item in SourceAddresses)
 44                {
 045                    writer.WriteStringValue(item);
 46                }
 047                writer.WriteEndArray();
 48            }
 049            if (DestinationAddresses != null)
 50            {
 051                writer.WritePropertyName("destinationAddresses");
 052                writer.WriteStartArray();
 053                foreach (var item in DestinationAddresses)
 54                {
 055                    writer.WriteStringValue(item);
 56                }
 057                writer.WriteEndArray();
 58            }
 059            if (DestinationPorts != null)
 60            {
 061                writer.WritePropertyName("destinationPorts");
 062                writer.WriteStartArray();
 063                foreach (var item in DestinationPorts)
 64                {
 065                    writer.WriteStringValue(item);
 66                }
 067                writer.WriteEndArray();
 68            }
 069            if (DestinationFqdns != null)
 70            {
 071                writer.WritePropertyName("destinationFqdns");
 072                writer.WriteStartArray();
 073                foreach (var item in DestinationFqdns)
 74                {
 075                    writer.WriteStringValue(item);
 76                }
 077                writer.WriteEndArray();
 78            }
 079            if (SourceIpGroups != null)
 80            {
 081                writer.WritePropertyName("sourceIpGroups");
 082                writer.WriteStartArray();
 083                foreach (var item in SourceIpGroups)
 84                {
 085                    writer.WriteStringValue(item);
 86                }
 087                writer.WriteEndArray();
 88            }
 089            if (DestinationIpGroups != null)
 90            {
 091                writer.WritePropertyName("destinationIpGroups");
 092                writer.WriteStartArray();
 093                foreach (var item in DestinationIpGroups)
 94                {
 095                    writer.WriteStringValue(item);
 96                }
 097                writer.WriteEndArray();
 98            }
 099            writer.WriteEndObject();
 0100        }
 101
 102        internal static AzureFirewallNetworkRule DeserializeAzureFirewallNetworkRule(JsonElement element)
 103        {
 0104            string name = default;
 0105            string description = default;
 0106            IList<AzureFirewallNetworkRuleProtocol> protocols = default;
 0107            IList<string> sourceAddresses = default;
 0108            IList<string> destinationAddresses = default;
 0109            IList<string> destinationPorts = default;
 0110            IList<string> destinationFqdns = default;
 0111            IList<string> sourceIpGroups = default;
 0112            IList<string> destinationIpGroups = default;
 0113            foreach (var property in element.EnumerateObject())
 114            {
 0115                if (property.NameEquals("name"))
 116                {
 0117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 0121                    name = property.Value.GetString();
 0122                    continue;
 123                }
 0124                if (property.NameEquals("description"))
 125                {
 0126                    if (property.Value.ValueKind == JsonValueKind.Null)
 127                    {
 128                        continue;
 129                    }
 0130                    description = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("protocols"))
 134                {
 0135                    if (property.Value.ValueKind == JsonValueKind.Null)
 136                    {
 137                        continue;
 138                    }
 0139                    List<AzureFirewallNetworkRuleProtocol> array = new List<AzureFirewallNetworkRuleProtocol>();
 0140                    foreach (var item in property.Value.EnumerateArray())
 141                    {
 0142                        array.Add(new AzureFirewallNetworkRuleProtocol(item.GetString()));
 143                    }
 0144                    protocols = array;
 0145                    continue;
 146                }
 0147                if (property.NameEquals("sourceAddresses"))
 148                {
 0149                    if (property.Value.ValueKind == JsonValueKind.Null)
 150                    {
 151                        continue;
 152                    }
 0153                    List<string> array = new List<string>();
 0154                    foreach (var item in property.Value.EnumerateArray())
 155                    {
 0156                        if (item.ValueKind == JsonValueKind.Null)
 157                        {
 0158                            array.Add(null);
 159                        }
 160                        else
 161                        {
 0162                            array.Add(item.GetString());
 163                        }
 164                    }
 0165                    sourceAddresses = array;
 0166                    continue;
 167                }
 0168                if (property.NameEquals("destinationAddresses"))
 169                {
 0170                    if (property.Value.ValueKind == JsonValueKind.Null)
 171                    {
 172                        continue;
 173                    }
 0174                    List<string> array = new List<string>();
 0175                    foreach (var item in property.Value.EnumerateArray())
 176                    {
 0177                        if (item.ValueKind == JsonValueKind.Null)
 178                        {
 0179                            array.Add(null);
 180                        }
 181                        else
 182                        {
 0183                            array.Add(item.GetString());
 184                        }
 185                    }
 0186                    destinationAddresses = array;
 0187                    continue;
 188                }
 0189                if (property.NameEquals("destinationPorts"))
 190                {
 0191                    if (property.Value.ValueKind == JsonValueKind.Null)
 192                    {
 193                        continue;
 194                    }
 0195                    List<string> array = new List<string>();
 0196                    foreach (var item in property.Value.EnumerateArray())
 197                    {
 0198                        if (item.ValueKind == JsonValueKind.Null)
 199                        {
 0200                            array.Add(null);
 201                        }
 202                        else
 203                        {
 0204                            array.Add(item.GetString());
 205                        }
 206                    }
 0207                    destinationPorts = array;
 0208                    continue;
 209                }
 0210                if (property.NameEquals("destinationFqdns"))
 211                {
 0212                    if (property.Value.ValueKind == JsonValueKind.Null)
 213                    {
 214                        continue;
 215                    }
 0216                    List<string> array = new List<string>();
 0217                    foreach (var item in property.Value.EnumerateArray())
 218                    {
 0219                        if (item.ValueKind == JsonValueKind.Null)
 220                        {
 0221                            array.Add(null);
 222                        }
 223                        else
 224                        {
 0225                            array.Add(item.GetString());
 226                        }
 227                    }
 0228                    destinationFqdns = array;
 0229                    continue;
 230                }
 0231                if (property.NameEquals("sourceIpGroups"))
 232                {
 0233                    if (property.Value.ValueKind == JsonValueKind.Null)
 234                    {
 235                        continue;
 236                    }
 0237                    List<string> array = new List<string>();
 0238                    foreach (var item in property.Value.EnumerateArray())
 239                    {
 0240                        if (item.ValueKind == JsonValueKind.Null)
 241                        {
 0242                            array.Add(null);
 243                        }
 244                        else
 245                        {
 0246                            array.Add(item.GetString());
 247                        }
 248                    }
 0249                    sourceIpGroups = array;
 0250                    continue;
 251                }
 0252                if (property.NameEquals("destinationIpGroups"))
 253                {
 0254                    if (property.Value.ValueKind == JsonValueKind.Null)
 255                    {
 256                        continue;
 257                    }
 0258                    List<string> array = new List<string>();
 0259                    foreach (var item in property.Value.EnumerateArray())
 260                    {
 0261                        if (item.ValueKind == JsonValueKind.Null)
 262                        {
 0263                            array.Add(null);
 264                        }
 265                        else
 266                        {
 0267                            array.Add(item.GetString());
 268                        }
 269                    }
 0270                    destinationIpGroups = array;
 271                    continue;
 272                }
 273            }
 0274            return new AzureFirewallNetworkRule(name, description, protocols, sourceAddresses, destinationAddresses, des
 275        }
 276    }
 277}