< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetIPConfiguration
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIPConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIPConfiguration.Serialization.cs
Covered lines:110
Uncovered lines:34
Coverable lines:144
Total lines:322
Line coverage:76.3% (110 of 144)
Covered branches:63
Total branches:88
Branch coverage:71.5% (63 of 88)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_Subnet()-100%100%
get_Primary()-100%100%
get_PublicIPAddressConfiguration()-100%100%
get_PrivateIPAddressVersion()-100%100%
get_ApplicationGatewayBackendAddressPools()-100%100%
get_ApplicationSecurityGroups()-100%100%
get_LoadBalancerBackendAddressPools()-100%100%
get_LoadBalancerInboundNatPools()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-74.47%73.08%
DeserializeVirtualMachineScaleSetIPConfiguration(...)-70.83%71.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIPConfiguration.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Compute.Models
 12{
 13    /// <summary> Describes a virtual machine scale set network profile&apos;s IP configuration. </summary>
 14    public partial class VirtualMachineScaleSetIPConfiguration : SubResource
 15    {
 16        /// <summary> Initializes a new instance of VirtualMachineScaleSetIPConfiguration. </summary>
 17        /// <param name="name"> The IP configuration name. </param>
 16818        public VirtualMachineScaleSetIPConfiguration(string name)
 19        {
 16820            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 16825            Name = name;
 16826        }
 27
 28        /// <summary> Initializes a new instance of VirtualMachineScaleSetIPConfiguration. </summary>
 29        /// <param name="id"> Resource Id. </param>
 30        /// <param name="name"> The IP configuration name. </param>
 31        /// <param name="subnet"> Specifies the identifier of the subnet. </param>
 32        /// <param name="primary"> Specifies the primary network interface in case the virtual machine has more than 1 n
 33        /// <param name="publicIPAddressConfiguration"> The publicIPAddressConfiguration. </param>
 34        /// <param name="privateIPAddressVersion"> Available from Api-Version 2017-03-30 onwards, it represents whether 
 35        /// <param name="applicationGatewayBackendAddressPools"> Specifies an array of references to backend address poo
 36        /// <param name="applicationSecurityGroups"> Specifies an array of references to application security group. </p
 37        /// <param name="loadBalancerBackendAddressPools"> Specifies an array of references to backend address pools of 
 38        /// <param name="loadBalancerInboundNatPools"> Specifies an array of references to inbound Nat pools of the load
 56039        internal VirtualMachineScaleSetIPConfiguration(string id, string name, ApiEntityReference subnet, bool? primary,
 40        {
 56041            Name = name;
 56042            Subnet = subnet;
 56043            Primary = primary;
 56044            PublicIPAddressConfiguration = publicIPAddressConfiguration;
 56045            PrivateIPAddressVersion = privateIPAddressVersion;
 56046            ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools;
 56047            ApplicationSecurityGroups = applicationSecurityGroups;
 56048            LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools;
 56049            LoadBalancerInboundNatPools = loadBalancerInboundNatPools;
 56050        }
 51
 52        /// <summary> The IP configuration name. </summary>
 171253        public string Name { get; set; }
 54        /// <summary> Specifies the identifier of the subnet. </summary>
 147655        public ApiEntityReference Subnet { get; set; }
 56        /// <summary> Specifies the primary network interface in case the virtual machine has more than 1 network interf
 96057        public bool? Primary { get; set; }
 58        /// <summary> The publicIPAddressConfiguration. </summary>
 100859        public VirtualMachineScaleSetPublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; }
 60        /// <summary> Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration 
 96461        public IPVersion? PrivateIPAddressVersion { get; set; }
 62        /// <summary> Specifies an array of references to backend address pools of application gateways. A scale set can
 235263        public IList<SubResource> ApplicationGatewayBackendAddressPools { get; set; }
 64        /// <summary> Specifies an array of references to application security group. </summary>
 94065        public IList<SubResource> ApplicationSecurityGroups { get; set; }
 66        /// <summary> Specifies an array of references to backend address pools of load balancers. A scale set can refer
 114867        public IList<SubResource> LoadBalancerBackendAddressPools { get; set; }
 68        /// <summary> Specifies an array of references to inbound Nat pools of the load balancers. A scale set can refer
 94069        public IList<SubResource> LoadBalancerInboundNatPools { get; set; }
 70    }
 71}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetIPConfiguration.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.Compute.Models
 13{
 14    public partial class VirtualMachineScaleSetIPConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 38018            writer.WriteStartObject();
 38019            writer.WritePropertyName("name");
 38020            writer.WriteStringValue(Name);
 38021            if (Id != null)
 22            {
 023                writer.WritePropertyName("id");
 024                writer.WriteStringValue(Id);
 25            }
 38026            writer.WritePropertyName("properties");
 38027            writer.WriteStartObject();
 38028            if (Subnet != null)
 29            {
 37230                writer.WritePropertyName("subnet");
 37231                writer.WriteObjectValue(Subnet);
 32            }
 38033            if (Primary != null)
 34            {
 835                writer.WritePropertyName("primary");
 836                writer.WriteBooleanValue(Primary.Value);
 37            }
 38038            if (PublicIPAddressConfiguration != null)
 39            {
 1640                writer.WritePropertyName("publicIPAddressConfiguration");
 1641                writer.WriteObjectValue(PublicIPAddressConfiguration);
 42            }
 38043            if (PrivateIPAddressVersion != null)
 44            {
 1645                writer.WritePropertyName("privateIPAddressVersion");
 1646                writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString());
 47            }
 38048            if (ApplicationGatewayBackendAddressPools != null)
 49            {
 36450                writer.WritePropertyName("applicationGatewayBackendAddressPools");
 36451                writer.WriteStartArray();
 74452                foreach (var item in ApplicationGatewayBackendAddressPools)
 53                {
 854                    writer.WriteObjectValue(item);
 55                }
 36456                writer.WriteEndArray();
 57            }
 38058            if (ApplicationSecurityGroups != null)
 59            {
 060                writer.WritePropertyName("applicationSecurityGroups");
 061                writer.WriteStartArray();
 062                foreach (var item in ApplicationSecurityGroups)
 63                {
 064                    writer.WriteObjectValue(item);
 65                }
 066                writer.WriteEndArray();
 67            }
 38068            if (LoadBalancerBackendAddressPools != null)
 69            {
 4870                writer.WritePropertyName("loadBalancerBackendAddressPools");
 4871                writer.WriteStartArray();
 19272                foreach (var item in LoadBalancerBackendAddressPools)
 73                {
 4874                    writer.WriteObjectValue(item);
 75                }
 4876                writer.WriteEndArray();
 77            }
 38078            if (LoadBalancerInboundNatPools != null)
 79            {
 080                writer.WritePropertyName("loadBalancerInboundNatPools");
 081                writer.WriteStartArray();
 082                foreach (var item in LoadBalancerInboundNatPools)
 83                {
 084                    writer.WriteObjectValue(item);
 85                }
 086                writer.WriteEndArray();
 87            }
 38088            writer.WriteEndObject();
 38089            writer.WriteEndObject();
 38090        }
 91
 92        internal static VirtualMachineScaleSetIPConfiguration DeserializeVirtualMachineScaleSetIPConfiguration(JsonEleme
 93        {
 56094            string name = default;
 56095            string id = default;
 56096            ApiEntityReference subnet = default;
 56097            bool? primary = default;
 56098            VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration = default;
 56099            IPVersion? privateIPAddressVersion = default;
 560100            IList<SubResource> applicationGatewayBackendAddressPools = default;
 560101            IList<SubResource> applicationSecurityGroups = default;
 560102            IList<SubResource> loadBalancerBackendAddressPools = default;
 560103            IList<SubResource> loadBalancerInboundNatPools = default;
 3360104            foreach (var property in element.EnumerateObject())
 105            {
 1120106                if (property.NameEquals("name"))
 107                {
 560108                    name = property.Value.GetString();
 560109                    continue;
 110                }
 560111                if (property.NameEquals("id"))
 112                {
 0113                    if (property.Value.ValueKind == JsonValueKind.Null)
 114                    {
 115                        continue;
 116                    }
 0117                    id = property.Value.GetString();
 0118                    continue;
 119                }
 560120                if (property.NameEquals("properties"))
 121                {
 3520122                    foreach (var property0 in property.Value.EnumerateObject())
 123                    {
 1200124                        if (property0.NameEquals("subnet"))
 125                        {
 548126                            if (property0.Value.ValueKind == JsonValueKind.Null)
 127                            {
 128                                continue;
 129                            }
 548130                            subnet = ApiEntityReference.DeserializeApiEntityReference(property0.Value);
 548131                            continue;
 132                        }
 652133                        if (property0.NameEquals("primary"))
 134                        {
 12135                            if (property0.Value.ValueKind == JsonValueKind.Null)
 136                            {
 137                                continue;
 138                            }
 12139                            primary = property0.Value.GetBoolean();
 12140                            continue;
 141                        }
 640142                        if (property0.NameEquals("publicIPAddressConfiguration"))
 143                        {
 24144                            if (property0.Value.ValueKind == JsonValueKind.Null)
 145                            {
 146                                continue;
 147                            }
 24148                            publicIPAddressConfiguration = VirtualMachineScaleSetPublicIPAddressConfiguration.Deserializ
 24149                            continue;
 150                        }
 616151                        if (property0.NameEquals("privateIPAddressVersion"))
 152                        {
 560153                            if (property0.Value.ValueKind == JsonValueKind.Null)
 154                            {
 155                                continue;
 156                            }
 560157                            privateIPAddressVersion = new IPVersion(property0.Value.GetString());
 560158                            continue;
 159                        }
 56160                        if (property0.NameEquals("applicationGatewayBackendAddressPools"))
 161                        {
 8162                            if (property0.Value.ValueKind == JsonValueKind.Null)
 163                            {
 164                                continue;
 165                            }
 8166                            List<SubResource> array = new List<SubResource>();
 32167                            foreach (var item in property0.Value.EnumerateArray())
 168                            {
 8169                                if (item.ValueKind == JsonValueKind.Null)
 170                                {
 0171                                    array.Add(null);
 172                                }
 173                                else
 174                                {
 8175                                    array.Add(DeserializeSubResource(item));
 176                                }
 177                            }
 8178                            applicationGatewayBackendAddressPools = array;
 8179                            continue;
 180                        }
 48181                        if (property0.NameEquals("applicationSecurityGroups"))
 182                        {
 0183                            if (property0.Value.ValueKind == JsonValueKind.Null)
 184                            {
 185                                continue;
 186                            }
 0187                            List<SubResource> array = new List<SubResource>();
 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(DeserializeSubResource(item));
 197                                }
 198                            }
 0199                            applicationSecurityGroups = array;
 0200                            continue;
 201                        }
 48202                        if (property0.NameEquals("loadBalancerBackendAddressPools"))
 203                        {
 48204                            if (property0.Value.ValueKind == JsonValueKind.Null)
 205                            {
 206                                continue;
 207                            }
 48208                            List<SubResource> array = new List<SubResource>();
 192209                            foreach (var item in property0.Value.EnumerateArray())
 210                            {
 48211                                if (item.ValueKind == JsonValueKind.Null)
 212                                {
 0213                                    array.Add(null);
 214                                }
 215                                else
 216                                {
 48217                                    array.Add(DeserializeSubResource(item));
 218                                }
 219                            }
 48220                            loadBalancerBackendAddressPools = array;
 48221                            continue;
 222                        }
 0223                        if (property0.NameEquals("loadBalancerInboundNatPools"))
 224                        {
 0225                            if (property0.Value.ValueKind == JsonValueKind.Null)
 226                            {
 227                                continue;
 228                            }
 0229                            List<SubResource> array = new List<SubResource>();
 0230                            foreach (var item in property0.Value.EnumerateArray())
 231                            {
 0232                                if (item.ValueKind == JsonValueKind.Null)
 233                                {
 0234                                    array.Add(null);
 235                                }
 236                                else
 237                                {
 0238                                    array.Add(DeserializeSubResource(item));
 239                                }
 240                            }
 0241                            loadBalancerInboundNatPools = array;
 242                            continue;
 243                        }
 244                    }
 245                    continue;
 246                }
 247            }
 560248            return new VirtualMachineScaleSetIPConfiguration(id, name, subnet, primary, publicIPAddressConfiguration, pr
 249        }
 250    }
 251}