< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_NetworkSecurityGroup()-0%100%
get_Association()-0%100%
get_EffectiveSecurityRules()-0%100%
get_TagMap()-0%100%
DeserializeEffectiveNetworkSecurityGroup(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveNetworkSecurityGroup.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 group. </summary>
 13    public partial class EffectiveNetworkSecurityGroup
 14    {
 15        /// <summary> Initializes a new instance of EffectiveNetworkSecurityGroup. </summary>
 016        internal EffectiveNetworkSecurityGroup()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of EffectiveNetworkSecurityGroup. </summary>
 21        /// <param name="networkSecurityGroup"> The ID of network security group that is applied. </param>
 22        /// <param name="association"> Associated resources. </param>
 23        /// <param name="effectiveSecurityRules"> A collection of effective security rules. </param>
 24        /// <param name="tagMap"> Mapping of tags to list of IP Addresses included within the tag. </param>
 025        internal EffectiveNetworkSecurityGroup(SubResource networkSecurityGroup, EffectiveNetworkSecurityGroupAssociatio
 26        {
 027            NetworkSecurityGroup = networkSecurityGroup;
 028            Association = association;
 029            EffectiveSecurityRules = effectiveSecurityRules;
 030            TagMap = tagMap;
 031        }
 32
 33        /// <summary> The ID of network security group that is applied. </summary>
 034        public SubResource NetworkSecurityGroup { get; }
 35        /// <summary> Associated resources. </summary>
 036        public EffectiveNetworkSecurityGroupAssociation Association { get; }
 37        /// <summary> A collection of effective security rules. </summary>
 038        public IReadOnlyList<EffectiveNetworkSecurityRule> EffectiveSecurityRules { get; }
 39        /// <summary> Mapping of tags to list of IP Addresses included within the tag. </summary>
 040        public string TagMap { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveNetworkSecurityGroup.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 EffectiveNetworkSecurityGroup
 15    {
 16        internal static EffectiveNetworkSecurityGroup DeserializeEffectiveNetworkSecurityGroup(JsonElement element)
 17        {
 018            SubResource networkSecurityGroup = default;
 019            EffectiveNetworkSecurityGroupAssociation association = default;
 020            IReadOnlyList<EffectiveNetworkSecurityRule> effectiveSecurityRules = default;
 021            string tagMap = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("networkSecurityGroup"))
 25                {
 026                    if (property.Value.ValueKind == JsonValueKind.Null)
 27                    {
 28                        continue;
 29                    }
 030                    networkSecurityGroup = SubResource.DeserializeSubResource(property.Value);
 031                    continue;
 32                }
 033                if (property.NameEquals("association"))
 34                {
 035                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 039                    association = EffectiveNetworkSecurityGroupAssociation.DeserializeEffectiveNetworkSecurityGroupAssoc
 040                    continue;
 41                }
 042                if (property.NameEquals("effectiveSecurityRules"))
 43                {
 044                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 048                    List<EffectiveNetworkSecurityRule> array = new List<EffectiveNetworkSecurityRule>();
 049                    foreach (var item in property.Value.EnumerateArray())
 50                    {
 051                        if (item.ValueKind == JsonValueKind.Null)
 52                        {
 053                            array.Add(null);
 54                        }
 55                        else
 56                        {
 057                            array.Add(EffectiveNetworkSecurityRule.DeserializeEffectiveNetworkSecurityRule(item));
 58                        }
 59                    }
 060                    effectiveSecurityRules = array;
 061                    continue;
 62                }
 063                if (property.NameEquals("tagMap"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    tagMap = property.Value.GetString();
 70                    continue;
 71                }
 72            }
 073            return new EffectiveNetworkSecurityGroup(networkSecurityGroup, association, effectiveSecurityRules, tagMap);
 74        }
 75    }
 76}