< Summary

Class:Azure.ResourceManager.Network.Models.NetworkInterfaceIPConfiguration
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceIPConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceIPConfiguration.Serialization.cs
Covered lines:165
Uncovered lines:46
Coverable lines:211
Total lines:452
Line coverage:78.1% (165 of 211)
Covered branches:99
Total branches:132
Branch coverage:75% (99 of 132)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Etag()-100%100%
get_VirtualNetworkTaps()-100%100%
get_ApplicationGatewayBackendAddressPools()-100%100%
get_LoadBalancerBackendAddressPools()-100%100%
get_LoadBalancerInboundNatRules()-100%100%
get_PrivateIPAddress()-100%100%
get_PrivateIPAllocationMethod()-100%100%
get_PrivateIPAddressVersion()-100%100%
get_Subnet()-100%100%
get_Primary()-100%100%
get_PublicIPAddress()-100%100%
get_ApplicationSecurityGroups()-100%100%
get_ProvisioningState()-100%100%
get_PrivateLinkConnectionProperties()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-75.36%76.19%
DeserializeNetworkInterfaceIPConfiguration(...)-73.15%74.44%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceIPConfiguration.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> IPConfiguration in a network interface. </summary>
 13    public partial class NetworkInterfaceIPConfiguration : SubResource
 14    {
 15        /// <summary> Initializes a new instance of NetworkInterfaceIPConfiguration. </summary>
 8416        public NetworkInterfaceIPConfiguration()
 17        {
 8418        }
 19
 20        /// <summary> Initializes a new instance of NetworkInterfaceIPConfiguration. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="virtualNetworkTaps"> The reference to Virtual Network Taps. </param>
 25        /// <param name="applicationGatewayBackendAddressPools"> The reference to ApplicationGatewayBackendAddressPool r
 26        /// <param name="loadBalancerBackendAddressPools"> The reference to LoadBalancerBackendAddressPool resource. </p
 27        /// <param name="loadBalancerInboundNatRules"> A list of references of LoadBalancerInboundNatRules. </param>
 28        /// <param name="privateIPAddress"> Private IP address of the IP configuration. </param>
 29        /// <param name="privateIPAllocationMethod"> The private IP address allocation method. </param>
 30        /// <param name="privateIPAddressVersion"> Whether the specific IP configuration is IPv4 or IPv6. Default is IPv
 31        /// <param name="subnet"> Subnet bound to the IP configuration. </param>
 32        /// <param name="primary"> Whether this is a primary customer address on the network interface. </param>
 33        /// <param name="publicIPAddress"> Public IP address bound to the IP configuration. </param>
 34        /// <param name="applicationSecurityGroups"> Application security groups in which the IP configuration is includ
 35        /// <param name="provisioningState"> The provisioning state of the network interface IP configuration. </param>
 36        /// <param name="privateLinkConnectionProperties"> PrivateLinkConnection properties for the network interface. <
 37237        internal NetworkInterfaceIPConfiguration(string id, string name, string etag, IList<VirtualNetworkTap> virtualNe
 38        {
 37239            Name = name;
 37240            Etag = etag;
 37241            VirtualNetworkTaps = virtualNetworkTaps;
 37242            ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools;
 37243            LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools;
 37244            LoadBalancerInboundNatRules = loadBalancerInboundNatRules;
 37245            PrivateIPAddress = privateIPAddress;
 37246            PrivateIPAllocationMethod = privateIPAllocationMethod;
 37247            PrivateIPAddressVersion = privateIPAddressVersion;
 37248            Subnet = subnet;
 37249            Primary = primary;
 37250            PublicIPAddress = publicIPAddress;
 37251            ApplicationSecurityGroups = applicationSecurityGroups;
 37252            ProvisioningState = provisioningState;
 37253            PrivateLinkConnectionProperties = privateLinkConnectionProperties;
 37254        }
 55
 56        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 94457        public string Name { get; set; }
 58        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 33659        public string Etag { get; }
 60        /// <summary> The reference to Virtual Network Taps. </summary>
 58861        public IList<VirtualNetworkTap> VirtualNetworkTaps { get; set; }
 62        /// <summary> The reference to ApplicationGatewayBackendAddressPool resource. </summary>
 58863        public IList<ApplicationGatewayBackendAddressPool> ApplicationGatewayBackendAddressPools { get; set; }
 64        /// <summary> The reference to LoadBalancerBackendAddressPool resource. </summary>
 64465        public IList<BackendAddressPool> LoadBalancerBackendAddressPools { get; set; }
 66        /// <summary> A list of references of LoadBalancerInboundNatRules. </summary>
 64467        public IList<InboundNatRule> LoadBalancerInboundNatRules { get; set; }
 68        /// <summary> Private IP address of the IP configuration. </summary>
 67269        public string PrivateIPAddress { get; set; }
 70        /// <summary> The private IP address allocation method. </summary>
 88871        public IPAllocationMethod? PrivateIPAllocationMethod { get; set; }
 72        /// <summary> Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. </summary>
 70073        public IPVersion? PrivateIPAddressVersion { get; set; }
 74        /// <summary> Subnet bound to the IP configuration. </summary>
 91675        public Subnet Subnet { get; set; }
 76        /// <summary> Whether this is a primary customer address on the network interface. </summary>
 75277        public bool? Primary { get; set; }
 78        /// <summary> Public IP address bound to the IP configuration. </summary>
 66879        public PublicIPAddress PublicIPAddress { get; set; }
 80        /// <summary> Application security groups in which the IP configuration is included. </summary>
 58881        public IList<ApplicationSecurityGroup> ApplicationSecurityGroups { get; set; }
 82        /// <summary> The provisioning state of the network interface IP configuration. </summary>
 27283        public ProvisioningState? ProvisioningState { get; }
 84        /// <summary> PrivateLinkConnection properties for the network interface. </summary>
 21685        public NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties PrivateLinkConnectionProperties { get; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\NetworkInterfaceIPConfiguration.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 NetworkInterfaceIPConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 21618            writer.WriteStartObject();
 21619            if (Name != null)
 20            {
 21621                writer.WritePropertyName("name");
 21622                writer.WriteStringValue(Name);
 23            }
 21624            if (Etag != null)
 25            {
 5626                writer.WritePropertyName("etag");
 5627                writer.WriteStringValue(Etag);
 28            }
 21629            if (Id != null)
 30            {
 5631                writer.WritePropertyName("id");
 5632                writer.WriteStringValue(Id);
 33            }
 21634            writer.WritePropertyName("properties");
 21635            writer.WriteStartObject();
 21636            if (VirtualNetworkTaps != null)
 37            {
 038                writer.WritePropertyName("virtualNetworkTaps");
 039                writer.WriteStartArray();
 040                foreach (var item in VirtualNetworkTaps)
 41                {
 042                    writer.WriteObjectValue(item);
 43                }
 044                writer.WriteEndArray();
 45            }
 21646            if (ApplicationGatewayBackendAddressPools != null)
 47            {
 048                writer.WritePropertyName("applicationGatewayBackendAddressPools");
 049                writer.WriteStartArray();
 050                foreach (var item in ApplicationGatewayBackendAddressPools)
 51                {
 052                    writer.WriteObjectValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 21656            if (LoadBalancerBackendAddressPools != null)
 57            {
 3258                writer.WritePropertyName("loadBalancerBackendAddressPools");
 3259                writer.WriteStartArray();
 12860                foreach (var item in LoadBalancerBackendAddressPools)
 61                {
 3262                    writer.WriteObjectValue(item);
 63                }
 3264                writer.WriteEndArray();
 65            }
 21666            if (LoadBalancerInboundNatRules != null)
 67            {
 3268                writer.WritePropertyName("loadBalancerInboundNatRules");
 3269                writer.WriteStartArray();
 12870                foreach (var item in LoadBalancerInboundNatRules)
 71                {
 3272                    writer.WriteObjectValue(item);
 73                }
 3274                writer.WriteEndArray();
 75            }
 21676            if (PrivateIPAddress != null)
 77            {
 7278                writer.WritePropertyName("privateIPAddress");
 7279                writer.WriteStringValue(PrivateIPAddress);
 80            }
 21681            if (PrivateIPAllocationMethod != null)
 82            {
 21683                writer.WritePropertyName("privateIPAllocationMethod");
 21684                writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString());
 85            }
 21686            if (PrivateIPAddressVersion != null)
 87            {
 8888                writer.WritePropertyName("privateIPAddressVersion");
 8889                writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString());
 90            }
 21691            if (Subnet != null)
 92            {
 20893                writer.WritePropertyName("subnet");
 20894                writer.WriteObjectValue(Subnet);
 95            }
 21696            if (Primary != null)
 97            {
 9698                writer.WritePropertyName("primary");
 9699                writer.WriteBooleanValue(Primary.Value);
 100            }
 216101            if (PublicIPAddress != null)
 102            {
 16103                writer.WritePropertyName("publicIPAddress");
 16104                writer.WriteObjectValue(PublicIPAddress);
 105            }
 216106            if (ApplicationSecurityGroups != null)
 107            {
 0108                writer.WritePropertyName("applicationSecurityGroups");
 0109                writer.WriteStartArray();
 0110                foreach (var item in ApplicationSecurityGroups)
 111                {
 0112                    writer.WriteObjectValue(item);
 113                }
 0114                writer.WriteEndArray();
 115            }
 216116            if (ProvisioningState != null)
 117            {
 56118                writer.WritePropertyName("provisioningState");
 56119                writer.WriteStringValue(ProvisioningState.Value.ToString());
 120            }
 216121            if (PrivateLinkConnectionProperties != null)
 122            {
 0123                writer.WritePropertyName("privateLinkConnectionProperties");
 0124                writer.WriteObjectValue(PrivateLinkConnectionProperties);
 125            }
 216126            writer.WriteEndObject();
 216127            writer.WriteEndObject();
 216128        }
 129
 130        internal static NetworkInterfaceIPConfiguration DeserializeNetworkInterfaceIPConfiguration(JsonElement element)
 131        {
 372132            string name = default;
 372133            string etag = default;
 372134            string id = default;
 372135            IList<VirtualNetworkTap> virtualNetworkTaps = default;
 372136            IList<ApplicationGatewayBackendAddressPool> applicationGatewayBackendAddressPools = default;
 372137            IList<BackendAddressPool> loadBalancerBackendAddressPools = default;
 372138            IList<InboundNatRule> loadBalancerInboundNatRules = default;
 372139            string privateIPAddress = default;
 372140            IPAllocationMethod? privateIPAllocationMethod = default;
 372141            IPVersion? privateIPAddressVersion = default;
 372142            Subnet subnet = default;
 372143            bool? primary = default;
 372144            PublicIPAddress publicIPAddress = default;
 372145            IList<ApplicationSecurityGroup> applicationSecurityGroups = default;
 372146            ProvisioningState? provisioningState = default;
 372147            NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default;
 4032148            foreach (var property in element.EnumerateObject())
 149            {
 1644150                if (property.NameEquals("name"))
 151                {
 324152                    if (property.Value.ValueKind == JsonValueKind.Null)
 153                    {
 154                        continue;
 155                    }
 324156                    name = property.Value.GetString();
 324157                    continue;
 158                }
 1320159                if (property.NameEquals("etag"))
 160                {
 324161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 324165                    etag = property.Value.GetString();
 324166                    continue;
 167                }
 996168                if (property.NameEquals("id"))
 169                {
 372170                    if (property.Value.ValueKind == JsonValueKind.Null)
 171                    {
 172                        continue;
 173                    }
 372174                    id = property.Value.GetString();
 372175                    continue;
 176                }
 624177                if (property.NameEquals("properties"))
 178                {
 4896179                    foreach (var property0 in property.Value.EnumerateObject())
 180                    {
 2124181                        if (property0.NameEquals("virtualNetworkTaps"))
 182                        {
 0183                            if (property0.Value.ValueKind == JsonValueKind.Null)
 184                            {
 185                                continue;
 186                            }
 0187                            List<VirtualNetworkTap> array = new List<VirtualNetworkTap>();
 0188                            foreach (var item in property0.Value.EnumerateArray())
 189                            {
 0190                                if (item.ValueKind == JsonValueKind.Null)
 191                                {
 0192                                    array.Add(null);
 193                                }
 194                                else
 195                                {
 0196                                    array.Add(VirtualNetworkTap.DeserializeVirtualNetworkTap(item));
 197                                }
 198                            }
 0199                            virtualNetworkTaps = array;
 0200                            continue;
 201                        }
 2124202                        if (property0.NameEquals("applicationGatewayBackendAddressPools"))
 203                        {
 0204                            if (property0.Value.ValueKind == JsonValueKind.Null)
 205                            {
 206                                continue;
 207                            }
 0208                            List<ApplicationGatewayBackendAddressPool> array = new List<ApplicationGatewayBackendAddress
 0209                            foreach (var item in property0.Value.EnumerateArray())
 210                            {
 0211                                if (item.ValueKind == JsonValueKind.Null)
 212                                {
 0213                                    array.Add(null);
 214                                }
 215                                else
 216                                {
 0217                                    array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendA
 218                                }
 219                            }
 0220                            applicationGatewayBackendAddressPools = array;
 0221                            continue;
 222                        }
 2124223                        if (property0.NameEquals("loadBalancerBackendAddressPools"))
 224                        {
 80225                            if (property0.Value.ValueKind == JsonValueKind.Null)
 226                            {
 227                                continue;
 228                            }
 80229                            List<BackendAddressPool> array = new List<BackendAddressPool>();
 320230                            foreach (var item in property0.Value.EnumerateArray())
 231                            {
 80232                                if (item.ValueKind == JsonValueKind.Null)
 233                                {
 0234                                    array.Add(null);
 235                                }
 236                                else
 237                                {
 80238                                    array.Add(BackendAddressPool.DeserializeBackendAddressPool(item));
 239                                }
 240                            }
 80241                            loadBalancerBackendAddressPools = array;
 80242                            continue;
 243                        }
 2044244                        if (property0.NameEquals("loadBalancerInboundNatRules"))
 245                        {
 80246                            if (property0.Value.ValueKind == JsonValueKind.Null)
 247                            {
 248                                continue;
 249                            }
 80250                            List<InboundNatRule> array = new List<InboundNatRule>();
 320251                            foreach (var item in property0.Value.EnumerateArray())
 252                            {
 80253                                if (item.ValueKind == JsonValueKind.Null)
 254                                {
 0255                                    array.Add(null);
 256                                }
 257                                else
 258                                {
 80259                                    array.Add(InboundNatRule.DeserializeInboundNatRule(item));
 260                                }
 261                            }
 80262                            loadBalancerInboundNatRules = array;
 80263                            continue;
 264                        }
 1964265                        if (property0.NameEquals("privateIPAddress"))
 266                        {
 308267                            if (property0.Value.ValueKind == JsonValueKind.Null)
 268                            {
 269                                continue;
 270                            }
 308271                            privateIPAddress = property0.Value.GetString();
 308272                            continue;
 273                        }
 1656274                        if (property0.NameEquals("privateIPAllocationMethod"))
 275                        {
 324276                            if (property0.Value.ValueKind == JsonValueKind.Null)
 277                            {
 278                                continue;
 279                            }
 324280                            privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString());
 324281                            continue;
 282                        }
 1332283                        if (property0.NameEquals("privateIPAddressVersion"))
 284                        {
 324285                            if (property0.Value.ValueKind == JsonValueKind.Null)
 286                            {
 287                                continue;
 288                            }
 324289                            privateIPAddressVersion = new IPVersion(property0.Value.GetString());
 324290                            continue;
 291                        }
 1008292                        if (property0.NameEquals("subnet"))
 293                        {
 308294                            if (property0.Value.ValueKind == JsonValueKind.Null)
 295                            {
 296                                continue;
 297                            }
 308298                            subnet = Subnet.DeserializeSubnet(property0.Value);
 308299                            continue;
 300                        }
 700301                        if (property0.NameEquals("primary"))
 302                        {
 308303                            if (property0.Value.ValueKind == JsonValueKind.Null)
 304                            {
 305                                continue;
 306                            }
 308307                            primary = property0.Value.GetBoolean();
 308308                            continue;
 309                        }
 392310                        if (property0.NameEquals("publicIPAddress"))
 311                        {
 68312                            if (property0.Value.ValueKind == JsonValueKind.Null)
 313                            {
 314                                continue;
 315                            }
 68316                            publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value);
 68317                            continue;
 318                        }
 324319                        if (property0.NameEquals("applicationSecurityGroups"))
 320                        {
 0321                            if (property0.Value.ValueKind == JsonValueKind.Null)
 322                            {
 323                                continue;
 324                            }
 0325                            List<ApplicationSecurityGroup> array = new List<ApplicationSecurityGroup>();
 0326                            foreach (var item in property0.Value.EnumerateArray())
 327                            {
 0328                                if (item.ValueKind == JsonValueKind.Null)
 329                                {
 0330                                    array.Add(null);
 331                                }
 332                                else
 333                                {
 0334                                    array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item));
 335                                }
 336                            }
 0337                            applicationSecurityGroups = array;
 0338                            continue;
 339                        }
 324340                        if (property0.NameEquals("provisioningState"))
 341                        {
 324342                            if (property0.Value.ValueKind == JsonValueKind.Null)
 343                            {
 344                                continue;
 345                            }
 324346                            provisioningState = new ProvisioningState(property0.Value.GetString());
 324347                            continue;
 348                        }
 0349                        if (property0.NameEquals("privateLinkConnectionProperties"))
 350                        {
 0351                            if (property0.Value.ValueKind == JsonValueKind.Null)
 352                            {
 353                                continue;
 354                            }
 0355                            privateLinkConnectionProperties = NetworkInterfaceIPConfigurationPrivateLinkConnectionProper
 356                            continue;
 357                        }
 358                    }
 359                    continue;
 360                }
 361            }
 372362            return new NetworkInterfaceIPConfiguration(id, name, etag, virtualNetworkTaps, applicationGatewayBackendAddr
 363        }
 364    }
 365}