< Summary

Class:Azure.ResourceManager.Network.Models.RouteFilter
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteFilter.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteFilter.Serialization.cs
Covered lines:98
Uncovered lines:38
Coverable lines:136
Total lines:310
Line coverage:72% (98 of 136)
Covered branches:65
Total branches:90
Branch coverage:72.2% (65 of 90)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_Etag()-100%100%
get_Rules()-100%100%
get_Peerings()-100%100%
get_Ipv6Peerings()-100%100%
get_ProvisioningState()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-59.18%60.71%
DeserializeRouteFilter(...)-75.34%77.42%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteFilter.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> Route Filter Resource. </summary>
 13    public partial class RouteFilter : Resource
 14    {
 15        /// <summary> Initializes a new instance of RouteFilter. </summary>
 1216        public RouteFilter()
 17        {
 1218        }
 19
 20        /// <summary> Initializes a new instance of RouteFilter. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> Resource name. </param>
 23        /// <param name="type"> Resource type. </param>
 24        /// <param name="location"> Resource location. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="rules"> Collection of RouteFilterRules contained within a route filter. </param>
 28        /// <param name="peerings"> A collection of references to express route circuit peerings. </param>
 29        /// <param name="ipv6Peerings"> A collection of references to express route circuit ipv6 peerings. </param>
 30        /// <param name="provisioningState"> The provisioning state of the route filter resource. </param>
 2831        internal RouteFilter(string id, string name, string type, string location, IDictionary<string, string> tags, str
 32        {
 2833            Etag = etag;
 2834            Rules = rules;
 2835            Peerings = peerings;
 2836            Ipv6Peerings = ipv6Peerings;
 2837            ProvisioningState = provisioningState;
 2838        }
 39
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 2441        public string Etag { get; }
 42        /// <summary> Collection of RouteFilterRules contained within a route filter. </summary>
 8043        public IList<RouteFilterRule> Rules { get; set; }
 44        /// <summary> A collection of references to express route circuit peerings. </summary>
 2445        public IList<ExpressRouteCircuitPeering> Peerings { get; }
 46        /// <summary> A collection of references to express route circuit ipv6 peerings. </summary>
 2447        public IList<ExpressRouteCircuitPeering> Ipv6Peerings { get; }
 48        /// <summary> The provisioning state of the route filter resource. </summary>
 3649        public ProvisioningState? ProvisioningState { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\RouteFilter.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 RouteFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 2418            writer.WriteStartObject();
 2419            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 2424            if (Id != null)
 25            {
 026                writer.WritePropertyName("id");
 027                writer.WriteStringValue(Id);
 28            }
 2429            if (Name != null)
 30            {
 031                writer.WritePropertyName("name");
 032                writer.WriteStringValue(Name);
 33            }
 2434            if (Type != null)
 35            {
 036                writer.WritePropertyName("type");
 037                writer.WriteStringValue(Type);
 38            }
 2439            if (Location != null)
 40            {
 2441                writer.WritePropertyName("location");
 2442                writer.WriteStringValue(Location);
 43            }
 2444            if (Tags != null)
 45            {
 2446                writer.WritePropertyName("tags");
 2447                writer.WriteStartObject();
 9648                foreach (var item in Tags)
 49                {
 2450                    writer.WritePropertyName(item.Key);
 2451                    writer.WriteStringValue(item.Value);
 52                }
 2453                writer.WriteEndObject();
 54            }
 2455            writer.WritePropertyName("properties");
 2456            writer.WriteStartObject();
 2457            if (Rules != null)
 58            {
 859                writer.WritePropertyName("rules");
 860                writer.WriteStartArray();
 3261                foreach (var item in Rules)
 62                {
 863                    writer.WriteObjectValue(item);
 64                }
 865                writer.WriteEndArray();
 66            }
 2467            if (Peerings != null)
 68            {
 069                writer.WritePropertyName("peerings");
 070                writer.WriteStartArray();
 071                foreach (var item in Peerings)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 2477            if (Ipv6Peerings != null)
 78            {
 079                writer.WritePropertyName("ipv6Peerings");
 080                writer.WriteStartArray();
 081                foreach (var item in Ipv6Peerings)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 2487            if (ProvisioningState != null)
 88            {
 089                writer.WritePropertyName("provisioningState");
 090                writer.WriteStringValue(ProvisioningState.Value.ToString());
 91            }
 2492            writer.WriteEndObject();
 2493            writer.WriteEndObject();
 2494        }
 95
 96        internal static RouteFilter DeserializeRouteFilter(JsonElement element)
 97        {
 2898            string etag = default;
 2899            string id = default;
 28100            string name = default;
 28101            string type = default;
 28102            string location = default;
 28103            IDictionary<string, string> tags = default;
 28104            IList<RouteFilterRule> rules = default;
 28105            IList<ExpressRouteCircuitPeering> peerings = default;
 28106            IList<ExpressRouteCircuitPeering> ipv6Peerings = default;
 28107            ProvisioningState? provisioningState = default;
 448108            foreach (var property in element.EnumerateObject())
 109            {
 196110                if (property.NameEquals("etag"))
 111                {
 28112                    if (property.Value.ValueKind == JsonValueKind.Null)
 113                    {
 114                        continue;
 115                    }
 28116                    etag = property.Value.GetString();
 28117                    continue;
 118                }
 168119                if (property.NameEquals("id"))
 120                {
 28121                    if (property.Value.ValueKind == JsonValueKind.Null)
 122                    {
 123                        continue;
 124                    }
 28125                    id = property.Value.GetString();
 28126                    continue;
 127                }
 140128                if (property.NameEquals("name"))
 129                {
 28130                    if (property.Value.ValueKind == JsonValueKind.Null)
 131                    {
 132                        continue;
 133                    }
 28134                    name = property.Value.GetString();
 28135                    continue;
 136                }
 112137                if (property.NameEquals("type"))
 138                {
 28139                    if (property.Value.ValueKind == JsonValueKind.Null)
 140                    {
 141                        continue;
 142                    }
 28143                    type = property.Value.GetString();
 28144                    continue;
 145                }
 84146                if (property.NameEquals("location"))
 147                {
 28148                    if (property.Value.ValueKind == JsonValueKind.Null)
 149                    {
 150                        continue;
 151                    }
 28152                    location = property.Value.GetString();
 28153                    continue;
 154                }
 56155                if (property.NameEquals("tags"))
 156                {
 28157                    if (property.Value.ValueKind == JsonValueKind.Null)
 158                    {
 159                        continue;
 160                    }
 28161                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 112162                    foreach (var property0 in property.Value.EnumerateObject())
 163                    {
 28164                        if (property0.Value.ValueKind == JsonValueKind.Null)
 165                        {
 0166                            dictionary.Add(property0.Name, null);
 167                        }
 168                        else
 169                        {
 28170                            dictionary.Add(property0.Name, property0.Value.GetString());
 171                        }
 172                    }
 28173                    tags = dictionary;
 28174                    continue;
 175                }
 28176                if (property.NameEquals("properties"))
 177                {
 168178                    foreach (var property0 in property.Value.EnumerateObject())
 179                    {
 56180                        if (property0.NameEquals("rules"))
 181                        {
 28182                            if (property0.Value.ValueKind == JsonValueKind.Null)
 183                            {
 184                                continue;
 185                            }
 28186                            List<RouteFilterRule> array = new List<RouteFilterRule>();
 80187                            foreach (var item in property0.Value.EnumerateArray())
 188                            {
 12189                                if (item.ValueKind == JsonValueKind.Null)
 190                                {
 0191                                    array.Add(null);
 192                                }
 193                                else
 194                                {
 12195                                    array.Add(RouteFilterRule.DeserializeRouteFilterRule(item));
 196                                }
 197                            }
 28198                            rules = array;
 28199                            continue;
 200                        }
 28201                        if (property0.NameEquals("peerings"))
 202                        {
 0203                            if (property0.Value.ValueKind == JsonValueKind.Null)
 204                            {
 205                                continue;
 206                            }
 0207                            List<ExpressRouteCircuitPeering> array = new List<ExpressRouteCircuitPeering>();
 0208                            foreach (var item in property0.Value.EnumerateArray())
 209                            {
 0210                                if (item.ValueKind == JsonValueKind.Null)
 211                                {
 0212                                    array.Add(null);
 213                                }
 214                                else
 215                                {
 0216                                    array.Add(ExpressRouteCircuitPeering.DeserializeExpressRouteCircuitPeering(item));
 217                                }
 218                            }
 0219                            peerings = array;
 0220                            continue;
 221                        }
 28222                        if (property0.NameEquals("ipv6Peerings"))
 223                        {
 0224                            if (property0.Value.ValueKind == JsonValueKind.Null)
 225                            {
 226                                continue;
 227                            }
 0228                            List<ExpressRouteCircuitPeering> array = new List<ExpressRouteCircuitPeering>();
 0229                            foreach (var item in property0.Value.EnumerateArray())
 230                            {
 0231                                if (item.ValueKind == JsonValueKind.Null)
 232                                {
 0233                                    array.Add(null);
 234                                }
 235                                else
 236                                {
 0237                                    array.Add(ExpressRouteCircuitPeering.DeserializeExpressRouteCircuitPeering(item));
 238                                }
 239                            }
 0240                            ipv6Peerings = array;
 0241                            continue;
 242                        }
 28243                        if (property0.NameEquals("provisioningState"))
 244                        {
 28245                            if (property0.Value.ValueKind == JsonValueKind.Null)
 246                            {
 247                                continue;
 248                            }
 28249                            provisioningState = new ProvisioningState(property0.Value.GetString());
 250                            continue;
 251                        }
 252                    }
 253                    continue;
 254                }
 255            }
 28256            return new RouteFilter(id, name, type, location, tags, etag, rules, peerings, ipv6Peerings, provisioningStat
 257        }
 258    }
 259}