< Summary

Class:Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetPublicIPAddressConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetPublicIPAddressConfiguration.Serialization.cs
Covered lines:70
Uncovered lines:12
Coverable lines:82
Total lines:198
Line coverage:85.3% (70 of 82)
Covered branches:38
Total branches:46
Branch coverage:82.6% (38 of 46)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
.ctor(...)-100%100%
get_Name()-100%100%
get_IdleTimeoutInMinutes()-100%100%
get_DnsSettings()-100%100%
get_IpTags()-100%100%
get_PublicIPPrefix()-100%100%
get_PublicIPAddressVersion()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-73.08%66.67%
DeserializeVirtualMachineScaleSetPublicIPAddressConfiguration(...)-89.19%90.63%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetPublicIPAddressConfiguration.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 machines scale set IP Configuration&apos;s PublicIPAddress configuration. </summar
 14    public partial class VirtualMachineScaleSetPublicIPAddressConfiguration
 15    {
 16        /// <summary> Initializes a new instance of VirtualMachineScaleSetPublicIPAddressConfiguration. </summary>
 17        /// <param name="name"> The publicIP address configuration name. </param>
 818        public VirtualMachineScaleSetPublicIPAddressConfiguration(string name)
 19        {
 820            if (name == null)
 21            {
 022                throw new ArgumentNullException(nameof(name));
 23            }
 24
 825            Name = name;
 826        }
 27
 28        /// <summary> Initializes a new instance of VirtualMachineScaleSetPublicIPAddressConfiguration. </summary>
 29        /// <param name="name"> The publicIP address configuration name. </param>
 30        /// <param name="idleTimeoutInMinutes"> The idle timeout of the public IP address. </param>
 31        /// <param name="dnsSettings"> The dns settings to be applied on the publicIP addresses . </param>
 32        /// <param name="ipTags"> The list of IP tags associated with the public IP address. </param>
 33        /// <param name="publicIPPrefix"> The PublicIPPrefix from which to allocate publicIP addresses. </param>
 34        /// <param name="publicIPAddressVersion"> Available from Api-Version 2019-07-01 onwards, it represents whether t
 2435        internal VirtualMachineScaleSetPublicIPAddressConfiguration(string name, int? idleTimeoutInMinutes, VirtualMachi
 36        {
 2437            Name = name;
 2438            IdleTimeoutInMinutes = idleTimeoutInMinutes;
 2439            DnsSettings = dnsSettings;
 2440            IpTags = ipTags;
 2441            PublicIPPrefix = publicIPPrefix;
 2442            PublicIPAddressVersion = publicIPAddressVersion;
 2443        }
 44
 45        /// <summary> The publicIP address configuration name. </summary>
 5646        public string Name { get; set; }
 47        /// <summary> The idle timeout of the public IP address. </summary>
 7248        public int? IdleTimeoutInMinutes { get; set; }
 49        /// <summary> The dns settings to be applied on the publicIP addresses . </summary>
 8050        public VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings DnsSettings { get; set; }
 51        /// <summary> The list of IP tags associated with the public IP address. </summary>
 4052        public IList<VirtualMachineScaleSetIpTag> IpTags { get; set; }
 53        /// <summary> The PublicIPPrefix from which to allocate publicIP addresses. </summary>
 6054        public SubResource PublicIPPrefix { get; set; }
 55        /// <summary> Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration 
 4056        public IPVersion? PublicIPAddressVersion { get; set; }
 57    }
 58}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\VirtualMachineScaleSetPublicIPAddressConfiguration.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 VirtualMachineScaleSetPublicIPAddressConfiguration : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 1618            writer.WriteStartObject();
 1619            writer.WritePropertyName("name");
 1620            writer.WriteStringValue(Name);
 1621            writer.WritePropertyName("properties");
 1622            writer.WriteStartObject();
 1623            if (IdleTimeoutInMinutes != null)
 24            {
 1625                writer.WritePropertyName("idleTimeoutInMinutes");
 1626                writer.WriteNumberValue(IdleTimeoutInMinutes.Value);
 27            }
 1628            if (DnsSettings != null)
 29            {
 1630                writer.WritePropertyName("dnsSettings");
 1631                writer.WriteObjectValue(DnsSettings);
 32            }
 1633            if (IpTags != null)
 34            {
 035                writer.WritePropertyName("ipTags");
 036                writer.WriteStartArray();
 037                foreach (var item in IpTags)
 38                {
 039                    writer.WriteObjectValue(item);
 40                }
 041                writer.WriteEndArray();
 42            }
 1643            if (PublicIPPrefix != null)
 44            {
 845                writer.WritePropertyName("publicIPPrefix");
 846                writer.WriteObjectValue(PublicIPPrefix);
 47            }
 1648            if (PublicIPAddressVersion != null)
 49            {
 050                writer.WritePropertyName("publicIPAddressVersion");
 051                writer.WriteStringValue(PublicIPAddressVersion.Value.ToString());
 52            }
 1653            writer.WriteEndObject();
 1654            writer.WriteEndObject();
 1655        }
 56
 57        internal static VirtualMachineScaleSetPublicIPAddressConfiguration DeserializeVirtualMachineScaleSetPublicIPAddr
 58        {
 2459            string name = default;
 2460            int? idleTimeoutInMinutes = default;
 2461            VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default;
 2462            IList<VirtualMachineScaleSetIpTag> ipTags = default;
 2463            SubResource publicIPPrefix = default;
 2464            IPVersion? publicIPAddressVersion = default;
 14465            foreach (var property in element.EnumerateObject())
 66            {
 4867                if (property.NameEquals("name"))
 68                {
 2469                    name = property.Value.GetString();
 2470                    continue;
 71                }
 2472                if (property.NameEquals("properties"))
 73                {
 26474                    foreach (var property0 in property.Value.EnumerateObject())
 75                    {
 10876                        if (property0.NameEquals("idleTimeoutInMinutes"))
 77                        {
 2478                            if (property0.Value.ValueKind == JsonValueKind.Null)
 79                            {
 80                                continue;
 81                            }
 2482                            idleTimeoutInMinutes = property0.Value.GetInt32();
 2483                            continue;
 84                        }
 8485                        if (property0.NameEquals("dnsSettings"))
 86                        {
 2487                            if (property0.Value.ValueKind == JsonValueKind.Null)
 88                            {
 89                                continue;
 90                            }
 2491                            dnsSettings = VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings.DeserializeVirtu
 2492                            continue;
 93                        }
 6094                        if (property0.NameEquals("ipTags"))
 95                        {
 2496                            if (property0.Value.ValueKind == JsonValueKind.Null)
 97                            {
 98                                continue;
 99                            }
 24100                            List<VirtualMachineScaleSetIpTag> array = new List<VirtualMachineScaleSetIpTag>();
 0101                            foreach (var item in property0.Value.EnumerateArray())
 102                            {
 0103                                if (item.ValueKind == JsonValueKind.Null)
 104                                {
 0105                                    array.Add(null);
 106                                }
 107                                else
 108                                {
 0109                                    array.Add(VirtualMachineScaleSetIpTag.DeserializeVirtualMachineScaleSetIpTag(item));
 110                                }
 111                            }
 24112                            ipTags = array;
 24113                            continue;
 114                        }
 36115                        if (property0.NameEquals("publicIPPrefix"))
 116                        {
 12117                            if (property0.Value.ValueKind == JsonValueKind.Null)
 118                            {
 119                                continue;
 120                            }
 12121                            publicIPPrefix = SubResource.DeserializeSubResource(property0.Value);
 12122                            continue;
 123                        }
 24124                        if (property0.NameEquals("publicIPAddressVersion"))
 125                        {
 24126                            if (property0.Value.ValueKind == JsonValueKind.Null)
 127                            {
 128                                continue;
 129                            }
 24130                            publicIPAddressVersion = new IPVersion(property0.Value.GetString());
 131                            continue;
 132                        }
 133                    }
 134                    continue;
 135                }
 136            }
 24137            return new VirtualMachineScaleSetPublicIPAddressConfiguration(name, idleTimeoutInMinutes, dnsSettings, ipTag
 138        }
 139    }
 140}