< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_LocalAddress()-0%100%
get_Neighbor()-0%100%
get_Asn()-0%100%
get_State()-0%100%
get_ConnectedDuration()-0%100%
get_RoutesReceived()-0%100%
get_MessagesSent()-0%100%
get_MessagesReceived()-0%100%
DeserializeBgpPeerStatus(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BgpPeerStatus.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> BGP peer status details. </summary>
 11    public partial class BgpPeerStatus
 12    {
 13        /// <summary> Initializes a new instance of BgpPeerStatus. </summary>
 014        internal BgpPeerStatus()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of BgpPeerStatus. </summary>
 19        /// <param name="localAddress"> The virtual network gateway&apos;s local address. </param>
 20        /// <param name="neighbor"> The remote BGP peer. </param>
 21        /// <param name="asn"> The autonomous system number of the remote BGP peer. </param>
 22        /// <param name="state"> The BGP peer state. </param>
 23        /// <param name="connectedDuration"> For how long the peering has been up. </param>
 24        /// <param name="routesReceived"> The number of routes learned from this peer. </param>
 25        /// <param name="messagesSent"> The number of BGP messages sent. </param>
 26        /// <param name="messagesReceived"> The number of BGP messages received. </param>
 027        internal BgpPeerStatus(string localAddress, string neighbor, long? asn, BgpPeerState? state, string connectedDur
 28        {
 029            LocalAddress = localAddress;
 030            Neighbor = neighbor;
 031            Asn = asn;
 032            State = state;
 033            ConnectedDuration = connectedDuration;
 034            RoutesReceived = routesReceived;
 035            MessagesSent = messagesSent;
 036            MessagesReceived = messagesReceived;
 037        }
 38
 39        /// <summary> The virtual network gateway&apos;s local address. </summary>
 040        public string LocalAddress { get; }
 41        /// <summary> The remote BGP peer. </summary>
 042        public string Neighbor { get; }
 43        /// <summary> The autonomous system number of the remote BGP peer. </summary>
 044        public long? Asn { get; }
 45        /// <summary> The BGP peer state. </summary>
 046        public BgpPeerState? State { get; }
 47        /// <summary> For how long the peering has been up. </summary>
 048        public string ConnectedDuration { get; }
 49        /// <summary> The number of routes learned from this peer. </summary>
 050        public long? RoutesReceived { get; }
 51        /// <summary> The number of BGP messages sent. </summary>
 052        public long? MessagesSent { get; }
 53        /// <summary> The number of BGP messages received. </summary>
 054        public long? MessagesReceived { get; }
 55    }
 56}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\BgpPeerStatus.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 BgpPeerStatus
 14    {
 15        internal static BgpPeerStatus DeserializeBgpPeerStatus(JsonElement element)
 16        {
 017            string localAddress = default;
 018            string neighbor = default;
 019            long? asn = default;
 020            BgpPeerState? state = default;
 021            string connectedDuration = default;
 022            long? routesReceived = default;
 023            long? messagesSent = default;
 024            long? messagesReceived = default;
 025            foreach (var property in element.EnumerateObject())
 26            {
 027                if (property.NameEquals("localAddress"))
 28                {
 029                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 033                    localAddress = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("neighbor"))
 37                {
 038                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 40                        continue;
 41                    }
 042                    neighbor = property.Value.GetString();
 043                    continue;
 44                }
 045                if (property.NameEquals("asn"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    asn = property.Value.GetInt64();
 052                    continue;
 53                }
 054                if (property.NameEquals("state"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    state = new BgpPeerState(property.Value.GetString());
 061                    continue;
 62                }
 063                if (property.NameEquals("connectedDuration"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    connectedDuration = property.Value.GetString();
 070                    continue;
 71                }
 072                if (property.NameEquals("routesReceived"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    routesReceived = property.Value.GetInt64();
 079                    continue;
 80                }
 081                if (property.NameEquals("messagesSent"))
 82                {
 083                    if (property.Value.ValueKind == JsonValueKind.Null)
 84                    {
 85                        continue;
 86                    }
 087                    messagesSent = property.Value.GetInt64();
 088                    continue;
 89                }
 090                if (property.NameEquals("messagesReceived"))
 91                {
 092                    if (property.Value.ValueKind == JsonValueKind.Null)
 93                    {
 94                        continue;
 95                    }
 096                    messagesReceived = property.Value.GetInt64();
 97                    continue;
 98                }
 99            }
 0100            return new BgpPeerStatus(localAddress, neighbor, asn, state, connectedDuration, routesReceived, messagesSent
 101        }
 102    }
 103}