< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_VirtualHub()-0%100%
get_P2SConnectionConfigurations()-0%100%
get_ProvisioningState()-0%100%
get_VpnGatewayScaleUnit()-0%100%
get_VpnServerConfiguration()-0%100%
get_VpnClientConnectionHealth()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeP2SVpnGateway(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\P2SVpnGateway.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> P2SVpnGateway Resource. </summary>
 13    public partial class P2SVpnGateway : Resource
 14    {
 15        /// <summary> Initializes a new instance of P2SVpnGateway. </summary>
 016        public P2SVpnGateway()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of P2SVpnGateway. </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="p2SConnectionConfigurations"> List of all p2s connection configurations of the gateway. </param
 29        /// <param name="provisioningState"> The provisioning state of the P2S VPN gateway resource. </param>
 30        /// <param name="vpnGatewayScaleUnit"> The scale unit for this p2s vpn gateway. </param>
 31        /// <param name="vpnServerConfiguration"> The VpnServerConfiguration to which the p2sVpnGateway is attached to. 
 32        /// <param name="vpnClientConnectionHealth"> All P2S VPN clients&apos; connection health status. </param>
 033        internal P2SVpnGateway(string id, string name, string type, string location, IDictionary<string, string> tags, s
 34        {
 035            Etag = etag;
 036            VirtualHub = virtualHub;
 037            P2SConnectionConfigurations = p2SConnectionConfigurations;
 038            ProvisioningState = provisioningState;
 039            VpnGatewayScaleUnit = vpnGatewayScaleUnit;
 040            VpnServerConfiguration = vpnServerConfiguration;
 041            VpnClientConnectionHealth = vpnClientConnectionHealth;
 042        }
 43
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> The VirtualHub to which the gateway belongs. </summary>
 047        public SubResource VirtualHub { get; set; }
 48        /// <summary> List of all p2s connection configurations of the gateway. </summary>
 049        public IList<P2SConnectionConfiguration> P2SConnectionConfigurations { get; set; }
 50        /// <summary> The provisioning state of the P2S VPN gateway resource. </summary>
 051        public ProvisioningState? ProvisioningState { get; }
 52        /// <summary> The scale unit for this p2s vpn gateway. </summary>
 053        public int? VpnGatewayScaleUnit { get; set; }
 54        /// <summary> The VpnServerConfiguration to which the p2sVpnGateway is attached to. </summary>
 055        public SubResource VpnServerConfiguration { get; set; }
 56        /// <summary> All P2S VPN clients&apos; connection health status. </summary>
 057        public VpnClientConnectionHealth VpnClientConnectionHealth { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\P2SVpnGateway.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 P2SVpnGateway : 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 (P2SConnectionConfigurations != null)
 63            {
 064                writer.WritePropertyName("p2SConnectionConfigurations");
 065                writer.WriteStartArray();
 066                foreach (var item in P2SConnectionConfigurations)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (ProvisioningState != null)
 73            {
 074                writer.WritePropertyName("provisioningState");
 075                writer.WriteStringValue(ProvisioningState.Value.ToString());
 76            }
 077            if (VpnGatewayScaleUnit != null)
 78            {
 079                writer.WritePropertyName("vpnGatewayScaleUnit");
 080                writer.WriteNumberValue(VpnGatewayScaleUnit.Value);
 81            }
 082            if (VpnServerConfiguration != null)
 83            {
 084                writer.WritePropertyName("vpnServerConfiguration");
 085                writer.WriteObjectValue(VpnServerConfiguration);
 86            }
 087            if (VpnClientConnectionHealth != null)
 88            {
 089                writer.WritePropertyName("vpnClientConnectionHealth");
 090                writer.WriteObjectValue(VpnClientConnectionHealth);
 91            }
 092            writer.WriteEndObject();
 093            writer.WriteEndObject();
 094        }
 95
 96        internal static P2SVpnGateway DeserializeP2SVpnGateway(JsonElement element)
 97        {
 098            string etag = default;
 099            string id = default;
 0100            string name = default;
 0101            string type = default;
 0102            string location = default;
 0103            IDictionary<string, string> tags = default;
 0104            SubResource virtualHub = default;
 0105            IList<P2SConnectionConfiguration> p2SConnectionConfigurations = default;
 0106            ProvisioningState? provisioningState = default;
 0107            int? vpnGatewayScaleUnit = default;
 0108            SubResource vpnServerConfiguration = default;
 0109            VpnClientConnectionHealth vpnClientConnectionHealth = default;
 0110            foreach (var property in element.EnumerateObject())
 111            {
 0112                if (property.NameEquals("etag"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    etag = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("id"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    id = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("name"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    name = property.Value.GetString();
 0137                    continue;
 138                }
 0139                if (property.NameEquals("type"))
 140                {
 0141                    if (property.Value.ValueKind == JsonValueKind.Null)
 142                    {
 143                        continue;
 144                    }
 0145                    type = property.Value.GetString();
 0146                    continue;
 147                }
 0148                if (property.NameEquals("location"))
 149                {
 0150                    if (property.Value.ValueKind == JsonValueKind.Null)
 151                    {
 152                        continue;
 153                    }
 0154                    location = property.Value.GetString();
 0155                    continue;
 156                }
 0157                if (property.NameEquals("tags"))
 158                {
 0159                    if (property.Value.ValueKind == JsonValueKind.Null)
 160                    {
 161                        continue;
 162                    }
 0163                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0164                    foreach (var property0 in property.Value.EnumerateObject())
 165                    {
 0166                        if (property0.Value.ValueKind == JsonValueKind.Null)
 167                        {
 0168                            dictionary.Add(property0.Name, null);
 169                        }
 170                        else
 171                        {
 0172                            dictionary.Add(property0.Name, property0.Value.GetString());
 173                        }
 174                    }
 0175                    tags = dictionary;
 0176                    continue;
 177                }
 0178                if (property.NameEquals("properties"))
 179                {
 0180                    foreach (var property0 in property.Value.EnumerateObject())
 181                    {
 0182                        if (property0.NameEquals("virtualHub"))
 183                        {
 0184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 0188                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
 0189                            continue;
 190                        }
 0191                        if (property0.NameEquals("p2SConnectionConfigurations"))
 192                        {
 0193                            if (property0.Value.ValueKind == JsonValueKind.Null)
 194                            {
 195                                continue;
 196                            }
 0197                            List<P2SConnectionConfiguration> array = new List<P2SConnectionConfiguration>();
 0198                            foreach (var item in property0.Value.EnumerateArray())
 199                            {
 0200                                if (item.ValueKind == JsonValueKind.Null)
 201                                {
 0202                                    array.Add(null);
 203                                }
 204                                else
 205                                {
 0206                                    array.Add(P2SConnectionConfiguration.DeserializeP2SConnectionConfiguration(item));
 207                                }
 208                            }
 0209                            p2SConnectionConfigurations = array;
 0210                            continue;
 211                        }
 0212                        if (property0.NameEquals("provisioningState"))
 213                        {
 0214                            if (property0.Value.ValueKind == JsonValueKind.Null)
 215                            {
 216                                continue;
 217                            }
 0218                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0219                            continue;
 220                        }
 0221                        if (property0.NameEquals("vpnGatewayScaleUnit"))
 222                        {
 0223                            if (property0.Value.ValueKind == JsonValueKind.Null)
 224                            {
 225                                continue;
 226                            }
 0227                            vpnGatewayScaleUnit = property0.Value.GetInt32();
 0228                            continue;
 229                        }
 0230                        if (property0.NameEquals("vpnServerConfiguration"))
 231                        {
 0232                            if (property0.Value.ValueKind == JsonValueKind.Null)
 233                            {
 234                                continue;
 235                            }
 0236                            vpnServerConfiguration = SubResource.DeserializeSubResource(property0.Value);
 0237                            continue;
 238                        }
 0239                        if (property0.NameEquals("vpnClientConnectionHealth"))
 240                        {
 0241                            if (property0.Value.ValueKind == JsonValueKind.Null)
 242                            {
 243                                continue;
 244                            }
 0245                            vpnClientConnectionHealth = VpnClientConnectionHealth.DeserializeVpnClientConnectionHealth(p
 246                            continue;
 247                        }
 248                    }
 249                    continue;
 250                }
 251            }
 0252            return new P2SVpnGateway(id, name, type, location, tags, etag, virtualHub, p2SConnectionConfigurations, prov
 253        }
 254    }
 255}