< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Tunnel()-0%100%
get_ConnectionStatus()-0%100%
get_IngressBytesTransferred()-0%100%
get_EgressBytesTransferred()-0%100%
get_LastConnectionEstablishedUtcTime()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeTunnelConnectionHealth(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TunnelConnectionHealth.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> VirtualNetworkGatewayConnection properties. </summary>
 11    public partial class TunnelConnectionHealth
 12    {
 13        /// <summary> Initializes a new instance of TunnelConnectionHealth. </summary>
 014        public TunnelConnectionHealth()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of TunnelConnectionHealth. </summary>
 19        /// <param name="tunnel"> Tunnel name. </param>
 20        /// <param name="connectionStatus"> Virtual Network Gateway connection status. </param>
 21        /// <param name="ingressBytesTransferred"> The Ingress Bytes Transferred in this connection. </param>
 22        /// <param name="egressBytesTransferred"> The Egress Bytes Transferred in this connection. </param>
 23        /// <param name="lastConnectionEstablishedUtcTime"> The time at which connection was established in Utc format. 
 024        internal TunnelConnectionHealth(string tunnel, VirtualNetworkGatewayConnectionStatus? connectionStatus, long? in
 25        {
 026            Tunnel = tunnel;
 027            ConnectionStatus = connectionStatus;
 028            IngressBytesTransferred = ingressBytesTransferred;
 029            EgressBytesTransferred = egressBytesTransferred;
 030            LastConnectionEstablishedUtcTime = lastConnectionEstablishedUtcTime;
 031        }
 32
 33        /// <summary> Tunnel name. </summary>
 034        public string Tunnel { get; }
 35        /// <summary> Virtual Network Gateway connection status. </summary>
 036        public VirtualNetworkGatewayConnectionStatus? ConnectionStatus { get; }
 37        /// <summary> The Ingress Bytes Transferred in this connection. </summary>
 038        public long? IngressBytesTransferred { get; }
 39        /// <summary> The Egress Bytes Transferred in this connection. </summary>
 040        public long? EgressBytesTransferred { get; }
 41        /// <summary> The time at which connection was established in Utc format. </summary>
 042        public string LastConnectionEstablishedUtcTime { get; }
 43    }
 44}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\TunnelConnectionHealth.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class TunnelConnectionHealth : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Tunnel != null)
 19            {
 020                writer.WritePropertyName("tunnel");
 021                writer.WriteStringValue(Tunnel);
 22            }
 023            if (ConnectionStatus != null)
 24            {
 025                writer.WritePropertyName("connectionStatus");
 026                writer.WriteStringValue(ConnectionStatus.Value.ToString());
 27            }
 028            if (IngressBytesTransferred != null)
 29            {
 030                writer.WritePropertyName("ingressBytesTransferred");
 031                writer.WriteNumberValue(IngressBytesTransferred.Value);
 32            }
 033            if (EgressBytesTransferred != null)
 34            {
 035                writer.WritePropertyName("egressBytesTransferred");
 036                writer.WriteNumberValue(EgressBytesTransferred.Value);
 37            }
 038            if (LastConnectionEstablishedUtcTime != null)
 39            {
 040                writer.WritePropertyName("lastConnectionEstablishedUtcTime");
 041                writer.WriteStringValue(LastConnectionEstablishedUtcTime);
 42            }
 043            writer.WriteEndObject();
 044        }
 45
 46        internal static TunnelConnectionHealth DeserializeTunnelConnectionHealth(JsonElement element)
 47        {
 048            string tunnel = default;
 049            VirtualNetworkGatewayConnectionStatus? connectionStatus = default;
 050            long? ingressBytesTransferred = default;
 051            long? egressBytesTransferred = default;
 052            string lastConnectionEstablishedUtcTime = default;
 053            foreach (var property in element.EnumerateObject())
 54            {
 055                if (property.NameEquals("tunnel"))
 56                {
 057                    if (property.Value.ValueKind == JsonValueKind.Null)
 58                    {
 59                        continue;
 60                    }
 061                    tunnel = property.Value.GetString();
 062                    continue;
 63                }
 064                if (property.NameEquals("connectionStatus"))
 65                {
 066                    if (property.Value.ValueKind == JsonValueKind.Null)
 67                    {
 68                        continue;
 69                    }
 070                    connectionStatus = new VirtualNetworkGatewayConnectionStatus(property.Value.GetString());
 071                    continue;
 72                }
 073                if (property.NameEquals("ingressBytesTransferred"))
 74                {
 075                    if (property.Value.ValueKind == JsonValueKind.Null)
 76                    {
 77                        continue;
 78                    }
 079                    ingressBytesTransferred = property.Value.GetInt64();
 080                    continue;
 81                }
 082                if (property.NameEquals("egressBytesTransferred"))
 83                {
 084                    if (property.Value.ValueKind == JsonValueKind.Null)
 85                    {
 86                        continue;
 87                    }
 088                    egressBytesTransferred = property.Value.GetInt64();
 089                    continue;
 90                }
 091                if (property.NameEquals("lastConnectionEstablishedUtcTime"))
 92                {
 093                    if (property.Value.ValueKind == JsonValueKind.Null)
 94                    {
 95                        continue;
 96                    }
 097                    lastConnectionEstablishedUtcTime = property.Value.GetString();
 98                    continue;
 99                }
 100            }
 0101            return new TunnelConnectionHealth(tunnel, connectionStatus, ingressBytesTransferred, egressBytesTransferred,
 102        }
 103    }
 104}