< Summary

Class:Azure.ResourceManager.Network.Models.IPConfiguration
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPConfiguration.Serialization.cs
Covered lines:55
Uncovered lines:36
Coverable lines:91
Total lines:212
Line coverage:60.4% (55 of 91)
Covered branches:38
Total branches:54
Branch coverage:70.3% (38 of 54)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Etag()-100%100%
get_PrivateIPAddress()-100%100%
get_PrivateIPAllocationMethod()-0%100%
get_Subnet()-0%100%
get_PublicIPAddress()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeIPConfiguration(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPConfiguration.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> IP configuration. </summary>
 11    public partial class IPConfiguration : SubResource
 12    {
 13        /// <summary> Initializes a new instance of IPConfiguration. </summary>
 014        public IPConfiguration()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of IPConfiguration. </summary>
 19        /// <param name="id"> Resource ID. </param>
 20        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 21        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 22        /// <param name="privateIPAddress"> The private IP address of the IP configuration. </param>
 23        /// <param name="privateIPAllocationMethod"> The private IP address allocation method. </param>
 24        /// <param name="subnet"> The reference to the subnet resource. </param>
 25        /// <param name="publicIPAddress"> The reference to the public IP resource. </param>
 26        /// <param name="provisioningState"> The provisioning state of the IP configuration resource. </param>
 10027        internal IPConfiguration(string id, string name, string etag, string privateIPAddress, IPAllocationMethod? priva
 28        {
 10029            Name = name;
 10030            Etag = etag;
 10031            PrivateIPAddress = privateIPAddress;
 10032            PrivateIPAllocationMethod = privateIPAllocationMethod;
 10033            Subnet = subnet;
 10034            PublicIPAddress = publicIPAddress;
 10035            ProvisioningState = provisioningState;
 10036        }
 37
 38        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 11639        public string Name { get; set; }
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 1641        public string Etag { get; }
 42        /// <summary> The private IP address of the IP configuration. </summary>
 11243        public string PrivateIPAddress { get; set; }
 44        /// <summary> The private IP address allocation method. </summary>
 045        public IPAllocationMethod? PrivateIPAllocationMethod { get; set; }
 46        /// <summary> The reference to the subnet resource. </summary>
 047        public Subnet Subnet { get; set; }
 48        /// <summary> The reference to the public IP resource. </summary>
 049        public PublicIPAddress PublicIPAddress { get; set; }
 50        /// <summary> The provisioning state of the IP configuration resource. </summary>
 051        public ProvisioningState? ProvisioningState { get; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\IPConfiguration.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class IPConfiguration : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 023            if (Etag != null)
 24            {
 025                writer.WritePropertyName("etag");
 026                writer.WriteStringValue(Etag);
 27            }
 028            if (Id != null)
 29            {
 030                writer.WritePropertyName("id");
 031                writer.WriteStringValue(Id);
 32            }
 033            writer.WritePropertyName("properties");
 034            writer.WriteStartObject();
 035            if (PrivateIPAddress != null)
 36            {
 037                writer.WritePropertyName("privateIPAddress");
 038                writer.WriteStringValue(PrivateIPAddress);
 39            }
 040            if (PrivateIPAllocationMethod != null)
 41            {
 042                writer.WritePropertyName("privateIPAllocationMethod");
 043                writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString());
 44            }
 045            if (Subnet != null)
 46            {
 047                writer.WritePropertyName("subnet");
 048                writer.WriteObjectValue(Subnet);
 49            }
 050            if (PublicIPAddress != null)
 51            {
 052                writer.WritePropertyName("publicIPAddress");
 053                writer.WriteObjectValue(PublicIPAddress);
 54            }
 055            if (ProvisioningState != null)
 56            {
 057                writer.WritePropertyName("provisioningState");
 058                writer.WriteStringValue(ProvisioningState.Value.ToString());
 59            }
 060            writer.WriteEndObject();
 061            writer.WriteEndObject();
 062        }
 63
 64        internal static IPConfiguration DeserializeIPConfiguration(JsonElement element)
 65        {
 10066            string name = default;
 10067            string etag = default;
 10068            string id = default;
 10069            string privateIPAddress = default;
 10070            IPAllocationMethod? privateIPAllocationMethod = default;
 10071            Subnet subnet = default;
 10072            PublicIPAddress publicIPAddress = default;
 10073            ProvisioningState? provisioningState = default;
 52874            foreach (var property in element.EnumerateObject())
 75            {
 16476                if (property.NameEquals("name"))
 77                {
 1678                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 1682                    name = property.Value.GetString();
 1683                    continue;
 84                }
 14885                if (property.NameEquals("etag"))
 86                {
 1687                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 1691                    etag = property.Value.GetString();
 1692                    continue;
 93                }
 13294                if (property.NameEquals("id"))
 95                {
 10096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 100100                    id = property.Value.GetString();
 100101                    continue;
 102                }
 32103                if (property.NameEquals("properties"))
 104                {
 256105                    foreach (var property0 in property.Value.EnumerateObject())
 106                    {
 112107                        if (property0.NameEquals("privateIPAddress"))
 108                        {
 12109                            if (property0.Value.ValueKind == JsonValueKind.Null)
 110                            {
 111                                continue;
 112                            }
 12113                            privateIPAddress = property0.Value.GetString();
 12114                            continue;
 115                        }
 100116                        if (property0.NameEquals("privateIPAllocationMethod"))
 117                        {
 16118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 16122                            privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString());
 16123                            continue;
 124                        }
 84125                        if (property0.NameEquals("subnet"))
 126                        {
 12127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 12131                            subnet = Subnet.DeserializeSubnet(property0.Value);
 12132                            continue;
 133                        }
 72134                        if (property0.NameEquals("publicIPAddress"))
 135                        {
 4136                            if (property0.Value.ValueKind == JsonValueKind.Null)
 137                            {
 138                                continue;
 139                            }
 4140                            publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value);
 4141                            continue;
 142                        }
 68143                        if (property0.NameEquals("provisioningState"))
 144                        {
 16145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 16149                            provisioningState = new ProvisioningState(property0.Value.GetString());
 150                            continue;
 151                        }
 152                    }
 153                    continue;
 154                }
 155            }
 100156            return new IPConfiguration(id, name, etag, privateIPAddress, privateIPAllocationMethod, subnet, publicIPAddr
 157        }
 158    }
 159}