< Summary

Class:Azure.ResourceManager.Network.Models.FrontendIPConfiguration
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FrontendIPConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FrontendIPConfiguration.Serialization.cs
Covered lines:172
Uncovered lines:39
Coverable lines:211
Total lines:452
Line coverage:81.5% (172 of 211)
Covered branches:105
Total branches:132
Branch coverage:79.5% (105 of 132)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Etag()-100%100%
get_Type()-100%100%
get_Zones()-100%100%
get_InboundNatRules()-100%100%
get_InboundNatPools()-100%100%
get_OutboundRules()-100%100%
get_LoadBalancingRules()-100%100%
get_PrivateIPAddress()-100%100%
get_PrivateIPAllocationMethod()-100%100%
get_PrivateIPAddressVersion()-100%100%
get_Subnet()-100%100%
get_PublicIPAddress()-100%100%
get_PublicIPPrefix()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-75.36%76.19%
DeserializeFrontendIPConfiguration(...)-79.63%81.11%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FrontendIPConfiguration.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> Frontend IP address of the load balancer. </summary>
 13    public partial class FrontendIPConfiguration : SubResource
 14    {
 15        /// <summary> Initializes a new instance of FrontendIPConfiguration. </summary>
 3216        public FrontendIPConfiguration()
 17        {
 3218        }
 19
 20        /// <summary> Initializes a new instance of FrontendIPConfiguration. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within the set of frontend IP configurations use
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Type of the resource. </param>
 25        /// <param name="zones"> A list of availability zones denoting the IP allocated for the resource needs to come f
 26        /// <param name="inboundNatRules"> An array of references to inbound rules that use this frontend IP. </param>
 27        /// <param name="inboundNatPools"> An array of references to inbound pools that use this frontend IP. </param>
 28        /// <param name="outboundRules"> An array of references to outbound rules that use this frontend IP. </param>
 29        /// <param name="loadBalancingRules"> An array of references to load balancing rules that use this frontend IP. 
 30        /// <param name="privateIPAddress"> The private IP address of the IP configuration. </param>
 31        /// <param name="privateIPAllocationMethod"> The Private IP allocation method. </param>
 32        /// <param name="privateIPAddressVersion"> Whether the specific ipconfiguration is IPv4 or IPv6. Default is take
 33        /// <param name="subnet"> The reference to the subnet resource. </param>
 34        /// <param name="publicIPAddress"> The reference to the Public IP resource. </param>
 35        /// <param name="publicIPPrefix"> The reference to the Public IP Prefix resource. </param>
 36        /// <param name="provisioningState"> The provisioning state of the frontend IP configuration resource. </param>
 12037        internal FrontendIPConfiguration(string id, string name, string etag, string type, IList<string> zones, IList<Su
 38        {
 12039            Name = name;
 12040            Etag = etag;
 12041            Type = type;
 12042            Zones = zones;
 12043            InboundNatRules = inboundNatRules;
 12044            InboundNatPools = inboundNatPools;
 12045            OutboundRules = outboundRules;
 12046            LoadBalancingRules = loadBalancingRules;
 12047            PrivateIPAddress = privateIPAddress;
 12048            PrivateIPAllocationMethod = privateIPAllocationMethod;
 12049            PrivateIPAddressVersion = privateIPAddressVersion;
 12050            Subnet = subnet;
 12051            PublicIPAddress = publicIPAddress;
 12052            PublicIPPrefix = publicIPPrefix;
 12053            ProvisioningState = provisioningState;
 12054        }
 55
 56        /// <summary> The name of the resource that is unique within the set of frontend IP configurations used by the l
 37257        public string Name { get; set; }
 58        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 12059        public string Etag { get; }
 60        /// <summary> Type of the resource. </summary>
 11261        public string Type { get; }
 62        /// <summary> A list of availability zones denoting the IP allocated for the resource needs to come from. </summ
 21663        public IList<string> Zones { get; set; }
 64        /// <summary> An array of references to inbound rules that use this frontend IP. </summary>
 12865        public IList<SubResource> InboundNatRules { get; }
 66        /// <summary> An array of references to inbound pools that use this frontend IP. </summary>
 10867        public IList<SubResource> InboundNatPools { get; }
 68        /// <summary> An array of references to outbound rules that use this frontend IP. </summary>
 9669        public IList<SubResource> OutboundRules { get; }
 70        /// <summary> An array of references to load balancing rules that use this frontend IP. </summary>
 10471        public IList<SubResource> LoadBalancingRules { get; }
 72        /// <summary> The private IP address of the IP configuration. </summary>
 30073        public string PrivateIPAddress { get; set; }
 74        /// <summary> The Private IP allocation method. </summary>
 29675        public IPAllocationMethod? PrivateIPAllocationMethod { get; set; }
 76        /// <summary> Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. </summary>
 23277        public IPVersion? PrivateIPAddressVersion { get; set; }
 78        /// <summary> The reference to the subnet resource. </summary>
 30079        public Subnet Subnet { get; set; }
 80        /// <summary> The reference to the Public IP resource. </summary>
 29681        public PublicIPAddress PublicIPAddress { get; set; }
 82        /// <summary> The reference to the Public IP Prefix resource. </summary>
 21683        public SubResource PublicIPPrefix { get; set; }
 84        /// <summary> The provisioning state of the frontend IP configuration resource. </summary>
 13285        public ProvisioningState? ProvisioningState { get; }
 86    }
 87}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FrontendIPConfiguration.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 FrontendIPConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 9618            writer.WriteStartObject();
 9619            if (Name != null)
 20            {
 9621                writer.WritePropertyName("name");
 9622                writer.WriteStringValue(Name);
 23            }
 9624            if (Etag != null)
 25            {
 1626                writer.WritePropertyName("etag");
 1627                writer.WriteStringValue(Etag);
 28            }
 9629            if (Type != null)
 30            {
 1631                writer.WritePropertyName("type");
 1632                writer.WriteStringValue(Type);
 33            }
 9634            if (Zones != null)
 35            {
 036                writer.WritePropertyName("zones");
 037                writer.WriteStartArray();
 038                foreach (var item in Zones)
 39                {
 040                    writer.WriteStringValue(item);
 41                }
 042                writer.WriteEndArray();
 43            }
 9644            if (Id != null)
 45            {
 1646                writer.WritePropertyName("id");
 1647                writer.WriteStringValue(Id);
 48            }
 9649            writer.WritePropertyName("properties");
 9650            writer.WriteStartObject();
 9651            if (InboundNatRules != null)
 52            {
 053                writer.WritePropertyName("inboundNatRules");
 054                writer.WriteStartArray();
 055                foreach (var item in InboundNatRules)
 56                {
 057                    writer.WriteObjectValue(item);
 58                }
 059                writer.WriteEndArray();
 60            }
 9661            if (InboundNatPools != null)
 62            {
 863                writer.WritePropertyName("inboundNatPools");
 864                writer.WriteStartArray();
 3265                foreach (var item in InboundNatPools)
 66                {
 867                    writer.WriteObjectValue(item);
 68                }
 869                writer.WriteEndArray();
 70            }
 9671            if (OutboundRules != null)
 72            {
 073                writer.WritePropertyName("outboundRules");
 074                writer.WriteStartArray();
 075                foreach (var item in OutboundRules)
 76                {
 077                    writer.WriteObjectValue(item);
 78                }
 079                writer.WriteEndArray();
 80            }
 9681            if (LoadBalancingRules != null)
 82            {
 883                writer.WritePropertyName("loadBalancingRules");
 884                writer.WriteStartArray();
 3285                foreach (var item in LoadBalancingRules)
 86                {
 887                    writer.WriteObjectValue(item);
 88                }
 889                writer.WriteEndArray();
 90            }
 9691            if (PrivateIPAddress != null)
 92            {
 4893                writer.WritePropertyName("privateIPAddress");
 4894                writer.WriteStringValue(PrivateIPAddress);
 95            }
 9696            if (PrivateIPAllocationMethod != null)
 97            {
 6498                writer.WritePropertyName("privateIPAllocationMethod");
 6499                writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString());
 100            }
 96101            if (PrivateIPAddressVersion != null)
 102            {
 16103                writer.WritePropertyName("privateIPAddressVersion");
 16104                writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString());
 105            }
 96106            if (Subnet != null)
 107            {
 56108                writer.WritePropertyName("subnet");
 56109                writer.WriteObjectValue(Subnet);
 110            }
 96111            if (PublicIPAddress != null)
 112            {
 40113                writer.WritePropertyName("publicIPAddress");
 40114                writer.WriteObjectValue(PublicIPAddress);
 115            }
 96116            if (PublicIPPrefix != null)
 117            {
 0118                writer.WritePropertyName("publicIPPrefix");
 0119                writer.WriteObjectValue(PublicIPPrefix);
 120            }
 96121            if (ProvisioningState != null)
 122            {
 16123                writer.WritePropertyName("provisioningState");
 16124                writer.WriteStringValue(ProvisioningState.Value.ToString());
 125            }
 96126            writer.WriteEndObject();
 96127            writer.WriteEndObject();
 96128        }
 129
 130        internal static FrontendIPConfiguration DeserializeFrontendIPConfiguration(JsonElement element)
 131        {
 120132            string name = default;
 120133            string etag = default;
 120134            string type = default;
 120135            IList<string> zones = default;
 120136            string id = default;
 120137            IList<SubResource> inboundNatRules = default;
 120138            IList<SubResource> inboundNatPools = default;
 120139            IList<SubResource> outboundRules = default;
 120140            IList<SubResource> loadBalancingRules = default;
 120141            string privateIPAddress = default;
 120142            IPAllocationMethod? privateIPAllocationMethod = default;
 120143            IPVersion? privateIPAddressVersion = default;
 120144            Subnet subnet = default;
 120145            PublicIPAddress publicIPAddress = default;
 120146            SubResource publicIPPrefix = default;
 120147            ProvisioningState? provisioningState = default;
 1440148            foreach (var property in element.EnumerateObject())
 149            {
 600150                if (property.NameEquals("name"))
 151                {
 120152                    if (property.Value.ValueKind == JsonValueKind.Null)
 153                    {
 154                        continue;
 155                    }
 120156                    name = property.Value.GetString();
 120157                    continue;
 158                }
 480159                if (property.NameEquals("etag"))
 160                {
 120161                    if (property.Value.ValueKind == JsonValueKind.Null)
 162                    {
 163                        continue;
 164                    }
 120165                    etag = property.Value.GetString();
 120166                    continue;
 167                }
 360168                if (property.NameEquals("type"))
 169                {
 120170                    if (property.Value.ValueKind == JsonValueKind.Null)
 171                    {
 172                        continue;
 173                    }
 120174                    type = property.Value.GetString();
 120175                    continue;
 176                }
 240177                if (property.NameEquals("zones"))
 178                {
 0179                    if (property.Value.ValueKind == JsonValueKind.Null)
 180                    {
 181                        continue;
 182                    }
 0183                    List<string> array = new List<string>();
 0184                    foreach (var item in property.Value.EnumerateArray())
 185                    {
 0186                        if (item.ValueKind == JsonValueKind.Null)
 187                        {
 0188                            array.Add(null);
 189                        }
 190                        else
 191                        {
 0192                            array.Add(item.GetString());
 193                        }
 194                    }
 0195                    zones = array;
 0196                    continue;
 197                }
 240198                if (property.NameEquals("id"))
 199                {
 120200                    if (property.Value.ValueKind == JsonValueKind.Null)
 201                    {
 202                        continue;
 203                    }
 120204                    id = property.Value.GetString();
 120205                    continue;
 206                }
 120207                if (property.NameEquals("properties"))
 208                {
 1768209                    foreach (var property0 in property.Value.EnumerateObject())
 210                    {
 764211                        if (property0.NameEquals("inboundNatRules"))
 212                        {
 104213                            if (property0.Value.ValueKind == JsonValueKind.Null)
 214                            {
 215                                continue;
 216                            }
 104217                            List<SubResource> array = new List<SubResource>();
 624218                            foreach (var item in property0.Value.EnumerateArray())
 219                            {
 208220                                if (item.ValueKind == JsonValueKind.Null)
 221                                {
 0222                                    array.Add(null);
 223                                }
 224                                else
 225                                {
 208226                                    array.Add(DeserializeSubResource(item));
 227                                }
 228                            }
 104229                            inboundNatRules = array;
 104230                            continue;
 231                        }
 660232                        if (property0.NameEquals("inboundNatPools"))
 233                        {
 4234                            if (property0.Value.ValueKind == JsonValueKind.Null)
 235                            {
 236                                continue;
 237                            }
 4238                            List<SubResource> array = new List<SubResource>();
 16239                            foreach (var item in property0.Value.EnumerateArray())
 240                            {
 4241                                if (item.ValueKind == JsonValueKind.Null)
 242                                {
 0243                                    array.Add(null);
 244                                }
 245                                else
 246                                {
 4247                                    array.Add(DeserializeSubResource(item));
 248                                }
 249                            }
 4250                            inboundNatPools = array;
 4251                            continue;
 252                        }
 656253                        if (property0.NameEquals("outboundRules"))
 254                        {
 0255                            if (property0.Value.ValueKind == JsonValueKind.Null)
 256                            {
 257                                continue;
 258                            }
 0259                            List<SubResource> array = new List<SubResource>();
 0260                            foreach (var item in property0.Value.EnumerateArray())
 261                            {
 0262                                if (item.ValueKind == JsonValueKind.Null)
 263                                {
 0264                                    array.Add(null);
 265                                }
 266                                else
 267                                {
 0268                                    array.Add(DeserializeSubResource(item));
 269                                }
 270                            }
 0271                            outboundRules = array;
 0272                            continue;
 273                        }
 656274                        if (property0.NameEquals("loadBalancingRules"))
 275                        {
 116276                            if (property0.Value.ValueKind == JsonValueKind.Null)
 277                            {
 278                                continue;
 279                            }
 116280                            List<SubResource> array = new List<SubResource>();
 464281                            foreach (var item in property0.Value.EnumerateArray())
 282                            {
 116283                                if (item.ValueKind == JsonValueKind.Null)
 284                                {
 0285                                    array.Add(null);
 286                                }
 287                                else
 288                                {
 116289                                    array.Add(DeserializeSubResource(item));
 290                                }
 291                            }
 116292                            loadBalancingRules = array;
 116293                            continue;
 294                        }
 540295                        if (property0.NameEquals("privateIPAddress"))
 296                        {
 60297                            if (property0.Value.ValueKind == JsonValueKind.Null)
 298                            {
 299                                continue;
 300                            }
 60301                            privateIPAddress = property0.Value.GetString();
 60302                            continue;
 303                        }
 480304                        if (property0.NameEquals("privateIPAllocationMethod"))
 305                        {
 120306                            if (property0.Value.ValueKind == JsonValueKind.Null)
 307                            {
 308                                continue;
 309                            }
 120310                            privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString());
 120311                            continue;
 312                        }
 360313                        if (property0.NameEquals("privateIPAddressVersion"))
 314                        {
 120315                            if (property0.Value.ValueKind == JsonValueKind.Null)
 316                            {
 317                                continue;
 318                            }
 120319                            privateIPAddressVersion = new IPVersion(property0.Value.GetString());
 120320                            continue;
 321                        }
 240322                        if (property0.NameEquals("subnet"))
 323                        {
 60324                            if (property0.Value.ValueKind == JsonValueKind.Null)
 325                            {
 326                                continue;
 327                            }
 60328                            subnet = Subnet.DeserializeSubnet(property0.Value);
 60329                            continue;
 330                        }
 180331                        if (property0.NameEquals("publicIPAddress"))
 332                        {
 60333                            if (property0.Value.ValueKind == JsonValueKind.Null)
 334                            {
 335                                continue;
 336                            }
 60337                            publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value);
 60338                            continue;
 339                        }
 120340                        if (property0.NameEquals("publicIPPrefix"))
 341                        {
 0342                            if (property0.Value.ValueKind == JsonValueKind.Null)
 343                            {
 344                                continue;
 345                            }
 0346                            publicIPPrefix = DeserializeSubResource(property0.Value);
 0347                            continue;
 348                        }
 120349                        if (property0.NameEquals("provisioningState"))
 350                        {
 120351                            if (property0.Value.ValueKind == JsonValueKind.Null)
 352                            {
 353                                continue;
 354                            }
 120355                            provisioningState = new ProvisioningState(property0.Value.GetString());
 356                            continue;
 357                        }
 358                    }
 359                    continue;
 360                }
 361            }
 120362            return new FrontendIPConfiguration(id, name, etag, type, zones, inboundNatRules, inboundNatPools, outboundRu
 363        }
 364    }
 365}