< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_AdvertisedPublicPrefixes()-0%100%
get_AdvertisedCommunities()-0%100%
get_AdvertisedPublicPrefixesState()-0%100%
get_LegacyMode()-0%100%
get_CustomerASN()-0%100%
get_RoutingRegistryName()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeExpressRouteCircuitPeeringConfig(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteCircuitPeeringConfig.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> Specifies the peering configuration. </summary>
 13    public partial class ExpressRouteCircuitPeeringConfig
 14    {
 15        /// <summary> Initializes a new instance of ExpressRouteCircuitPeeringConfig. </summary>
 016        public ExpressRouteCircuitPeeringConfig()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ExpressRouteCircuitPeeringConfig. </summary>
 21        /// <param name="advertisedPublicPrefixes"> The reference to AdvertisedPublicPrefixes. </param>
 22        /// <param name="advertisedCommunities"> The communities of bgp peering. Specified for microsoft peering. </para
 23        /// <param name="advertisedPublicPrefixesState"> The advertised public prefix state of the Peering resource. </p
 24        /// <param name="legacyMode"> The legacy mode of the peering. </param>
 25        /// <param name="customerASN"> The CustomerASN of the peering. </param>
 26        /// <param name="routingRegistryName"> The RoutingRegistryName of the configuration. </param>
 027        internal ExpressRouteCircuitPeeringConfig(IList<string> advertisedPublicPrefixes, IList<string> advertisedCommun
 28        {
 029            AdvertisedPublicPrefixes = advertisedPublicPrefixes;
 030            AdvertisedCommunities = advertisedCommunities;
 031            AdvertisedPublicPrefixesState = advertisedPublicPrefixesState;
 032            LegacyMode = legacyMode;
 033            CustomerASN = customerASN;
 034            RoutingRegistryName = routingRegistryName;
 035        }
 36
 37        /// <summary> The reference to AdvertisedPublicPrefixes. </summary>
 038        public IList<string> AdvertisedPublicPrefixes { get; set; }
 39        /// <summary> The communities of bgp peering. Specified for microsoft peering. </summary>
 040        public IList<string> AdvertisedCommunities { get; set; }
 41        /// <summary> The advertised public prefix state of the Peering resource. </summary>
 042        public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState? AdvertisedPublicPrefixesState { get; }
 43        /// <summary> The legacy mode of the peering. </summary>
 044        public int? LegacyMode { get; set; }
 45        /// <summary> The CustomerASN of the peering. </summary>
 046        public int? CustomerASN { get; set; }
 47        /// <summary> The RoutingRegistryName of the configuration. </summary>
 048        public string RoutingRegistryName { get; set; }
 49    }
 50}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ExpressRouteCircuitPeeringConfig.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 ExpressRouteCircuitPeeringConfig : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (AdvertisedPublicPrefixes != null)
 20            {
 021                writer.WritePropertyName("advertisedPublicPrefixes");
 022                writer.WriteStartArray();
 023                foreach (var item in AdvertisedPublicPrefixes)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (AdvertisedCommunities != null)
 30            {
 031                writer.WritePropertyName("advertisedCommunities");
 032                writer.WriteStartArray();
 033                foreach (var item in AdvertisedCommunities)
 34                {
 035                    writer.WriteStringValue(item);
 36                }
 037                writer.WriteEndArray();
 38            }
 039            if (AdvertisedPublicPrefixesState != null)
 40            {
 041                writer.WritePropertyName("advertisedPublicPrefixesState");
 042                writer.WriteStringValue(AdvertisedPublicPrefixesState.Value.ToString());
 43            }
 044            if (LegacyMode != null)
 45            {
 046                writer.WritePropertyName("legacyMode");
 047                writer.WriteNumberValue(LegacyMode.Value);
 48            }
 049            if (CustomerASN != null)
 50            {
 051                writer.WritePropertyName("customerASN");
 052                writer.WriteNumberValue(CustomerASN.Value);
 53            }
 054            if (RoutingRegistryName != null)
 55            {
 056                writer.WritePropertyName("routingRegistryName");
 057                writer.WriteStringValue(RoutingRegistryName);
 58            }
 059            writer.WriteEndObject();
 060        }
 61
 62        internal static ExpressRouteCircuitPeeringConfig DeserializeExpressRouteCircuitPeeringConfig(JsonElement element
 63        {
 064            IList<string> advertisedPublicPrefixes = default;
 065            IList<string> advertisedCommunities = default;
 066            ExpressRouteCircuitPeeringAdvertisedPublicPrefixState? advertisedPublicPrefixesState = default;
 067            int? legacyMode = default;
 068            int? customerASN = default;
 069            string routingRegistryName = default;
 070            foreach (var property in element.EnumerateObject())
 71            {
 072                if (property.NameEquals("advertisedPublicPrefixes"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    List<string> array = new List<string>();
 079                    foreach (var item in property.Value.EnumerateArray())
 80                    {
 081                        if (item.ValueKind == JsonValueKind.Null)
 82                        {
 083                            array.Add(null);
 84                        }
 85                        else
 86                        {
 087                            array.Add(item.GetString());
 88                        }
 89                    }
 090                    advertisedPublicPrefixes = array;
 091                    continue;
 92                }
 093                if (property.NameEquals("advertisedCommunities"))
 94                {
 095                    if (property.Value.ValueKind == JsonValueKind.Null)
 96                    {
 97                        continue;
 98                    }
 099                    List<string> array = new List<string>();
 0100                    foreach (var item in property.Value.EnumerateArray())
 101                    {
 0102                        if (item.ValueKind == JsonValueKind.Null)
 103                        {
 0104                            array.Add(null);
 105                        }
 106                        else
 107                        {
 0108                            array.Add(item.GetString());
 109                        }
 110                    }
 0111                    advertisedCommunities = array;
 0112                    continue;
 113                }
 0114                if (property.NameEquals("advertisedPublicPrefixesState"))
 115                {
 0116                    if (property.Value.ValueKind == JsonValueKind.Null)
 117                    {
 118                        continue;
 119                    }
 0120                    advertisedPublicPrefixesState = new ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(property.V
 0121                    continue;
 122                }
 0123                if (property.NameEquals("legacyMode"))
 124                {
 0125                    if (property.Value.ValueKind == JsonValueKind.Null)
 126                    {
 127                        continue;
 128                    }
 0129                    legacyMode = property.Value.GetInt32();
 0130                    continue;
 131                }
 0132                if (property.NameEquals("customerASN"))
 133                {
 0134                    if (property.Value.ValueKind == JsonValueKind.Null)
 135                    {
 136                        continue;
 137                    }
 0138                    customerASN = property.Value.GetInt32();
 0139                    continue;
 140                }
 0141                if (property.NameEquals("routingRegistryName"))
 142                {
 0143                    if (property.Value.ValueKind == JsonValueKind.Null)
 144                    {
 145                        continue;
 146                    }
 0147                    routingRegistryName = property.Value.GetString();
 148                    continue;
 149                }
 150            }
 0151            return new ExpressRouteCircuitPeeringConfig(advertisedPublicPrefixes, advertisedCommunities, advertisedPubli
 152        }
 153    }
 154}