< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Protocol()-0%100%
get_SourcePortRange()-0%100%
get_DestinationPortRange()-0%100%
get_SourcePortRanges()-0%100%
get_DestinationPortRanges()-0%100%
get_SourceAddressPrefix()-0%100%
get_DestinationAddressPrefix()-0%100%
get_SourceAddressPrefixes()-0%100%
get_DestinationAddressPrefixes()-0%100%
get_ExpandedSourceAddressPrefix()-0%100%
get_ExpandedDestinationAddressPrefix()-0%100%
get_Access()-0%100%
get_Priority()-0%100%
get_Direction()-0%100%
DeserializeEffectiveNetworkSecurityRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveNetworkSecurityRule.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> Effective network security rules. </summary>
 13    public partial class EffectiveNetworkSecurityRule
 14    {
 15        /// <summary> Initializes a new instance of EffectiveNetworkSecurityRule. </summary>
 016        internal EffectiveNetworkSecurityRule()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of EffectiveNetworkSecurityRule. </summary>
 21        /// <param name="name"> The name of the security rule specified by the user (if created by the user). </param>
 22        /// <param name="protocol"> The network protocol this rule applies to. </param>
 23        /// <param name="sourcePortRange"> The source port or range. </param>
 24        /// <param name="destinationPortRange"> The destination port or range. </param>
 25        /// <param name="sourcePortRanges"> The source port ranges. Expected values include a single integer between 0 a
 26        /// <param name="destinationPortRanges"> The destination port ranges. Expected values include a single integer b
 27        /// <param name="sourceAddressPrefix"> The source address prefix. </param>
 28        /// <param name="destinationAddressPrefix"> The destination address prefix. </param>
 29        /// <param name="sourceAddressPrefixes"> The source address prefixes. Expected values include CIDR IP ranges, De
 30        /// <param name="destinationAddressPrefixes"> The destination address prefixes. Expected values include CIDR IP 
 31        /// <param name="expandedSourceAddressPrefix"> The expanded source address prefix. </param>
 32        /// <param name="expandedDestinationAddressPrefix"> Expanded destination address prefix. </param>
 33        /// <param name="access"> Whether network traffic is allowed or denied. </param>
 34        /// <param name="priority"> The priority of the rule. </param>
 35        /// <param name="direction"> The direction of the rule. </param>
 036        internal EffectiveNetworkSecurityRule(string name, EffectiveSecurityRuleProtocol? protocol, string sourcePortRan
 37        {
 038            Name = name;
 039            Protocol = protocol;
 040            SourcePortRange = sourcePortRange;
 041            DestinationPortRange = destinationPortRange;
 042            SourcePortRanges = sourcePortRanges;
 043            DestinationPortRanges = destinationPortRanges;
 044            SourceAddressPrefix = sourceAddressPrefix;
 045            DestinationAddressPrefix = destinationAddressPrefix;
 046            SourceAddressPrefixes = sourceAddressPrefixes;
 047            DestinationAddressPrefixes = destinationAddressPrefixes;
 048            ExpandedSourceAddressPrefix = expandedSourceAddressPrefix;
 049            ExpandedDestinationAddressPrefix = expandedDestinationAddressPrefix;
 050            Access = access;
 051            Priority = priority;
 052            Direction = direction;
 053        }
 54
 55        /// <summary> The name of the security rule specified by the user (if created by the user). </summary>
 056        public string Name { get; }
 57        /// <summary> The network protocol this rule applies to. </summary>
 058        public EffectiveSecurityRuleProtocol? Protocol { get; }
 59        /// <summary> The source port or range. </summary>
 060        public string SourcePortRange { get; }
 61        /// <summary> The destination port or range. </summary>
 062        public string DestinationPortRange { get; }
 63        /// <summary> The source port ranges. Expected values include a single integer between 0 and 65535, a range usin
 064        public IReadOnlyList<string> SourcePortRanges { get; }
 65        /// <summary> The destination port ranges. Expected values include a single integer between 0 and 65535, a range
 066        public IReadOnlyList<string> DestinationPortRanges { get; }
 67        /// <summary> The source address prefix. </summary>
 068        public string SourceAddressPrefix { get; }
 69        /// <summary> The destination address prefix. </summary>
 070        public string DestinationAddressPrefix { get; }
 71        /// <summary> The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork,
 072        public IReadOnlyList<string> SourceAddressPrefixes { get; }
 73        /// <summary> The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNet
 074        public IReadOnlyList<string> DestinationAddressPrefixes { get; }
 75        /// <summary> The expanded source address prefix. </summary>
 076        public IReadOnlyList<string> ExpandedSourceAddressPrefix { get; }
 77        /// <summary> Expanded destination address prefix. </summary>
 078        public IReadOnlyList<string> ExpandedDestinationAddressPrefix { get; }
 79        /// <summary> Whether network traffic is allowed or denied. </summary>
 080        public SecurityRuleAccess? Access { get; }
 81        /// <summary> The priority of the rule. </summary>
 082        public int? Priority { get; }
 83        /// <summary> The direction of the rule. </summary>
 084        public SecurityRuleDirection? Direction { get; }
 85    }
 86}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveNetworkSecurityRule.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 EffectiveNetworkSecurityRule
 15    {
 16        internal static EffectiveNetworkSecurityRule DeserializeEffectiveNetworkSecurityRule(JsonElement element)
 17        {
 018            string name = default;
 019            EffectiveSecurityRuleProtocol? protocol = default;
 020            string sourcePortRange = default;
 021            string destinationPortRange = default;
 022            IReadOnlyList<string> sourcePortRanges = default;
 023            IReadOnlyList<string> destinationPortRanges = default;
 024            string sourceAddressPrefix = default;
 025            string destinationAddressPrefix = default;
 026            IReadOnlyList<string> sourceAddressPrefixes = default;
 027            IReadOnlyList<string> destinationAddressPrefixes = default;
 028            IReadOnlyList<string> expandedSourceAddressPrefix = default;
 029            IReadOnlyList<string> expandedDestinationAddressPrefix = default;
 030            SecurityRuleAccess? access = default;
 031            int? priority = default;
 032            SecurityRuleDirection? direction = default;
 033            foreach (var property in element.EnumerateObject())
 34            {
 035                if (property.NameEquals("name"))
 36                {
 037                    if (property.Value.ValueKind == JsonValueKind.Null)
 38                    {
 39                        continue;
 40                    }
 041                    name = property.Value.GetString();
 042                    continue;
 43                }
 044                if (property.NameEquals("protocol"))
 45                {
 046                    if (property.Value.ValueKind == JsonValueKind.Null)
 47                    {
 48                        continue;
 49                    }
 050                    protocol = new EffectiveSecurityRuleProtocol(property.Value.GetString());
 051                    continue;
 52                }
 053                if (property.NameEquals("sourcePortRange"))
 54                {
 055                    if (property.Value.ValueKind == JsonValueKind.Null)
 56                    {
 57                        continue;
 58                    }
 059                    sourcePortRange = property.Value.GetString();
 060                    continue;
 61                }
 062                if (property.NameEquals("destinationPortRange"))
 63                {
 064                    if (property.Value.ValueKind == JsonValueKind.Null)
 65                    {
 66                        continue;
 67                    }
 068                    destinationPortRange = property.Value.GetString();
 069                    continue;
 70                }
 071                if (property.NameEquals("sourcePortRanges"))
 72                {
 073                    if (property.Value.ValueKind == JsonValueKind.Null)
 74                    {
 75                        continue;
 76                    }
 077                    List<string> array = new List<string>();
 078                    foreach (var item in property.Value.EnumerateArray())
 79                    {
 080                        if (item.ValueKind == JsonValueKind.Null)
 81                        {
 082                            array.Add(null);
 83                        }
 84                        else
 85                        {
 086                            array.Add(item.GetString());
 87                        }
 88                    }
 089                    sourcePortRanges = array;
 090                    continue;
 91                }
 092                if (property.NameEquals("destinationPortRanges"))
 93                {
 094                    if (property.Value.ValueKind == JsonValueKind.Null)
 95                    {
 96                        continue;
 97                    }
 098                    List<string> array = new List<string>();
 099                    foreach (var item in property.Value.EnumerateArray())
 100                    {
 0101                        if (item.ValueKind == JsonValueKind.Null)
 102                        {
 0103                            array.Add(null);
 104                        }
 105                        else
 106                        {
 0107                            array.Add(item.GetString());
 108                        }
 109                    }
 0110                    destinationPortRanges = array;
 0111                    continue;
 112                }
 0113                if (property.NameEquals("sourceAddressPrefix"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    sourceAddressPrefix = property.Value.GetString();
 0120                    continue;
 121                }
 0122                if (property.NameEquals("destinationAddressPrefix"))
 123                {
 0124                    if (property.Value.ValueKind == JsonValueKind.Null)
 125                    {
 126                        continue;
 127                    }
 0128                    destinationAddressPrefix = property.Value.GetString();
 0129                    continue;
 130                }
 0131                if (property.NameEquals("sourceAddressPrefixes"))
 132                {
 0133                    if (property.Value.ValueKind == JsonValueKind.Null)
 134                    {
 135                        continue;
 136                    }
 0137                    List<string> array = new List<string>();
 0138                    foreach (var item in property.Value.EnumerateArray())
 139                    {
 0140                        if (item.ValueKind == JsonValueKind.Null)
 141                        {
 0142                            array.Add(null);
 143                        }
 144                        else
 145                        {
 0146                            array.Add(item.GetString());
 147                        }
 148                    }
 0149                    sourceAddressPrefixes = array;
 0150                    continue;
 151                }
 0152                if (property.NameEquals("destinationAddressPrefixes"))
 153                {
 0154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 0158                    List<string> array = new List<string>();
 0159                    foreach (var item in property.Value.EnumerateArray())
 160                    {
 0161                        if (item.ValueKind == JsonValueKind.Null)
 162                        {
 0163                            array.Add(null);
 164                        }
 165                        else
 166                        {
 0167                            array.Add(item.GetString());
 168                        }
 169                    }
 0170                    destinationAddressPrefixes = array;
 0171                    continue;
 172                }
 0173                if (property.NameEquals("expandedSourceAddressPrefix"))
 174                {
 0175                    if (property.Value.ValueKind == JsonValueKind.Null)
 176                    {
 177                        continue;
 178                    }
 0179                    List<string> array = new List<string>();
 0180                    foreach (var item in property.Value.EnumerateArray())
 181                    {
 0182                        if (item.ValueKind == JsonValueKind.Null)
 183                        {
 0184                            array.Add(null);
 185                        }
 186                        else
 187                        {
 0188                            array.Add(item.GetString());
 189                        }
 190                    }
 0191                    expandedSourceAddressPrefix = array;
 0192                    continue;
 193                }
 0194                if (property.NameEquals("expandedDestinationAddressPrefix"))
 195                {
 0196                    if (property.Value.ValueKind == JsonValueKind.Null)
 197                    {
 198                        continue;
 199                    }
 0200                    List<string> array = new List<string>();
 0201                    foreach (var item in property.Value.EnumerateArray())
 202                    {
 0203                        if (item.ValueKind == JsonValueKind.Null)
 204                        {
 0205                            array.Add(null);
 206                        }
 207                        else
 208                        {
 0209                            array.Add(item.GetString());
 210                        }
 211                    }
 0212                    expandedDestinationAddressPrefix = array;
 0213                    continue;
 214                }
 0215                if (property.NameEquals("access"))
 216                {
 0217                    if (property.Value.ValueKind == JsonValueKind.Null)
 218                    {
 219                        continue;
 220                    }
 0221                    access = new SecurityRuleAccess(property.Value.GetString());
 0222                    continue;
 223                }
 0224                if (property.NameEquals("priority"))
 225                {
 0226                    if (property.Value.ValueKind == JsonValueKind.Null)
 227                    {
 228                        continue;
 229                    }
 0230                    priority = property.Value.GetInt32();
 0231                    continue;
 232                }
 0233                if (property.NameEquals("direction"))
 234                {
 0235                    if (property.Value.ValueKind == JsonValueKind.Null)
 236                    {
 237                        continue;
 238                    }
 0239                    direction = new SecurityRuleDirection(property.Value.GetString());
 240                    continue;
 241                }
 242            }
 0243            return new EffectiveNetworkSecurityRule(name, protocol, sourcePortRange, destinationPortRange, sourcePortRan
 244        }
 245    }
 246}