< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_DisableBgpRoutePropagation()-0%100%
get_Source()-0%100%
get_State()-0%100%
get_AddressPrefix()-0%100%
get_NextHopIpAddress()-0%100%
get_NextHopType()-0%100%
DeserializeEffectiveRoute(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveRoute.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> Effective Route. </summary>
 13    public partial class EffectiveRoute
 14    {
 15        /// <summary> Initializes a new instance of EffectiveRoute. </summary>
 016        internal EffectiveRoute()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of EffectiveRoute. </summary>
 21        /// <param name="name"> The name of the user defined route. This is optional. </param>
 22        /// <param name="disableBgpRoutePropagation"> If true, on-premises routes are not propagated to the network inte
 23        /// <param name="source"> Who created the route. </param>
 24        /// <param name="state"> The value of effective route. </param>
 25        /// <param name="addressPrefix"> The address prefixes of the effective routes in CIDR notation. </param>
 26        /// <param name="nextHopIpAddress"> The IP address of the next hop of the effective route. </param>
 27        /// <param name="nextHopType"> The type of Azure hop the packet should be sent to. </param>
 028        internal EffectiveRoute(string name, bool? disableBgpRoutePropagation, EffectiveRouteSource? source, EffectiveRo
 29        {
 030            Name = name;
 031            DisableBgpRoutePropagation = disableBgpRoutePropagation;
 032            Source = source;
 033            State = state;
 034            AddressPrefix = addressPrefix;
 035            NextHopIpAddress = nextHopIpAddress;
 036            NextHopType = nextHopType;
 037        }
 38
 39        /// <summary> The name of the user defined route. This is optional. </summary>
 040        public string Name { get; }
 41        /// <summary> If true, on-premises routes are not propagated to the network interfaces in the subnet. </summary>
 042        public bool? DisableBgpRoutePropagation { get; }
 43        /// <summary> Who created the route. </summary>
 044        public EffectiveRouteSource? Source { get; }
 45        /// <summary> The value of effective route. </summary>
 046        public EffectiveRouteState? State { get; }
 47        /// <summary> The address prefixes of the effective routes in CIDR notation. </summary>
 048        public IReadOnlyList<string> AddressPrefix { get; }
 49        /// <summary> The IP address of the next hop of the effective route. </summary>
 050        public IReadOnlyList<string> NextHopIpAddress { get; }
 51        /// <summary> The type of Azure hop the packet should be sent to. </summary>
 052        public RouteNextHopType? NextHopType { get; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\EffectiveRoute.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 EffectiveRoute
 15    {
 16        internal static EffectiveRoute DeserializeEffectiveRoute(JsonElement element)
 17        {
 018            string name = default;
 019            bool? disableBgpRoutePropagation = default;
 020            EffectiveRouteSource? source = default;
 021            EffectiveRouteState? state = default;
 022            IReadOnlyList<string> addressPrefix = default;
 023            IReadOnlyList<string> nextHopIpAddress = default;
 024            RouteNextHopType? nextHopType = default;
 025            foreach (var property in element.EnumerateObject())
 26            {
 027                if (property.NameEquals("name"))
 28                {
 029                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 033                    name = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("disableBgpRoutePropagation"))
 37                {
 038                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 40                        continue;
 41                    }
 042                    disableBgpRoutePropagation = property.Value.GetBoolean();
 043                    continue;
 44                }
 045                if (property.NameEquals("source"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    source = new EffectiveRouteSource(property.Value.GetString());
 052                    continue;
 53                }
 054                if (property.NameEquals("state"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    state = new EffectiveRouteState(property.Value.GetString());
 061                    continue;
 62                }
 063                if (property.NameEquals("addressPrefix"))
 64                {
 065                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 069                    List<string> array = new List<string>();
 070                    foreach (var item in property.Value.EnumerateArray())
 71                    {
 072                        if (item.ValueKind == JsonValueKind.Null)
 73                        {
 074                            array.Add(null);
 75                        }
 76                        else
 77                        {
 078                            array.Add(item.GetString());
 79                        }
 80                    }
 081                    addressPrefix = array;
 082                    continue;
 83                }
 084                if (property.NameEquals("nextHopIpAddress"))
 85                {
 086                    if (property.Value.ValueKind == JsonValueKind.Null)
 87                    {
 88                        continue;
 89                    }
 090                    List<string> array = new List<string>();
 091                    foreach (var item in property.Value.EnumerateArray())
 92                    {
 093                        if (item.ValueKind == JsonValueKind.Null)
 94                        {
 095                            array.Add(null);
 96                        }
 97                        else
 98                        {
 099                            array.Add(item.GetString());
 100                        }
 101                    }
 0102                    nextHopIpAddress = array;
 0103                    continue;
 104                }
 0105                if (property.NameEquals("nextHopType"))
 106                {
 0107                    if (property.Value.ValueKind == JsonValueKind.Null)
 108                    {
 109                        continue;
 110                    }
 0111                    nextHopType = new RouteNextHopType(property.Value.GetString());
 112                    continue;
 113                }
 114            }
 0115            return new EffectiveRoute(name, disableBgpRoutePropagation, source, state, addressPrefix, nextHopIpAddress, 
 116        }
 117    }
 118}