< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_RemoteVpnSite()-0%100%
get_RoutingWeight()-0%100%
get_DpdTimeoutSeconds()-0%100%
get_ConnectionStatus()-0%100%
get_VpnConnectionProtocolType()-0%100%
get_IngressBytesTransferred()-0%100%
get_EgressBytesTransferred()-0%100%
get_ConnectionBandwidth()-0%100%
get_SharedKey()-0%100%
get_EnableBgp()-0%100%
get_UsePolicyBasedTrafficSelectors()-0%100%
get_IpsecPolicies()-0%100%
get_EnableRateLimiting()-0%100%
get_EnableInternetSecurity()-0%100%
get_UseLocalAzureIpAddress()-0%100%
get_ProvisioningState()-0%100%
get_VpnLinkConnections()-0%100%
get_RoutingConfiguration()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVpnConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnConnection.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> VpnConnection Resource. </summary>
 13    public partial class VpnConnection : SubResource
 14    {
 15        /// <summary> Initializes a new instance of VpnConnection. </summary>
 016        public VpnConnection()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VpnConnection. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="remoteVpnSite"> Id of the connected vpn site. </param>
 25        /// <param name="routingWeight"> Routing weight for vpn connection. </param>
 26        /// <param name="dpdTimeoutSeconds"> The dead peer detection timeout for a vpn connection in seconds. </param>
 27        /// <param name="connectionStatus"> The connection status. </param>
 28        /// <param name="vpnConnectionProtocolType"> Connection protocol used for this connection. </param>
 29        /// <param name="ingressBytesTransferred"> Ingress bytes transferred. </param>
 30        /// <param name="egressBytesTransferred"> Egress bytes transferred. </param>
 31        /// <param name="connectionBandwidth"> Expected bandwidth in MBPS. </param>
 32        /// <param name="sharedKey"> SharedKey for the vpn connection. </param>
 33        /// <param name="enableBgp"> EnableBgp flag. </param>
 34        /// <param name="usePolicyBasedTrafficSelectors"> Enable policy-based traffic selectors. </param>
 35        /// <param name="ipsecPolicies"> The IPSec Policies to be considered by this connection. </param>
 36        /// <param name="enableRateLimiting"> EnableBgp flag. </param>
 37        /// <param name="enableInternetSecurity"> Enable internet security. </param>
 38        /// <param name="useLocalAzureIpAddress"> Use local azure ip to initiate connection. </param>
 39        /// <param name="provisioningState"> The provisioning state of the VPN connection resource. </param>
 40        /// <param name="vpnLinkConnections"> List of all vpn site link connections to the gateway. </param>
 41        /// <param name="routingConfiguration"> The Routing Configuration indicating the associated and propagated route
 042        internal VpnConnection(string id, string name, string etag, SubResource remoteVpnSite, int? routingWeight, int? 
 43        {
 044            Name = name;
 045            Etag = etag;
 046            RemoteVpnSite = remoteVpnSite;
 047            RoutingWeight = routingWeight;
 048            DpdTimeoutSeconds = dpdTimeoutSeconds;
 049            ConnectionStatus = connectionStatus;
 050            VpnConnectionProtocolType = vpnConnectionProtocolType;
 051            IngressBytesTransferred = ingressBytesTransferred;
 052            EgressBytesTransferred = egressBytesTransferred;
 053            ConnectionBandwidth = connectionBandwidth;
 054            SharedKey = sharedKey;
 055            EnableBgp = enableBgp;
 056            UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors;
 057            IpsecPolicies = ipsecPolicies;
 058            EnableRateLimiting = enableRateLimiting;
 059            EnableInternetSecurity = enableInternetSecurity;
 060            UseLocalAzureIpAddress = useLocalAzureIpAddress;
 061            ProvisioningState = provisioningState;
 062            VpnLinkConnections = vpnLinkConnections;
 063            RoutingConfiguration = routingConfiguration;
 064        }
 65
 66        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 067        public string Name { get; set; }
 68        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 069        public string Etag { get; }
 70        /// <summary> Id of the connected vpn site. </summary>
 071        public SubResource RemoteVpnSite { get; set; }
 72        /// <summary> Routing weight for vpn connection. </summary>
 073        public int? RoutingWeight { get; set; }
 74        /// <summary> The dead peer detection timeout for a vpn connection in seconds. </summary>
 075        public int? DpdTimeoutSeconds { get; set; }
 76        /// <summary> The connection status. </summary>
 077        public VpnConnectionStatus? ConnectionStatus { get; }
 78        /// <summary> Connection protocol used for this connection. </summary>
 079        public VirtualNetworkGatewayConnectionProtocol? VpnConnectionProtocolType { get; set; }
 80        /// <summary> Ingress bytes transferred. </summary>
 081        public long? IngressBytesTransferred { get; }
 82        /// <summary> Egress bytes transferred. </summary>
 083        public long? EgressBytesTransferred { get; }
 84        /// <summary> Expected bandwidth in MBPS. </summary>
 085        public int? ConnectionBandwidth { get; set; }
 86        /// <summary> SharedKey for the vpn connection. </summary>
 087        public string SharedKey { get; set; }
 88        /// <summary> EnableBgp flag. </summary>
 089        public bool? EnableBgp { get; set; }
 90        /// <summary> Enable policy-based traffic selectors. </summary>
 091        public bool? UsePolicyBasedTrafficSelectors { get; set; }
 92        /// <summary> The IPSec Policies to be considered by this connection. </summary>
 093        public IList<IpsecPolicy> IpsecPolicies { get; set; }
 94        /// <summary> EnableBgp flag. </summary>
 095        public bool? EnableRateLimiting { get; set; }
 96        /// <summary> Enable internet security. </summary>
 097        public bool? EnableInternetSecurity { get; set; }
 98        /// <summary> Use local azure ip to initiate connection. </summary>
 099        public bool? UseLocalAzureIpAddress { get; set; }
 100        /// <summary> The provisioning state of the VPN connection resource. </summary>
 0101        public ProvisioningState? ProvisioningState { get; }
 102        /// <summary> List of all vpn site link connections to the gateway. </summary>
 0103        public IList<VpnSiteLinkConnection> VpnLinkConnections { get; set; }
 104        /// <summary> The Routing Configuration indicating the associated and propagated route tables on this connection
 0105        public RoutingConfiguration RoutingConfiguration { get; set; }
 106    }
 107}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnConnection.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 VpnConnection : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (RemoteVpnSite != null)
 37            {
 038                writer.WritePropertyName("remoteVpnSite");
 039                writer.WriteObjectValue(RemoteVpnSite);
 40            }
 041            if (RoutingWeight != null)
 42            {
 043                writer.WritePropertyName("routingWeight");
 044                writer.WriteNumberValue(RoutingWeight.Value);
 45            }
 046            if (DpdTimeoutSeconds != null)
 47            {
 048                writer.WritePropertyName("dpdTimeoutSeconds");
 049                writer.WriteNumberValue(DpdTimeoutSeconds.Value);
 50            }
 051            if (ConnectionStatus != null)
 52            {
 053                writer.WritePropertyName("connectionStatus");
 054                writer.WriteStringValue(ConnectionStatus.Value.ToString());
 55            }
 056            if (VpnConnectionProtocolType != null)
 57            {
 058                writer.WritePropertyName("vpnConnectionProtocolType");
 059                writer.WriteStringValue(VpnConnectionProtocolType.Value.ToString());
 60            }
 061            if (IngressBytesTransferred != null)
 62            {
 063                writer.WritePropertyName("ingressBytesTransferred");
 064                writer.WriteNumberValue(IngressBytesTransferred.Value);
 65            }
 066            if (EgressBytesTransferred != null)
 67            {
 068                writer.WritePropertyName("egressBytesTransferred");
 069                writer.WriteNumberValue(EgressBytesTransferred.Value);
 70            }
 071            if (ConnectionBandwidth != null)
 72            {
 073                writer.WritePropertyName("connectionBandwidth");
 074                writer.WriteNumberValue(ConnectionBandwidth.Value);
 75            }
 076            if (SharedKey != null)
 77            {
 078                writer.WritePropertyName("sharedKey");
 079                writer.WriteStringValue(SharedKey);
 80            }
 081            if (EnableBgp != null)
 82            {
 083                writer.WritePropertyName("enableBgp");
 084                writer.WriteBooleanValue(EnableBgp.Value);
 85            }
 086            if (UsePolicyBasedTrafficSelectors != null)
 87            {
 088                writer.WritePropertyName("usePolicyBasedTrafficSelectors");
 089                writer.WriteBooleanValue(UsePolicyBasedTrafficSelectors.Value);
 90            }
 091            if (IpsecPolicies != null)
 92            {
 093                writer.WritePropertyName("ipsecPolicies");
 094                writer.WriteStartArray();
 095                foreach (var item in IpsecPolicies)
 96                {
 097                    writer.WriteObjectValue(item);
 98                }
 099                writer.WriteEndArray();
 100            }
 0101            if (EnableRateLimiting != null)
 102            {
 0103                writer.WritePropertyName("enableRateLimiting");
 0104                writer.WriteBooleanValue(EnableRateLimiting.Value);
 105            }
 0106            if (EnableInternetSecurity != null)
 107            {
 0108                writer.WritePropertyName("enableInternetSecurity");
 0109                writer.WriteBooleanValue(EnableInternetSecurity.Value);
 110            }
 0111            if (UseLocalAzureIpAddress != null)
 112            {
 0113                writer.WritePropertyName("useLocalAzureIpAddress");
 0114                writer.WriteBooleanValue(UseLocalAzureIpAddress.Value);
 115            }
 0116            if (ProvisioningState != null)
 117            {
 0118                writer.WritePropertyName("provisioningState");
 0119                writer.WriteStringValue(ProvisioningState.Value.ToString());
 120            }
 0121            if (VpnLinkConnections != null)
 122            {
 0123                writer.WritePropertyName("vpnLinkConnections");
 0124                writer.WriteStartArray();
 0125                foreach (var item in VpnLinkConnections)
 126                {
 0127                    writer.WriteObjectValue(item);
 128                }
 0129                writer.WriteEndArray();
 130            }
 0131            if (RoutingConfiguration != null)
 132            {
 0133                writer.WritePropertyName("routingConfiguration");
 0134                writer.WriteObjectValue(RoutingConfiguration);
 135            }
 0136            writer.WriteEndObject();
 0137            writer.WriteEndObject();
 0138        }
 139
 140        internal static VpnConnection DeserializeVpnConnection(JsonElement element)
 141        {
 0142            string name = default;
 0143            string etag = default;
 0144            string id = default;
 0145            SubResource remoteVpnSite = default;
 0146            int? routingWeight = default;
 0147            int? dpdTimeoutSeconds = default;
 0148            VpnConnectionStatus? connectionStatus = default;
 0149            VirtualNetworkGatewayConnectionProtocol? vpnConnectionProtocolType = default;
 0150            long? ingressBytesTransferred = default;
 0151            long? egressBytesTransferred = default;
 0152            int? connectionBandwidth = default;
 0153            string sharedKey = default;
 0154            bool? enableBgp = default;
 0155            bool? usePolicyBasedTrafficSelectors = default;
 0156            IList<IpsecPolicy> ipsecPolicies = default;
 0157            bool? enableRateLimiting = default;
 0158            bool? enableInternetSecurity = default;
 0159            bool? useLocalAzureIpAddress = default;
 0160            ProvisioningState? provisioningState = default;
 0161            IList<VpnSiteLinkConnection> vpnLinkConnections = default;
 0162            RoutingConfiguration routingConfiguration = default;
 0163            foreach (var property in element.EnumerateObject())
 164            {
 0165                if (property.NameEquals("name"))
 166                {
 0167                    if (property.Value.ValueKind == JsonValueKind.Null)
 168                    {
 169                        continue;
 170                    }
 0171                    name = property.Value.GetString();
 0172                    continue;
 173                }
 0174                if (property.NameEquals("etag"))
 175                {
 0176                    if (property.Value.ValueKind == JsonValueKind.Null)
 177                    {
 178                        continue;
 179                    }
 0180                    etag = property.Value.GetString();
 0181                    continue;
 182                }
 0183                if (property.NameEquals("id"))
 184                {
 0185                    if (property.Value.ValueKind == JsonValueKind.Null)
 186                    {
 187                        continue;
 188                    }
 0189                    id = property.Value.GetString();
 0190                    continue;
 191                }
 0192                if (property.NameEquals("properties"))
 193                {
 0194                    foreach (var property0 in property.Value.EnumerateObject())
 195                    {
 0196                        if (property0.NameEquals("remoteVpnSite"))
 197                        {
 0198                            if (property0.Value.ValueKind == JsonValueKind.Null)
 199                            {
 200                                continue;
 201                            }
 0202                            remoteVpnSite = DeserializeSubResource(property0.Value);
 0203                            continue;
 204                        }
 0205                        if (property0.NameEquals("routingWeight"))
 206                        {
 0207                            if (property0.Value.ValueKind == JsonValueKind.Null)
 208                            {
 209                                continue;
 210                            }
 0211                            routingWeight = property0.Value.GetInt32();
 0212                            continue;
 213                        }
 0214                        if (property0.NameEquals("dpdTimeoutSeconds"))
 215                        {
 0216                            if (property0.Value.ValueKind == JsonValueKind.Null)
 217                            {
 218                                continue;
 219                            }
 0220                            dpdTimeoutSeconds = property0.Value.GetInt32();
 0221                            continue;
 222                        }
 0223                        if (property0.NameEquals("connectionStatus"))
 224                        {
 0225                            if (property0.Value.ValueKind == JsonValueKind.Null)
 226                            {
 227                                continue;
 228                            }
 0229                            connectionStatus = new VpnConnectionStatus(property0.Value.GetString());
 0230                            continue;
 231                        }
 0232                        if (property0.NameEquals("vpnConnectionProtocolType"))
 233                        {
 0234                            if (property0.Value.ValueKind == JsonValueKind.Null)
 235                            {
 236                                continue;
 237                            }
 0238                            vpnConnectionProtocolType = new VirtualNetworkGatewayConnectionProtocol(property0.Value.GetS
 0239                            continue;
 240                        }
 0241                        if (property0.NameEquals("ingressBytesTransferred"))
 242                        {
 0243                            if (property0.Value.ValueKind == JsonValueKind.Null)
 244                            {
 245                                continue;
 246                            }
 0247                            ingressBytesTransferred = property0.Value.GetInt64();
 0248                            continue;
 249                        }
 0250                        if (property0.NameEquals("egressBytesTransferred"))
 251                        {
 0252                            if (property0.Value.ValueKind == JsonValueKind.Null)
 253                            {
 254                                continue;
 255                            }
 0256                            egressBytesTransferred = property0.Value.GetInt64();
 0257                            continue;
 258                        }
 0259                        if (property0.NameEquals("connectionBandwidth"))
 260                        {
 0261                            if (property0.Value.ValueKind == JsonValueKind.Null)
 262                            {
 263                                continue;
 264                            }
 0265                            connectionBandwidth = property0.Value.GetInt32();
 0266                            continue;
 267                        }
 0268                        if (property0.NameEquals("sharedKey"))
 269                        {
 0270                            if (property0.Value.ValueKind == JsonValueKind.Null)
 271                            {
 272                                continue;
 273                            }
 0274                            sharedKey = property0.Value.GetString();
 0275                            continue;
 276                        }
 0277                        if (property0.NameEquals("enableBgp"))
 278                        {
 0279                            if (property0.Value.ValueKind == JsonValueKind.Null)
 280                            {
 281                                continue;
 282                            }
 0283                            enableBgp = property0.Value.GetBoolean();
 0284                            continue;
 285                        }
 0286                        if (property0.NameEquals("usePolicyBasedTrafficSelectors"))
 287                        {
 0288                            if (property0.Value.ValueKind == JsonValueKind.Null)
 289                            {
 290                                continue;
 291                            }
 0292                            usePolicyBasedTrafficSelectors = property0.Value.GetBoolean();
 0293                            continue;
 294                        }
 0295                        if (property0.NameEquals("ipsecPolicies"))
 296                        {
 0297                            if (property0.Value.ValueKind == JsonValueKind.Null)
 298                            {
 299                                continue;
 300                            }
 0301                            List<IpsecPolicy> array = new List<IpsecPolicy>();
 0302                            foreach (var item in property0.Value.EnumerateArray())
 303                            {
 0304                                if (item.ValueKind == JsonValueKind.Null)
 305                                {
 0306                                    array.Add(null);
 307                                }
 308                                else
 309                                {
 0310                                    array.Add(IpsecPolicy.DeserializeIpsecPolicy(item));
 311                                }
 312                            }
 0313                            ipsecPolicies = array;
 0314                            continue;
 315                        }
 0316                        if (property0.NameEquals("enableRateLimiting"))
 317                        {
 0318                            if (property0.Value.ValueKind == JsonValueKind.Null)
 319                            {
 320                                continue;
 321                            }
 0322                            enableRateLimiting = property0.Value.GetBoolean();
 0323                            continue;
 324                        }
 0325                        if (property0.NameEquals("enableInternetSecurity"))
 326                        {
 0327                            if (property0.Value.ValueKind == JsonValueKind.Null)
 328                            {
 329                                continue;
 330                            }
 0331                            enableInternetSecurity = property0.Value.GetBoolean();
 0332                            continue;
 333                        }
 0334                        if (property0.NameEquals("useLocalAzureIpAddress"))
 335                        {
 0336                            if (property0.Value.ValueKind == JsonValueKind.Null)
 337                            {
 338                                continue;
 339                            }
 0340                            useLocalAzureIpAddress = property0.Value.GetBoolean();
 0341                            continue;
 342                        }
 0343                        if (property0.NameEquals("provisioningState"))
 344                        {
 0345                            if (property0.Value.ValueKind == JsonValueKind.Null)
 346                            {
 347                                continue;
 348                            }
 0349                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0350                            continue;
 351                        }
 0352                        if (property0.NameEquals("vpnLinkConnections"))
 353                        {
 0354                            if (property0.Value.ValueKind == JsonValueKind.Null)
 355                            {
 356                                continue;
 357                            }
 0358                            List<VpnSiteLinkConnection> array = new List<VpnSiteLinkConnection>();
 0359                            foreach (var item in property0.Value.EnumerateArray())
 360                            {
 0361                                if (item.ValueKind == JsonValueKind.Null)
 362                                {
 0363                                    array.Add(null);
 364                                }
 365                                else
 366                                {
 0367                                    array.Add(VpnSiteLinkConnection.DeserializeVpnSiteLinkConnection(item));
 368                                }
 369                            }
 0370                            vpnLinkConnections = array;
 0371                            continue;
 372                        }
 0373                        if (property0.NameEquals("routingConfiguration"))
 374                        {
 0375                            if (property0.Value.ValueKind == JsonValueKind.Null)
 376                            {
 377                                continue;
 378                            }
 0379                            routingConfiguration = RoutingConfiguration.DeserializeRoutingConfiguration(property0.Value)
 380                            continue;
 381                        }
 382                    }
 383                    continue;
 384                }
 385            }
 0386            return new VpnConnection(id, name, etag, remoteVpnSite, routingWeight, dpdTimeoutSeconds, connectionStatus, 
 387        }
 388    }
 389}