< Summary

Class:Azure.ResourceManager.Network.Models.SecurityRuleAssociations
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleAssociations.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleAssociations.Serialization.cs
Covered lines:0
Uncovered lines:43
Coverable lines:43
Total lines:130
Line coverage:0% (0 of 43)
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_NetworkInterfaceAssociation()-0%100%
get_SubnetAssociation()-0%100%
get_DefaultSecurityRules()-0%100%
get_EffectiveSecurityRules()-0%100%
DeserializeSecurityRuleAssociations(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleAssociations.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> All security rules associated with the network interface. </summary>
 13    public partial class SecurityRuleAssociations
 14    {
 15        /// <summary> Initializes a new instance of SecurityRuleAssociations. </summary>
 016        internal SecurityRuleAssociations()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of SecurityRuleAssociations. </summary>
 21        /// <param name="networkInterfaceAssociation"> Network interface and it&apos;s custom security rules. </param>
 22        /// <param name="subnetAssociation"> Subnet and it&apos;s custom security rules. </param>
 23        /// <param name="defaultSecurityRules"> Collection of default security rules of the network security group. </pa
 24        /// <param name="effectiveSecurityRules"> Collection of effective security rules. </param>
 025        internal SecurityRuleAssociations(NetworkInterfaceAssociation networkInterfaceAssociation, SubnetAssociation sub
 26        {
 027            NetworkInterfaceAssociation = networkInterfaceAssociation;
 028            SubnetAssociation = subnetAssociation;
 029            DefaultSecurityRules = defaultSecurityRules;
 030            EffectiveSecurityRules = effectiveSecurityRules;
 031        }
 32
 33        /// <summary> Network interface and it&apos;s custom security rules. </summary>
 034        public NetworkInterfaceAssociation NetworkInterfaceAssociation { get; }
 35        /// <summary> Subnet and it&apos;s custom security rules. </summary>
 036        public SubnetAssociation SubnetAssociation { get; }
 37        /// <summary> Collection of default security rules of the network security group. </summary>
 038        public IReadOnlyList<SecurityRule> DefaultSecurityRules { get; }
 39        /// <summary> Collection of effective security rules. </summary>
 040        public IReadOnlyList<EffectiveNetworkSecurityRule> EffectiveSecurityRules { get; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\SecurityRuleAssociations.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 SecurityRuleAssociations
 15    {
 16        internal static SecurityRuleAssociations DeserializeSecurityRuleAssociations(JsonElement element)
 17        {
 018            NetworkInterfaceAssociation networkInterfaceAssociation = default;
 019            SubnetAssociation subnetAssociation = default;
 020            IReadOnlyList<SecurityRule> defaultSecurityRules = default;
 021            IReadOnlyList<EffectiveNetworkSecurityRule> effectiveSecurityRules = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("networkInterfaceAssociation"))
 25                {
 026                    if (property.Value.ValueKind == JsonValueKind.Null)
 27                    {
 28                        continue;
 29                    }
 030                    networkInterfaceAssociation = NetworkInterfaceAssociation.DeserializeNetworkInterfaceAssociation(pro
 031                    continue;
 32                }
 033                if (property.NameEquals("subnetAssociation"))
 34                {
 035                    if (property.Value.ValueKind == JsonValueKind.Null)
 36                    {
 37                        continue;
 38                    }
 039                    subnetAssociation = SubnetAssociation.DeserializeSubnetAssociation(property.Value);
 040                    continue;
 41                }
 042                if (property.NameEquals("defaultSecurityRules"))
 43                {
 044                    if (property.Value.ValueKind == JsonValueKind.Null)
 45                    {
 46                        continue;
 47                    }
 048                    List<SecurityRule> array = new List<SecurityRule>();
 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(SecurityRule.DeserializeSecurityRule(item));
 58                        }
 59                    }
 060                    defaultSecurityRules = array;
 061                    continue;
 62                }
 063                if (property.NameEquals("effectiveSecurityRules"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    List<EffectiveNetworkSecurityRule> array = new List<EffectiveNetworkSecurityRule>();
 070                    foreach (var item in property.Value.EnumerateArray())
 71                    {
 072                        if (item.ValueKind == JsonValueKind.Null)
 73                        {
 074                            array.Add(null);
 75                        }
 76                        else
 77                        {
 078                            array.Add(EffectiveNetworkSecurityRule.DeserializeEffectiveNetworkSecurityRule(item));
 79                        }
 80                    }
 081                    effectiveSecurityRules = array;
 82                    continue;
 83                }
 84            }
 085            return new SecurityRuleAssociations(networkInterfaceAssociation, subnetAssociation, defaultSecurityRules, ef
 86        }
 87    }
 88}