< Summary

Class:Azure.ResourceManager.Network.Models.VpnGateway
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnGateway.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnGateway.Serialization.cs
Covered lines:0
Uncovered lines:130
Coverable lines:130
Total lines:295
Line coverage:0% (0 of 130)
Covered branches:0
Total branches:84
Branch coverage:0% (0 of 84)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_VirtualHub()-0%100%
get_Connections()-0%100%
get_BgpSettings()-0%100%
get_ProvisioningState()-0%100%
get_VpnGatewayScaleUnit()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVpnGateway(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnGateway.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> VpnGateway Resource. </summary>
 13    public partial class VpnGateway : Resource
 14    {
 15        /// <summary> Initializes a new instance of VpnGateway. </summary>
 016        public VpnGateway()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VpnGateway. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="virtualHub"> The VirtualHub to which the gateway belongs. </param>
 28        /// <param name="connections"> List of all vpn connections to the gateway. </param>
 29        /// <param name="bgpSettings"> Local network gateway&apos;s BGP speaker settings. </param>
 30        /// <param name="provisioningState"> The provisioning state of the VPN gateway resource. </param>
 31        /// <param name="vpnGatewayScaleUnit"> The scale unit for this vpn gateway. </param>
 032        internal VpnGateway(string id, string name, string type, string location, IDictionary<string, string> tags, stri
 33        {
 034            Etag = etag;
 035            VirtualHub = virtualHub;
 036            Connections = connections;
 037            BgpSettings = bgpSettings;
 038            ProvisioningState = provisioningState;
 039            VpnGatewayScaleUnit = vpnGatewayScaleUnit;
 040        }
 41
 42        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 043        public string Etag { get; }
 44        /// <summary> The VirtualHub to which the gateway belongs. </summary>
 045        public SubResource VirtualHub { get; set; }
 46        /// <summary> List of all vpn connections to the gateway. </summary>
 047        public IList<VpnConnection> Connections { get; set; }
 48        /// <summary> Local network gateway&apos;s BGP speaker settings. </summary>
 049        public BgpSettings BgpSettings { get; set; }
 50        /// <summary> The provisioning state of the VPN gateway resource. </summary>
 051        public ProvisioningState? ProvisioningState { get; }
 52        /// <summary> The scale unit for this vpn gateway. </summary>
 053        public int? VpnGatewayScaleUnit { get; set; }
 54    }
 55}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnGateway.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 VpnGateway : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 029            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 034            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 039            if (Location != null)
 40            {
 041                writer.WritePropertyName("location");
 042                writer.WriteStringValue(Location);
 43            }
 044            if (Tags != null)
 45            {
 046                writer.WritePropertyName("tags");
 047                writer.WriteStartObject();
 048                foreach (var item in Tags)
 49                {
 050                    writer.WritePropertyName(item.Key);
 051                    writer.WriteStringValue(item.Value);
 52                }
 053                writer.WriteEndObject();
 54            }
 055            writer.WritePropertyName("properties");
 056            writer.WriteStartObject();
 057            if (VirtualHub != null)
 58            {
 059                writer.WritePropertyName("virtualHub");
 060                writer.WriteObjectValue(VirtualHub);
 61            }
 062            if (Connections != null)
 63            {
 064                writer.WritePropertyName("connections");
 065                writer.WriteStartArray();
 066                foreach (var item in Connections)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (BgpSettings != null)
 73            {
 074                writer.WritePropertyName("bgpSettings");
 075                writer.WriteObjectValue(BgpSettings);
 76            }
 077            if (ProvisioningState != null)
 78            {
 079                writer.WritePropertyName("provisioningState");
 080                writer.WriteStringValue(ProvisioningState.Value.ToString());
 81            }
 082            if (VpnGatewayScaleUnit != null)
 83            {
 084                writer.WritePropertyName("vpnGatewayScaleUnit");
 085                writer.WriteNumberValue(VpnGatewayScaleUnit.Value);
 86            }
 087            writer.WriteEndObject();
 088            writer.WriteEndObject();
 089        }
 90
 91        internal static VpnGateway DeserializeVpnGateway(JsonElement element)
 92        {
 093            string etag = default;
 094            string id = default;
 095            string name = default;
 096            string type = default;
 097            string location = default;
 098            IDictionary<string, string> tags = default;
 099            SubResource virtualHub = default;
 0100            IList<VpnConnection> connections = default;
 0101            BgpSettings bgpSettings = default;
 0102            ProvisioningState? provisioningState = default;
 0103            int? vpnGatewayScaleUnit = default;
 0104            foreach (var property in element.EnumerateObject())
 105            {
 0106                if (property.NameEquals("etag"))
 107                {
 0108                    if (property.Value.ValueKind == JsonValueKind.Null)
 109                    {
 110                        continue;
 111                    }
 0112                    etag = property.Value.GetString();
 0113                    continue;
 114                }
 0115                if (property.NameEquals("id"))
 116                {
 0117                    if (property.Value.ValueKind == JsonValueKind.Null)
 118                    {
 119                        continue;
 120                    }
 0121                    id = property.Value.GetString();
 0122                    continue;
 123                }
 0124                if (property.NameEquals("name"))
 125                {
 0126                    if (property.Value.ValueKind == JsonValueKind.Null)
 127                    {
 128                        continue;
 129                    }
 0130                    name = property.Value.GetString();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("type"))
 134                {
 0135                    if (property.Value.ValueKind == JsonValueKind.Null)
 136                    {
 137                        continue;
 138                    }
 0139                    type = property.Value.GetString();
 0140                    continue;
 141                }
 0142                if (property.NameEquals("location"))
 143                {
 0144                    if (property.Value.ValueKind == JsonValueKind.Null)
 145                    {
 146                        continue;
 147                    }
 0148                    location = property.Value.GetString();
 0149                    continue;
 150                }
 0151                if (property.NameEquals("tags"))
 152                {
 0153                    if (property.Value.ValueKind == JsonValueKind.Null)
 154                    {
 155                        continue;
 156                    }
 0157                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0158                    foreach (var property0 in property.Value.EnumerateObject())
 159                    {
 0160                        if (property0.Value.ValueKind == JsonValueKind.Null)
 161                        {
 0162                            dictionary.Add(property0.Name, null);
 163                        }
 164                        else
 165                        {
 0166                            dictionary.Add(property0.Name, property0.Value.GetString());
 167                        }
 168                    }
 0169                    tags = dictionary;
 0170                    continue;
 171                }
 0172                if (property.NameEquals("properties"))
 173                {
 0174                    foreach (var property0 in property.Value.EnumerateObject())
 175                    {
 0176                        if (property0.NameEquals("virtualHub"))
 177                        {
 0178                            if (property0.Value.ValueKind == JsonValueKind.Null)
 179                            {
 180                                continue;
 181                            }
 0182                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
 0183                            continue;
 184                        }
 0185                        if (property0.NameEquals("connections"))
 186                        {
 0187                            if (property0.Value.ValueKind == JsonValueKind.Null)
 188                            {
 189                                continue;
 190                            }
 0191                            List<VpnConnection> array = new List<VpnConnection>();
 0192                            foreach (var item in property0.Value.EnumerateArray())
 193                            {
 0194                                if (item.ValueKind == JsonValueKind.Null)
 195                                {
 0196                                    array.Add(null);
 197                                }
 198                                else
 199                                {
 0200                                    array.Add(VpnConnection.DeserializeVpnConnection(item));
 201                                }
 202                            }
 0203                            connections = array;
 0204                            continue;
 205                        }
 0206                        if (property0.NameEquals("bgpSettings"))
 207                        {
 0208                            if (property0.Value.ValueKind == JsonValueKind.Null)
 209                            {
 210                                continue;
 211                            }
 0212                            bgpSettings = BgpSettings.DeserializeBgpSettings(property0.Value);
 0213                            continue;
 214                        }
 0215                        if (property0.NameEquals("provisioningState"))
 216                        {
 0217                            if (property0.Value.ValueKind == JsonValueKind.Null)
 218                            {
 219                                continue;
 220                            }
 0221                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0222                            continue;
 223                        }
 0224                        if (property0.NameEquals("vpnGatewayScaleUnit"))
 225                        {
 0226                            if (property0.Value.ValueKind == JsonValueKind.Null)
 227                            {
 228                                continue;
 229                            }
 0230                            vpnGatewayScaleUnit = property0.Value.GetInt32();
 231                            continue;
 232                        }
 233                    }
 234                    continue;
 235                }
 236            }
 0237            return new VpnGateway(id, name, type, location, tags, etag, virtualHub, connections, bgpSettings, provisioni
 238        }
 239    }
 240}