< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_VpnSiteLink()-0%100%
get_RoutingWeight()-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_UseLocalAzureIpAddress()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeVpnSiteLinkConnection(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnSiteLinkConnection.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> VpnSiteLinkConnection Resource. </summary>
 13    public partial class VpnSiteLinkConnection : SubResource
 14    {
 15        /// <summary> Initializes a new instance of VpnSiteLinkConnection. </summary>
 016        public VpnSiteLinkConnection()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of VpnSiteLinkConnection. </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="type"> Resource type. </param>
 25        /// <param name="vpnSiteLink"> Id of the connected vpn site link. </param>
 26        /// <param name="routingWeight"> Routing weight for vpn connection. </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="useLocalAzureIpAddress"> Use local azure ip to initiate connection. </param>
 38        /// <param name="provisioningState"> The provisioning state of the VPN site link connection resource. </param>
 039        internal VpnSiteLinkConnection(string id, string name, string etag, string type, SubResource vpnSiteLink, int? r
 40        {
 041            Name = name;
 042            Etag = etag;
 043            Type = type;
 044            VpnSiteLink = vpnSiteLink;
 045            RoutingWeight = routingWeight;
 046            ConnectionStatus = connectionStatus;
 047            VpnConnectionProtocolType = vpnConnectionProtocolType;
 048            IngressBytesTransferred = ingressBytesTransferred;
 049            EgressBytesTransferred = egressBytesTransferred;
 050            ConnectionBandwidth = connectionBandwidth;
 051            SharedKey = sharedKey;
 052            EnableBgp = enableBgp;
 053            UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors;
 054            IpsecPolicies = ipsecPolicies;
 055            EnableRateLimiting = enableRateLimiting;
 056            UseLocalAzureIpAddress = useLocalAzureIpAddress;
 057            ProvisioningState = provisioningState;
 058        }
 59
 60        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 061        public string Name { get; set; }
 62        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 063        public string Etag { get; }
 64        /// <summary> Resource type. </summary>
 065        public string Type { get; }
 66        /// <summary> Id of the connected vpn site link. </summary>
 067        public SubResource VpnSiteLink { get; set; }
 68        /// <summary> Routing weight for vpn connection. </summary>
 069        public int? RoutingWeight { get; set; }
 70        /// <summary> The connection status. </summary>
 071        public VpnConnectionStatus? ConnectionStatus { get; }
 72        /// <summary> Connection protocol used for this connection. </summary>
 073        public VirtualNetworkGatewayConnectionProtocol? VpnConnectionProtocolType { get; set; }
 74        /// <summary> Ingress bytes transferred. </summary>
 075        public long? IngressBytesTransferred { get; }
 76        /// <summary> Egress bytes transferred. </summary>
 077        public long? EgressBytesTransferred { get; }
 78        /// <summary> Expected bandwidth in MBPS. </summary>
 079        public int? ConnectionBandwidth { get; set; }
 80        /// <summary> SharedKey for the vpn connection. </summary>
 081        public string SharedKey { get; set; }
 82        /// <summary> EnableBgp flag. </summary>
 083        public bool? EnableBgp { get; set; }
 84        /// <summary> Enable policy-based traffic selectors. </summary>
 085        public bool? UsePolicyBasedTrafficSelectors { get; set; }
 86        /// <summary> The IPSec Policies to be considered by this connection. </summary>
 087        public IList<IpsecPolicy> IpsecPolicies { get; set; }
 88        /// <summary> EnableBgp flag. </summary>
 089        public bool? EnableRateLimiting { get; set; }
 90        /// <summary> Use local azure ip to initiate connection. </summary>
 091        public bool? UseLocalAzureIpAddress { get; set; }
 92        /// <summary> The provisioning state of the VPN site link connection resource. </summary>
 093        public ProvisioningState? ProvisioningState { get; }
 94    }
 95}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VpnSiteLinkConnection.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 VpnSiteLinkConnection : 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 (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (VpnSiteLink != null)
 42            {
 043                writer.WritePropertyName("vpnSiteLink");
 044                writer.WriteObjectValue(VpnSiteLink);
 45            }
 046            if (RoutingWeight != null)
 47            {
 048                writer.WritePropertyName("routingWeight");
 049                writer.WriteNumberValue(RoutingWeight.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 (UseLocalAzureIpAddress != null)
 107            {
 0108                writer.WritePropertyName("useLocalAzureIpAddress");
 0109                writer.WriteBooleanValue(UseLocalAzureIpAddress.Value);
 110            }
 0111            if (ProvisioningState != null)
 112            {
 0113                writer.WritePropertyName("provisioningState");
 0114                writer.WriteStringValue(ProvisioningState.Value.ToString());
 115            }
 0116            writer.WriteEndObject();
 0117            writer.WriteEndObject();
 0118        }
 119
 120        internal static VpnSiteLinkConnection DeserializeVpnSiteLinkConnection(JsonElement element)
 121        {
 0122            string name = default;
 0123            string etag = default;
 0124            string type = default;
 0125            string id = default;
 0126            SubResource vpnSiteLink = default;
 0127            int? routingWeight = default;
 0128            VpnConnectionStatus? connectionStatus = default;
 0129            VirtualNetworkGatewayConnectionProtocol? vpnConnectionProtocolType = default;
 0130            long? ingressBytesTransferred = default;
 0131            long? egressBytesTransferred = default;
 0132            int? connectionBandwidth = default;
 0133            string sharedKey = default;
 0134            bool? enableBgp = default;
 0135            bool? usePolicyBasedTrafficSelectors = default;
 0136            IList<IpsecPolicy> ipsecPolicies = default;
 0137            bool? enableRateLimiting = default;
 0138            bool? useLocalAzureIpAddress = default;
 0139            ProvisioningState? provisioningState = default;
 0140            foreach (var property in element.EnumerateObject())
 141            {
 0142                if (property.NameEquals("name"))
 143                {
 0144                    if (property.Value.ValueKind == JsonValueKind.Null)
 145                    {
 146                        continue;
 147                    }
 0148                    name = property.Value.GetString();
 0149                    continue;
 150                }
 0151                if (property.NameEquals("etag"))
 152                {
 0153                    if (property.Value.ValueKind == JsonValueKind.Null)
 154                    {
 155                        continue;
 156                    }
 0157                    etag = property.Value.GetString();
 0158                    continue;
 159                }
 0160                if (property.NameEquals("type"))
 161                {
 0162                    if (property.Value.ValueKind == JsonValueKind.Null)
 163                    {
 164                        continue;
 165                    }
 0166                    type = property.Value.GetString();
 0167                    continue;
 168                }
 0169                if (property.NameEquals("id"))
 170                {
 0171                    if (property.Value.ValueKind == JsonValueKind.Null)
 172                    {
 173                        continue;
 174                    }
 0175                    id = property.Value.GetString();
 0176                    continue;
 177                }
 0178                if (property.NameEquals("properties"))
 179                {
 0180                    foreach (var property0 in property.Value.EnumerateObject())
 181                    {
 0182                        if (property0.NameEquals("vpnSiteLink"))
 183                        {
 0184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 0188                            vpnSiteLink = DeserializeSubResource(property0.Value);
 0189                            continue;
 190                        }
 0191                        if (property0.NameEquals("routingWeight"))
 192                        {
 0193                            if (property0.Value.ValueKind == JsonValueKind.Null)
 194                            {
 195                                continue;
 196                            }
 0197                            routingWeight = property0.Value.GetInt32();
 0198                            continue;
 199                        }
 0200                        if (property0.NameEquals("connectionStatus"))
 201                        {
 0202                            if (property0.Value.ValueKind == JsonValueKind.Null)
 203                            {
 204                                continue;
 205                            }
 0206                            connectionStatus = new VpnConnectionStatus(property0.Value.GetString());
 0207                            continue;
 208                        }
 0209                        if (property0.NameEquals("vpnConnectionProtocolType"))
 210                        {
 0211                            if (property0.Value.ValueKind == JsonValueKind.Null)
 212                            {
 213                                continue;
 214                            }
 0215                            vpnConnectionProtocolType = new VirtualNetworkGatewayConnectionProtocol(property0.Value.GetS
 0216                            continue;
 217                        }
 0218                        if (property0.NameEquals("ingressBytesTransferred"))
 219                        {
 0220                            if (property0.Value.ValueKind == JsonValueKind.Null)
 221                            {
 222                                continue;
 223                            }
 0224                            ingressBytesTransferred = property0.Value.GetInt64();
 0225                            continue;
 226                        }
 0227                        if (property0.NameEquals("egressBytesTransferred"))
 228                        {
 0229                            if (property0.Value.ValueKind == JsonValueKind.Null)
 230                            {
 231                                continue;
 232                            }
 0233                            egressBytesTransferred = property0.Value.GetInt64();
 0234                            continue;
 235                        }
 0236                        if (property0.NameEquals("connectionBandwidth"))
 237                        {
 0238                            if (property0.Value.ValueKind == JsonValueKind.Null)
 239                            {
 240                                continue;
 241                            }
 0242                            connectionBandwidth = property0.Value.GetInt32();
 0243                            continue;
 244                        }
 0245                        if (property0.NameEquals("sharedKey"))
 246                        {
 0247                            if (property0.Value.ValueKind == JsonValueKind.Null)
 248                            {
 249                                continue;
 250                            }
 0251                            sharedKey = property0.Value.GetString();
 0252                            continue;
 253                        }
 0254                        if (property0.NameEquals("enableBgp"))
 255                        {
 0256                            if (property0.Value.ValueKind == JsonValueKind.Null)
 257                            {
 258                                continue;
 259                            }
 0260                            enableBgp = property0.Value.GetBoolean();
 0261                            continue;
 262                        }
 0263                        if (property0.NameEquals("usePolicyBasedTrafficSelectors"))
 264                        {
 0265                            if (property0.Value.ValueKind == JsonValueKind.Null)
 266                            {
 267                                continue;
 268                            }
 0269                            usePolicyBasedTrafficSelectors = property0.Value.GetBoolean();
 0270                            continue;
 271                        }
 0272                        if (property0.NameEquals("ipsecPolicies"))
 273                        {
 0274                            if (property0.Value.ValueKind == JsonValueKind.Null)
 275                            {
 276                                continue;
 277                            }
 0278                            List<IpsecPolicy> array = new List<IpsecPolicy>();
 0279                            foreach (var item in property0.Value.EnumerateArray())
 280                            {
 0281                                if (item.ValueKind == JsonValueKind.Null)
 282                                {
 0283                                    array.Add(null);
 284                                }
 285                                else
 286                                {
 0287                                    array.Add(IpsecPolicy.DeserializeIpsecPolicy(item));
 288                                }
 289                            }
 0290                            ipsecPolicies = array;
 0291                            continue;
 292                        }
 0293                        if (property0.NameEquals("enableRateLimiting"))
 294                        {
 0295                            if (property0.Value.ValueKind == JsonValueKind.Null)
 296                            {
 297                                continue;
 298                            }
 0299                            enableRateLimiting = property0.Value.GetBoolean();
 0300                            continue;
 301                        }
 0302                        if (property0.NameEquals("useLocalAzureIpAddress"))
 303                        {
 0304                            if (property0.Value.ValueKind == JsonValueKind.Null)
 305                            {
 306                                continue;
 307                            }
 0308                            useLocalAzureIpAddress = property0.Value.GetBoolean();
 0309                            continue;
 310                        }
 0311                        if (property0.NameEquals("provisioningState"))
 312                        {
 0313                            if (property0.Value.ValueKind == JsonValueKind.Null)
 314                            {
 315                                continue;
 316                            }
 0317                            provisioningState = new ProvisioningState(property0.Value.GetString());
 318                            continue;
 319                        }
 320                    }
 321                    continue;
 322                }
 323            }
 0324            return new VpnSiteLinkConnection(id, name, etag, type, vpnSiteLink, routingWeight, connectionStatus, vpnConn
 325        }
 326    }
 327}