< Summary

Class:Azure.ResourceManager.Network.Models.VirtualNetworkGatewayIPConfiguration
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayIPConfiguration.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayIPConfiguration.Serialization.cs
Covered lines:86
Uncovered lines:5
Coverable lines:91
Total lines:212
Line coverage:94.5% (86 of 91)
Covered branches:51
Total branches:54
Branch coverage:94.4% (51 of 54)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Name()-100%100%
get_Etag()-100%100%
get_PrivateIPAllocationMethod()-100%100%
get_Subnet()-100%100%
get_PublicIPAddress()-100%100%
get_PrivateIPAddress()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-93.33%93.75%
DeserializeVirtualNetworkGatewayIPConfiguration(...)-93.02%94.74%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayIPConfiguration.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 for virtual network gateway. </summary>
 11    public partial class VirtualNetworkGatewayIPConfiguration : SubResource
 12    {
 13        /// <summary> Initializes a new instance of VirtualNetworkGatewayIPConfiguration. </summary>
 1214        public VirtualNetworkGatewayIPConfiguration()
 15        {
 1216        }
 17
 18        /// <summary> Initializes a new instance of VirtualNetworkGatewayIPConfiguration. </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="privateIPAllocationMethod"> The private IP address allocation method. </param>
 23        /// <param name="subnet"> The reference to the subnet resource. </param>
 24        /// <param name="publicIPAddress"> The reference to the public IP resource. </param>
 25        /// <param name="privateIPAddress"> Private IP Address for this gateway. </param>
 26        /// <param name="provisioningState"> The provisioning state of the virtual network gateway IP configuration reso
 3227        internal VirtualNetworkGatewayIPConfiguration(string id, string name, string etag, IPAllocationMethod? privateIP
 28        {
 3229            Name = name;
 3230            Etag = etag;
 3231            PrivateIPAllocationMethod = privateIPAllocationMethod;
 3232            Subnet = subnet;
 3233            PublicIPAddress = publicIPAddress;
 3234            PrivateIPAddress = privateIPAddress;
 3235            ProvisioningState = provisioningState;
 3236        }
 37
 38        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 20439        public string Name { get; set; }
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 13641        public string Etag { get; }
 42        /// <summary> The private IP address allocation method. </summary>
 20443        public IPAllocationMethod? PrivateIPAllocationMethod { get; set; }
 44        /// <summary> The reference to the subnet resource. </summary>
 20445        public SubResource Subnet { get; set; }
 46        /// <summary> The reference to the public IP resource. </summary>
 20447        public SubResource PublicIPAddress { get; set; }
 48        /// <summary> Private IP Address for this gateway. </summary>
 8049        public string PrivateIPAddress { get; }
 50        /// <summary> The provisioning state of the virtual network gateway IP configuration resource. </summary>
 13651        public ProvisioningState? ProvisioningState { get; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayIPConfiguration.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 VirtualNetworkGatewayIPConfiguration : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 8017            writer.WriteStartObject();
 8018            if (Name != null)
 19            {
 8020                writer.WritePropertyName("name");
 8021                writer.WriteStringValue(Name);
 22            }
 8023            if (Etag != null)
 24            {
 5625                writer.WritePropertyName("etag");
 5626                writer.WriteStringValue(Etag);
 27            }
 8028            if (Id != null)
 29            {
 5630                writer.WritePropertyName("id");
 5631                writer.WriteStringValue(Id);
 32            }
 8033            writer.WritePropertyName("properties");
 8034            writer.WriteStartObject();
 8035            if (PrivateIPAllocationMethod != null)
 36            {
 8037                writer.WritePropertyName("privateIPAllocationMethod");
 8038                writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString());
 39            }
 8040            if (Subnet != null)
 41            {
 8042                writer.WritePropertyName("subnet");
 8043                writer.WriteObjectValue(Subnet);
 44            }
 8045            if (PublicIPAddress != null)
 46            {
 8047                writer.WritePropertyName("publicIPAddress");
 8048                writer.WriteObjectValue(PublicIPAddress);
 49            }
 8050            if (PrivateIPAddress != null)
 51            {
 052                writer.WritePropertyName("privateIPAddress");
 053                writer.WriteStringValue(PrivateIPAddress);
 54            }
 8055            if (ProvisioningState != null)
 56            {
 5657                writer.WritePropertyName("provisioningState");
 5658                writer.WriteStringValue(ProvisioningState.Value.ToString());
 59            }
 8060            writer.WriteEndObject();
 8061            writer.WriteEndObject();
 8062        }
 63
 64        internal static VirtualNetworkGatewayIPConfiguration DeserializeVirtualNetworkGatewayIPConfiguration(JsonElement
 65        {
 3266            string name = default;
 3267            string etag = default;
 3268            string id = default;
 3269            IPAllocationMethod? privateIPAllocationMethod = default;
 3270            SubResource subnet = default;
 3271            SubResource publicIPAddress = default;
 3272            string privateIPAddress = default;
 3273            ProvisioningState? provisioningState = default;
 38474            foreach (var property in element.EnumerateObject())
 75            {
 16076                if (property.NameEquals("name"))
 77                {
 3278                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 3282                    name = property.Value.GetString();
 3283                    continue;
 84                }
 12885                if (property.NameEquals("etag"))
 86                {
 3287                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 3291                    etag = property.Value.GetString();
 3292                    continue;
 93                }
 9694                if (property.NameEquals("id"))
 95                {
 3296                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 32100                    id = property.Value.GetString();
 32101                    continue;
 102                }
 64103                if (property.NameEquals("properties"))
 104                {
 320105                    foreach (var property0 in property.Value.EnumerateObject())
 106                    {
 128107                        if (property0.NameEquals("privateIPAllocationMethod"))
 108                        {
 32109                            if (property0.Value.ValueKind == JsonValueKind.Null)
 110                            {
 111                                continue;
 112                            }
 32113                            privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString());
 32114                            continue;
 115                        }
 96116                        if (property0.NameEquals("subnet"))
 117                        {
 32118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 32122                            subnet = DeserializeSubResource(property0.Value);
 32123                            continue;
 124                        }
 64125                        if (property0.NameEquals("publicIPAddress"))
 126                        {
 32127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 32131                            publicIPAddress = DeserializeSubResource(property0.Value);
 32132                            continue;
 133                        }
 32134                        if (property0.NameEquals("privateIPAddress"))
 135                        {
 0136                            if (property0.Value.ValueKind == JsonValueKind.Null)
 137                            {
 138                                continue;
 139                            }
 0140                            privateIPAddress = property0.Value.GetString();
 0141                            continue;
 142                        }
 32143                        if (property0.NameEquals("provisioningState"))
 144                        {
 32145                            if (property0.Value.ValueKind == JsonValueKind.Null)
 146                            {
 147                                continue;
 148                            }
 32149                            provisioningState = new ProvisioningState(property0.Value.GetString());
 150                            continue;
 151                        }
 152                    }
 153                    continue;
 154                }
 155            }
 32156            return new VirtualNetworkGatewayIPConfiguration(id, name, etag, privateIPAllocationMethod, subnet, publicIPA
 157        }
 158    }
 159}