< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-83.33%50%
.ctor(...)-100%100%
get_Etag()-100%100%
get_AuthorizationKey()-100%100%
get_VirtualNetworkGateway1()-100%100%
get_VirtualNetworkGateway2()-100%100%
get_LocalNetworkGateway2()-100%100%
get_ConnectionType()-100%100%
get_ConnectionProtocol()-100%100%
get_RoutingWeight()-100%100%
get_DpdTimeoutSeconds()-100%100%
get_SharedKey()-100%100%
get_ConnectionStatus()-100%100%
get_TunnelConnectionStatus()-100%100%
get_EgressBytesTransferred()-100%100%
get_IngressBytesTransferred()-100%100%
get_Peer()-100%100%
get_EnableBgp()-100%100%
get_UseLocalAzureIpAddress()-100%100%
get_UsePolicyBasedTrafficSelectors()-100%100%
get_IpsecPolicies()-100%100%
get_TrafficSelectorPolicies()-100%100%
get_ResourceGuid()-100%100%
get_ProvisioningState()-100%100%
get_ExpressRouteGatewayBypass()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-52.48%58.33%
DeserializeVirtualNetworkGatewayConnection(...)-81.37%83.08%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayConnection.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> A common class for general resource information. </summary>
 14    public partial class VirtualNetworkGatewayConnection : Resource
 15    {
 16        /// <summary> Initializes a new instance of VirtualNetworkGatewayConnection. </summary>
 17        /// <param name="virtualNetworkGateway1"> The reference to virtual network gateway resource. </param>
 18        /// <param name="connectionType"> Gateway connection type. </param>
 1219        public VirtualNetworkGatewayConnection(VirtualNetworkGateway virtualNetworkGateway1, VirtualNetworkGatewayConnec
 20        {
 1221            if (virtualNetworkGateway1 == null)
 22            {
 023                throw new ArgumentNullException(nameof(virtualNetworkGateway1));
 24            }
 25
 1226            VirtualNetworkGateway1 = virtualNetworkGateway1;
 1227            ConnectionType = connectionType;
 1228        }
 29
 30        /// <summary> Initializes a new instance of VirtualNetworkGatewayConnection. </summary>
 31        /// <param name="id"> Resource ID. </param>
 32        /// <param name="name"> Resource name. </param>
 33        /// <param name="type"> Resource type. </param>
 34        /// <param name="location"> Resource location. </param>
 35        /// <param name="tags"> Resource tags. </param>
 36        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 37        /// <param name="authorizationKey"> The authorizationKey. </param>
 38        /// <param name="virtualNetworkGateway1"> The reference to virtual network gateway resource. </param>
 39        /// <param name="virtualNetworkGateway2"> The reference to virtual network gateway resource. </param>
 40        /// <param name="localNetworkGateway2"> The reference to local network gateway resource. </param>
 41        /// <param name="connectionType"> Gateway connection type. </param>
 42        /// <param name="connectionProtocol"> Connection protocol used for this connection. </param>
 43        /// <param name="routingWeight"> The routing weight. </param>
 44        /// <param name="dpdTimeoutSeconds"> The dead peer detection timeout of this connection in seconds. </param>
 45        /// <param name="sharedKey"> The IPSec shared key. </param>
 46        /// <param name="connectionStatus"> Virtual Network Gateway connection status. </param>
 47        /// <param name="tunnelConnectionStatus"> Collection of all tunnels&apos; connection health status. </param>
 48        /// <param name="egressBytesTransferred"> The egress bytes transferred in this connection. </param>
 49        /// <param name="ingressBytesTransferred"> The ingress bytes transferred in this connection. </param>
 50        /// <param name="peer"> The reference to peerings resource. </param>
 51        /// <param name="enableBgp"> EnableBgp flag. </param>
 52        /// <param name="useLocalAzureIpAddress"> Use private local Azure IP for the connection. </param>
 53        /// <param name="usePolicyBasedTrafficSelectors"> Enable policy-based traffic selectors. </param>
 54        /// <param name="ipsecPolicies"> The IPSec Policies to be considered by this connection. </param>
 55        /// <param name="trafficSelectorPolicies"> The Traffic Selector Policies to be considered by this connection. </
 56        /// <param name="resourceGuid"> The resource GUID property of the virtual network gateway connection resource. <
 57        /// <param name="provisioningState"> The provisioning state of the virtual network gateway connection resource. 
 58        /// <param name="expressRouteGatewayBypass"> Bypass ExpressRoute Gateway for data forwarding. </param>
 6059        internal VirtualNetworkGatewayConnection(string id, string name, string type, string location, IDictionary<strin
 60        {
 6061            Etag = etag;
 6062            AuthorizationKey = authorizationKey;
 6063            VirtualNetworkGateway1 = virtualNetworkGateway1;
 6064            VirtualNetworkGateway2 = virtualNetworkGateway2;
 6065            LocalNetworkGateway2 = localNetworkGateway2;
 6066            ConnectionType = connectionType;
 6067            ConnectionProtocol = connectionProtocol;
 6068            RoutingWeight = routingWeight;
 6069            DpdTimeoutSeconds = dpdTimeoutSeconds;
 6070            SharedKey = sharedKey;
 6071            ConnectionStatus = connectionStatus;
 6072            TunnelConnectionStatus = tunnelConnectionStatus;
 6073            EgressBytesTransferred = egressBytesTransferred;
 6074            IngressBytesTransferred = ingressBytesTransferred;
 6075            Peer = peer;
 6076            EnableBgp = enableBgp;
 6077            UseLocalAzureIpAddress = useLocalAzureIpAddress;
 6078            UsePolicyBasedTrafficSelectors = usePolicyBasedTrafficSelectors;
 6079            IpsecPolicies = ipsecPolicies;
 6080            TrafficSelectorPolicies = trafficSelectorPolicies;
 6081            ResourceGuid = resourceGuid;
 6082            ProvisioningState = provisioningState;
 6083            ExpressRouteGatewayBypass = expressRouteGatewayBypass;
 6084        }
 85
 86        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 4887        public string Etag { get; }
 88        /// <summary> The authorizationKey. </summary>
 10889        public string AuthorizationKey { get; set; }
 90        /// <summary> The reference to virtual network gateway resource. </summary>
 16891        public VirtualNetworkGateway VirtualNetworkGateway1 { get; set; }
 92        /// <summary> The reference to virtual network gateway resource. </summary>
 10893        public VirtualNetworkGateway VirtualNetworkGateway2 { get; set; }
 94        /// <summary> The reference to local network gateway resource. </summary>
 21695        public LocalNetworkGateway LocalNetworkGateway2 { get; set; }
 96        /// <summary> Gateway connection type. </summary>
 14497        public VirtualNetworkGatewayConnectionType ConnectionType { get; set; }
 98        /// <summary> Connection protocol used for this connection. </summary>
 10899        public VirtualNetworkGatewayConnectionProtocol? ConnectionProtocol { get; set; }
 100        /// <summary> The routing weight. </summary>
 192101        public int? RoutingWeight { get; set; }
 102        /// <summary> The dead peer detection timeout of this connection in seconds. </summary>
 108103        public int? DpdTimeoutSeconds { get; set; }
 104        /// <summary> The IPSec shared key. </summary>
 192105        public string SharedKey { get; set; }
 106        /// <summary> Virtual Network Gateway connection status. </summary>
 60107        public VirtualNetworkGatewayConnectionStatus? ConnectionStatus { get; }
 108        /// <summary> Collection of all tunnels&apos; connection health status. </summary>
 48109        public IList<TunnelConnectionHealth> TunnelConnectionStatus { get; }
 110        /// <summary> The egress bytes transferred in this connection. </summary>
 60111        public long? EgressBytesTransferred { get; }
 112        /// <summary> The ingress bytes transferred in this connection. </summary>
 60113        public long? IngressBytesTransferred { get; }
 114        /// <summary> The reference to peerings resource. </summary>
 108115        public SubResource Peer { get; set; }
 116        /// <summary> EnableBgp flag. </summary>
 132117        public bool? EnableBgp { get; set; }
 118        /// <summary> Use private local Azure IP for the connection. </summary>
 108119        public bool? UseLocalAzureIpAddress { get; set; }
 120        /// <summary> Enable policy-based traffic selectors. </summary>
 176121        public bool? UsePolicyBasedTrafficSelectors { get; set; }
 122        /// <summary> The IPSec Policies to be considered by this connection. </summary>
 296123        public IList<IpsecPolicy> IpsecPolicies { get; set; }
 124        /// <summary> The Traffic Selector Policies to be considered by this connection. </summary>
 108125        public IList<TrafficSelectorPolicy> TrafficSelectorPolicies { get; set; }
 126        /// <summary> The resource GUID property of the virtual network gateway connection resource. </summary>
 48127        public string ResourceGuid { get; }
 128        /// <summary> The provisioning state of the virtual network gateway connection resource. </summary>
 72129        public ProvisioningState? ProvisioningState { get; }
 130        /// <summary> Bypass ExpressRoute Gateway for data forwarding. </summary>
 108131        public bool? ExpressRouteGatewayBypass { get; set; }
 132    }
 133}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkGatewayConnection.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 VirtualNetworkGatewayConnection : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 4818            writer.WriteStartObject();
 4819            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 4824            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 4829            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 4834            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 4839            if (Location != null)
 40            {
 4841                writer.WritePropertyName("location");
 4842                writer.WriteStringValue(Location);
 43            }
 4844            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            }
 4855            writer.WritePropertyName("properties");
 4856            writer.WriteStartObject();
 4857            if (AuthorizationKey != null)
 58            {
 059                writer.WritePropertyName("authorizationKey");
 060                writer.WriteStringValue(AuthorizationKey);
 61            }
 4862            writer.WritePropertyName("virtualNetworkGateway1");
 4863            writer.WriteObjectValue(VirtualNetworkGateway1);
 4864            if (VirtualNetworkGateway2 != null)
 65            {
 066                writer.WritePropertyName("virtualNetworkGateway2");
 067                writer.WriteObjectValue(VirtualNetworkGateway2);
 68            }
 4869            if (LocalNetworkGateway2 != null)
 70            {
 4871                writer.WritePropertyName("localNetworkGateway2");
 4872                writer.WriteObjectValue(LocalNetworkGateway2);
 73            }
 4874            writer.WritePropertyName("connectionType");
 4875            writer.WriteStringValue(ConnectionType.ToString());
 4876            if (ConnectionProtocol != null)
 77            {
 078                writer.WritePropertyName("connectionProtocol");
 079                writer.WriteStringValue(ConnectionProtocol.Value.ToString());
 80            }
 4881            if (RoutingWeight != null)
 82            {
 4883                writer.WritePropertyName("routingWeight");
 4884                writer.WriteNumberValue(RoutingWeight.Value);
 85            }
 4886            if (DpdTimeoutSeconds != null)
 87            {
 088                writer.WritePropertyName("dpdTimeoutSeconds");
 089                writer.WriteNumberValue(DpdTimeoutSeconds.Value);
 90            }
 4891            if (SharedKey != null)
 92            {
 4893                writer.WritePropertyName("sharedKey");
 4894                writer.WriteStringValue(SharedKey);
 95            }
 4896            if (ConnectionStatus != null)
 97            {
 098                writer.WritePropertyName("connectionStatus");
 099                writer.WriteStringValue(ConnectionStatus.Value.ToString());
 100            }
 48101            if (TunnelConnectionStatus != null)
 102            {
 0103                writer.WritePropertyName("tunnelConnectionStatus");
 0104                writer.WriteStartArray();
 0105                foreach (var item in TunnelConnectionStatus)
 106                {
 0107                    writer.WriteObjectValue(item);
 108                }
 0109                writer.WriteEndArray();
 110            }
 48111            if (EgressBytesTransferred != null)
 112            {
 0113                writer.WritePropertyName("egressBytesTransferred");
 0114                writer.WriteNumberValue(EgressBytesTransferred.Value);
 115            }
 48116            if (IngressBytesTransferred != null)
 117            {
 0118                writer.WritePropertyName("ingressBytesTransferred");
 0119                writer.WriteNumberValue(IngressBytesTransferred.Value);
 120            }
 48121            if (Peer != null)
 122            {
 0123                writer.WritePropertyName("peer");
 0124                writer.WriteObjectValue(Peer);
 125            }
 48126            if (EnableBgp != null)
 127            {
 8128                writer.WritePropertyName("enableBgp");
 8129                writer.WriteBooleanValue(EnableBgp.Value);
 130            }
 48131            if (UseLocalAzureIpAddress != null)
 132            {
 0133                writer.WritePropertyName("useLocalAzureIpAddress");
 0134                writer.WriteBooleanValue(UseLocalAzureIpAddress.Value);
 135            }
 48136            if (UsePolicyBasedTrafficSelectors != null)
 137            {
 24138                writer.WritePropertyName("usePolicyBasedTrafficSelectors");
 24139                writer.WriteBooleanValue(UsePolicyBasedTrafficSelectors.Value);
 140            }
 48141            if (IpsecPolicies != null)
 142            {
 16143                writer.WritePropertyName("ipsecPolicies");
 16144                writer.WriteStartArray();
 64145                foreach (var item in IpsecPolicies)
 146                {
 16147                    writer.WriteObjectValue(item);
 148                }
 16149                writer.WriteEndArray();
 150            }
 48151            if (TrafficSelectorPolicies != null)
 152            {
 0153                writer.WritePropertyName("trafficSelectorPolicies");
 0154                writer.WriteStartArray();
 0155                foreach (var item in TrafficSelectorPolicies)
 156                {
 0157                    writer.WriteObjectValue(item);
 158                }
 0159                writer.WriteEndArray();
 160            }
 48161            if (ResourceGuid != null)
 162            {
 0163                writer.WritePropertyName("resourceGuid");
 0164                writer.WriteStringValue(ResourceGuid);
 165            }
 48166            if (ProvisioningState != null)
 167            {
 0168                writer.WritePropertyName("provisioningState");
 0169                writer.WriteStringValue(ProvisioningState.Value.ToString());
 170            }
 48171            if (ExpressRouteGatewayBypass != null)
 172            {
 0173                writer.WritePropertyName("expressRouteGatewayBypass");
 0174                writer.WriteBooleanValue(ExpressRouteGatewayBypass.Value);
 175            }
 48176            writer.WriteEndObject();
 48177            writer.WriteEndObject();
 48178        }
 179
 180        internal static VirtualNetworkGatewayConnection DeserializeVirtualNetworkGatewayConnection(JsonElement element)
 181        {
 60182            string etag = default;
 60183            string id = default;
 60184            string name = default;
 60185            string type = default;
 60186            string location = default;
 60187            IDictionary<string, string> tags = default;
 60188            string authorizationKey = default;
 60189            VirtualNetworkGateway virtualNetworkGateway1 = default;
 60190            VirtualNetworkGateway virtualNetworkGateway2 = default;
 60191            LocalNetworkGateway localNetworkGateway2 = default;
 60192            VirtualNetworkGatewayConnectionType connectionType = default;
 60193            VirtualNetworkGatewayConnectionProtocol? connectionProtocol = default;
 60194            int? routingWeight = default;
 60195            int? dpdTimeoutSeconds = default;
 60196            string sharedKey = default;
 60197            VirtualNetworkGatewayConnectionStatus? connectionStatus = default;
 60198            IList<TunnelConnectionHealth> tunnelConnectionStatus = default;
 60199            long? egressBytesTransferred = default;
 60200            long? ingressBytesTransferred = default;
 60201            SubResource peer = default;
 60202            bool? enableBgp = default;
 60203            bool? useLocalAzureIpAddress = default;
 60204            bool? usePolicyBasedTrafficSelectors = default;
 60205            IList<IpsecPolicy> ipsecPolicies = default;
 60206            IList<TrafficSelectorPolicy> trafficSelectorPolicies = default;
 60207            string resourceGuid = default;
 60208            ProvisioningState? provisioningState = default;
 60209            bool? expressRouteGatewayBypass = default;
 840210            foreach (var property in element.EnumerateObject())
 211            {
 360212                if (property.NameEquals("etag"))
 213                {
 60214                    if (property.Value.ValueKind == JsonValueKind.Null)
 215                    {
 216                        continue;
 217                    }
 60218                    etag = property.Value.GetString();
 60219                    continue;
 220                }
 300221                if (property.NameEquals("id"))
 222                {
 60223                    if (property.Value.ValueKind == JsonValueKind.Null)
 224                    {
 225                        continue;
 226                    }
 60227                    id = property.Value.GetString();
 60228                    continue;
 229                }
 240230                if (property.NameEquals("name"))
 231                {
 60232                    if (property.Value.ValueKind == JsonValueKind.Null)
 233                    {
 234                        continue;
 235                    }
 60236                    name = property.Value.GetString();
 60237                    continue;
 238                }
 180239                if (property.NameEquals("type"))
 240                {
 60241                    if (property.Value.ValueKind == JsonValueKind.Null)
 242                    {
 243                        continue;
 244                    }
 60245                    type = property.Value.GetString();
 60246                    continue;
 247                }
 120248                if (property.NameEquals("location"))
 249                {
 60250                    if (property.Value.ValueKind == JsonValueKind.Null)
 251                    {
 252                        continue;
 253                    }
 60254                    location = property.Value.GetString();
 60255                    continue;
 256                }
 60257                if (property.NameEquals("tags"))
 258                {
 0259                    if (property.Value.ValueKind == JsonValueKind.Null)
 260                    {
 261                        continue;
 262                    }
 0263                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0264                    foreach (var property0 in property.Value.EnumerateObject())
 265                    {
 0266                        if (property0.Value.ValueKind == JsonValueKind.Null)
 267                        {
 0268                            dictionary.Add(property0.Name, null);
 269                        }
 270                        else
 271                        {
 0272                            dictionary.Add(property0.Name, property0.Value.GetString());
 273                        }
 274                    }
 0275                    tags = dictionary;
 0276                    continue;
 277                }
 60278                if (property.NameEquals("properties"))
 279                {
 2352280                    foreach (var property0 in property.Value.EnumerateObject())
 281                    {
 1116282                        if (property0.NameEquals("authorizationKey"))
 283                        {
 0284                            if (property0.Value.ValueKind == JsonValueKind.Null)
 285                            {
 286                                continue;
 287                            }
 0288                            authorizationKey = property0.Value.GetString();
 0289                            continue;
 290                        }
 1116291                        if (property0.NameEquals("virtualNetworkGateway1"))
 292                        {
 60293                            virtualNetworkGateway1 = VirtualNetworkGateway.DeserializeVirtualNetworkGateway(property0.Va
 60294                            continue;
 295                        }
 1056296                        if (property0.NameEquals("virtualNetworkGateway2"))
 297                        {
 0298                            if (property0.Value.ValueKind == JsonValueKind.Null)
 299                            {
 300                                continue;
 301                            }
 0302                            virtualNetworkGateway2 = VirtualNetworkGateway.DeserializeVirtualNetworkGateway(property0.Va
 0303                            continue;
 304                        }
 1056305                        if (property0.NameEquals("localNetworkGateway2"))
 306                        {
 60307                            if (property0.Value.ValueKind == JsonValueKind.Null)
 308                            {
 309                                continue;
 310                            }
 60311                            localNetworkGateway2 = LocalNetworkGateway.DeserializeLocalNetworkGateway(property0.Value);
 60312                            continue;
 313                        }
 996314                        if (property0.NameEquals("connectionType"))
 315                        {
 60316                            connectionType = new VirtualNetworkGatewayConnectionType(property0.Value.GetString());
 60317                            continue;
 318                        }
 936319                        if (property0.NameEquals("connectionProtocol"))
 320                        {
 60321                            if (property0.Value.ValueKind == JsonValueKind.Null)
 322                            {
 323                                continue;
 324                            }
 60325                            connectionProtocol = new VirtualNetworkGatewayConnectionProtocol(property0.Value.GetString()
 60326                            continue;
 327                        }
 876328                        if (property0.NameEquals("routingWeight"))
 329                        {
 60330                            if (property0.Value.ValueKind == JsonValueKind.Null)
 331                            {
 332                                continue;
 333                            }
 60334                            routingWeight = property0.Value.GetInt32();
 60335                            continue;
 336                        }
 816337                        if (property0.NameEquals("dpdTimeoutSeconds"))
 338                        {
 60339                            if (property0.Value.ValueKind == JsonValueKind.Null)
 340                            {
 341                                continue;
 342                            }
 60343                            dpdTimeoutSeconds = property0.Value.GetInt32();
 60344                            continue;
 345                        }
 756346                        if (property0.NameEquals("sharedKey"))
 347                        {
 48348                            if (property0.Value.ValueKind == JsonValueKind.Null)
 349                            {
 350                                continue;
 351                            }
 48352                            sharedKey = property0.Value.GetString();
 48353                            continue;
 354                        }
 708355                        if (property0.NameEquals("connectionStatus"))
 356                        {
 48357                            if (property0.Value.ValueKind == JsonValueKind.Null)
 358                            {
 359                                continue;
 360                            }
 48361                            connectionStatus = new VirtualNetworkGatewayConnectionStatus(property0.Value.GetString());
 48362                            continue;
 363                        }
 660364                        if (property0.NameEquals("tunnelConnectionStatus"))
 365                        {
 0366                            if (property0.Value.ValueKind == JsonValueKind.Null)
 367                            {
 368                                continue;
 369                            }
 0370                            List<TunnelConnectionHealth> array = new List<TunnelConnectionHealth>();
 0371                            foreach (var item in property0.Value.EnumerateArray())
 372                            {
 0373                                if (item.ValueKind == JsonValueKind.Null)
 374                                {
 0375                                    array.Add(null);
 376                                }
 377                                else
 378                                {
 0379                                    array.Add(TunnelConnectionHealth.DeserializeTunnelConnectionHealth(item));
 380                                }
 381                            }
 0382                            tunnelConnectionStatus = array;
 0383                            continue;
 384                        }
 660385                        if (property0.NameEquals("egressBytesTransferred"))
 386                        {
 60387                            if (property0.Value.ValueKind == JsonValueKind.Null)
 388                            {
 389                                continue;
 390                            }
 60391                            egressBytesTransferred = property0.Value.GetInt64();
 60392                            continue;
 393                        }
 600394                        if (property0.NameEquals("ingressBytesTransferred"))
 395                        {
 60396                            if (property0.Value.ValueKind == JsonValueKind.Null)
 397                            {
 398                                continue;
 399                            }
 60400                            ingressBytesTransferred = property0.Value.GetInt64();
 60401                            continue;
 402                        }
 540403                        if (property0.NameEquals("peer"))
 404                        {
 0405                            if (property0.Value.ValueKind == JsonValueKind.Null)
 406                            {
 407                                continue;
 408                            }
 0409                            peer = SubResource.DeserializeSubResource(property0.Value);
 0410                            continue;
 411                        }
 540412                        if (property0.NameEquals("enableBgp"))
 413                        {
 60414                            if (property0.Value.ValueKind == JsonValueKind.Null)
 415                            {
 416                                continue;
 417                            }
 60418                            enableBgp = property0.Value.GetBoolean();
 60419                            continue;
 420                        }
 480421                        if (property0.NameEquals("useLocalAzureIpAddress"))
 422                        {
 60423                            if (property0.Value.ValueKind == JsonValueKind.Null)
 424                            {
 425                                continue;
 426                            }
 60427                            useLocalAzureIpAddress = property0.Value.GetBoolean();
 60428                            continue;
 429                        }
 420430                        if (property0.NameEquals("usePolicyBasedTrafficSelectors"))
 431                        {
 60432                            if (property0.Value.ValueKind == JsonValueKind.Null)
 433                            {
 434                                continue;
 435                            }
 60436                            usePolicyBasedTrafficSelectors = property0.Value.GetBoolean();
 60437                            continue;
 438                        }
 360439                        if (property0.NameEquals("ipsecPolicies"))
 440                        {
 60441                            if (property0.Value.ValueKind == JsonValueKind.Null)
 442                            {
 443                                continue;
 444                            }
 60445                            List<IpsecPolicy> array = new List<IpsecPolicy>();
 152446                            foreach (var item in property0.Value.EnumerateArray())
 447                            {
 16448                                if (item.ValueKind == JsonValueKind.Null)
 449                                {
 0450                                    array.Add(null);
 451                                }
 452                                else
 453                                {
 16454                                    array.Add(IpsecPolicy.DeserializeIpsecPolicy(item));
 455                                }
 456                            }
 60457                            ipsecPolicies = array;
 60458                            continue;
 459                        }
 300460                        if (property0.NameEquals("trafficSelectorPolicies"))
 461                        {
 60462                            if (property0.Value.ValueKind == JsonValueKind.Null)
 463                            {
 464                                continue;
 465                            }
 60466                            List<TrafficSelectorPolicy> array = new List<TrafficSelectorPolicy>();
 0467                            foreach (var item in property0.Value.EnumerateArray())
 468                            {
 0469                                if (item.ValueKind == JsonValueKind.Null)
 470                                {
 0471                                    array.Add(null);
 472                                }
 473                                else
 474                                {
 0475                                    array.Add(TrafficSelectorPolicy.DeserializeTrafficSelectorPolicy(item));
 476                                }
 477                            }
 60478                            trafficSelectorPolicies = array;
 60479                            continue;
 480                        }
 240481                        if (property0.NameEquals("resourceGuid"))
 482                        {
 60483                            if (property0.Value.ValueKind == JsonValueKind.Null)
 484                            {
 485                                continue;
 486                            }
 60487                            resourceGuid = property0.Value.GetString();
 60488                            continue;
 489                        }
 180490                        if (property0.NameEquals("provisioningState"))
 491                        {
 60492                            if (property0.Value.ValueKind == JsonValueKind.Null)
 493                            {
 494                                continue;
 495                            }
 60496                            provisioningState = new ProvisioningState(property0.Value.GetString());
 60497                            continue;
 498                        }
 120499                        if (property0.NameEquals("expressRouteGatewayBypass"))
 500                        {
 60501                            if (property0.Value.ValueKind == JsonValueKind.Null)
 502                            {
 503                                continue;
 504                            }
 60505                            expressRouteGatewayBypass = property0.Value.GetBoolean();
 506                            continue;
 507                        }
 508                    }
 509                    continue;
 510                }
 511            }
 60512            return new VirtualNetworkGatewayConnection(id, name, type, location, tags, etag, authorizationKey, virtualNe
 513        }
 514    }
 515}