< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Description()-0%100%
get_SourceAddresses()-0%100%
get_Protocols()-0%100%
get_TargetFqdns()-0%100%
get_FqdnTags()-0%100%
get_SourceIpGroups()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureFirewallApplicationRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewallApplicationRule.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 an application rule. </summary>
 13    public partial class AzureFirewallApplicationRule
 14    {
 15        /// <summary> Initializes a new instance of AzureFirewallApplicationRule. </summary>
 016        public AzureFirewallApplicationRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of AzureFirewallApplicationRule. </summary>
 21        /// <param name="name"> Name of the application rule. </param>
 22        /// <param name="description"> Description of the rule. </param>
 23        /// <param name="sourceAddresses"> List of source IP addresses for this rule. </param>
 24        /// <param name="protocols"> Array of ApplicationRuleProtocols. </param>
 25        /// <param name="targetFqdns"> List of FQDNs for this rule. </param>
 26        /// <param name="fqdnTags"> List of FQDN Tags for this rule. </param>
 27        /// <param name="sourceIpGroups"> List of source IpGroups for this rule. </param>
 028        internal AzureFirewallApplicationRule(string name, string description, IList<string> sourceAddresses, IList<Azur
 29        {
 030            Name = name;
 031            Description = description;
 032            SourceAddresses = sourceAddresses;
 033            Protocols = protocols;
 034            TargetFqdns = targetFqdns;
 035            FqdnTags = fqdnTags;
 036            SourceIpGroups = sourceIpGroups;
 037        }
 38
 39        /// <summary> Name of the application rule. </summary>
 040        public string Name { get; set; }
 41        /// <summary> Description of the rule. </summary>
 042        public string Description { get; set; }
 43        /// <summary> List of source IP addresses for this rule. </summary>
 044        public IList<string> SourceAddresses { get; set; }
 45        /// <summary> Array of ApplicationRuleProtocols. </summary>
 046        public IList<AzureFirewallApplicationRuleProtocol> Protocols { get; set; }
 47        /// <summary> List of FQDNs for this rule. </summary>
 048        public IList<string> TargetFqdns { get; set; }
 49        /// <summary> List of FQDN Tags for this rule. </summary>
 050        public IList<string> FqdnTags { get; set; }
 51        /// <summary> List of source IpGroups for this rule. </summary>
 052        public IList<string> SourceIpGroups { get; set; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewallApplicationRule.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 AzureFirewallApplicationRule : 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 (SourceAddresses != null)
 30            {
 031                writer.WritePropertyName("sourceAddresses");
 032                writer.WriteStartArray();
 033                foreach (var item in SourceAddresses)
 34                {
 035                    writer.WriteStringValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (Protocols != null)
 40            {
 041                writer.WritePropertyName("protocols");
 042                writer.WriteStartArray();
 043                foreach (var item in Protocols)
 44                {
 045                    writer.WriteObjectValue(item);
 46                }
 047                writer.WriteEndArray();
 48            }
 049            if (TargetFqdns != null)
 50            {
 051                writer.WritePropertyName("targetFqdns");
 052                writer.WriteStartArray();
 053                foreach (var item in TargetFqdns)
 54                {
 055                    writer.WriteStringValue(item);
 56                }
 057                writer.WriteEndArray();
 58            }
 059            if (FqdnTags != null)
 60            {
 061                writer.WritePropertyName("fqdnTags");
 062                writer.WriteStartArray();
 063                foreach (var item in FqdnTags)
 64                {
 065                    writer.WriteStringValue(item);
 66                }
 067                writer.WriteEndArray();
 68            }
 069            if (SourceIpGroups != null)
 70            {
 071                writer.WritePropertyName("sourceIpGroups");
 072                writer.WriteStartArray();
 073                foreach (var item in SourceIpGroups)
 74                {
 075                    writer.WriteStringValue(item);
 76                }
 077                writer.WriteEndArray();
 78            }
 079            writer.WriteEndObject();
 080        }
 81
 82        internal static AzureFirewallApplicationRule DeserializeAzureFirewallApplicationRule(JsonElement element)
 83        {
 084            string name = default;
 085            string description = default;
 086            IList<string> sourceAddresses = default;
 087            IList<AzureFirewallApplicationRuleProtocol> protocols = default;
 088            IList<string> targetFqdns = default;
 089            IList<string> fqdnTags = default;
 090            IList<string> sourceIpGroups = default;
 091            foreach (var property in element.EnumerateObject())
 92            {
 093                if (property.NameEquals("name"))
 94                {
 095                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 099                    name = property.Value.GetString();
 0100                    continue;
 101                }
 0102                if (property.NameEquals("description"))
 103                {
 0104                    if (property.Value.ValueKind == JsonValueKind.Null)
 105                    {
 106                        continue;
 107                    }
 0108                    description = property.Value.GetString();
 0109                    continue;
 110                }
 0111                if (property.NameEquals("sourceAddresses"))
 112                {
 0113                    if (property.Value.ValueKind == JsonValueKind.Null)
 114                    {
 115                        continue;
 116                    }
 0117                    List<string> array = new List<string>();
 0118                    foreach (var item in property.Value.EnumerateArray())
 119                    {
 0120                        if (item.ValueKind == JsonValueKind.Null)
 121                        {
 0122                            array.Add(null);
 123                        }
 124                        else
 125                        {
 0126                            array.Add(item.GetString());
 127                        }
 128                    }
 0129                    sourceAddresses = array;
 0130                    continue;
 131                }
 0132                if (property.NameEquals("protocols"))
 133                {
 0134                    if (property.Value.ValueKind == JsonValueKind.Null)
 135                    {
 136                        continue;
 137                    }
 0138                    List<AzureFirewallApplicationRuleProtocol> array = new List<AzureFirewallApplicationRuleProtocol>();
 0139                    foreach (var item in property.Value.EnumerateArray())
 140                    {
 0141                        if (item.ValueKind == JsonValueKind.Null)
 142                        {
 0143                            array.Add(null);
 144                        }
 145                        else
 146                        {
 0147                            array.Add(AzureFirewallApplicationRuleProtocol.DeserializeAzureFirewallApplicationRuleProtoc
 148                        }
 149                    }
 0150                    protocols = array;
 0151                    continue;
 152                }
 0153                if (property.NameEquals("targetFqdns"))
 154                {
 0155                    if (property.Value.ValueKind == JsonValueKind.Null)
 156                    {
 157                        continue;
 158                    }
 0159                    List<string> array = new List<string>();
 0160                    foreach (var item in property.Value.EnumerateArray())
 161                    {
 0162                        if (item.ValueKind == JsonValueKind.Null)
 163                        {
 0164                            array.Add(null);
 165                        }
 166                        else
 167                        {
 0168                            array.Add(item.GetString());
 169                        }
 170                    }
 0171                    targetFqdns = array;
 0172                    continue;
 173                }
 0174                if (property.NameEquals("fqdnTags"))
 175                {
 0176                    if (property.Value.ValueKind == JsonValueKind.Null)
 177                    {
 178                        continue;
 179                    }
 0180                    List<string> array = new List<string>();
 0181                    foreach (var item in property.Value.EnumerateArray())
 182                    {
 0183                        if (item.ValueKind == JsonValueKind.Null)
 184                        {
 0185                            array.Add(null);
 186                        }
 187                        else
 188                        {
 0189                            array.Add(item.GetString());
 190                        }
 191                    }
 0192                    fqdnTags = array;
 0193                    continue;
 194                }
 0195                if (property.NameEquals("sourceIpGroups"))
 196                {
 0197                    if (property.Value.ValueKind == JsonValueKind.Null)
 198                    {
 199                        continue;
 200                    }
 0201                    List<string> array = new List<string>();
 0202                    foreach (var item in property.Value.EnumerateArray())
 203                    {
 0204                        if (item.ValueKind == JsonValueKind.Null)
 205                        {
 0206                            array.Add(null);
 207                        }
 208                        else
 209                        {
 0210                            array.Add(item.GetString());
 211                        }
 212                    }
 0213                    sourceIpGroups = array;
 214                    continue;
 215                }
 216            }
 0217            return new AzureFirewallApplicationRule(name, description, sourceAddresses, protocols, targetFqdns, fqdnTags
 218        }
 219    }
 220}