< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Type()-0%100%
get_Tags()-0%100%
get_Rules()-0%100%
get_Peerings()-0%100%
get_Ipv6Peerings()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePatchRouteFilter(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PatchRouteFilter.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 PatchRouteFilter : SubResource
 14    {
 15        /// <summary> Initializes a new instance of PatchRouteFilter. </summary>
 016        public PatchRouteFilter()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of PatchRouteFilter. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Resource type. </param>
 25        /// <param name="tags"> Resource tags. </param>
 26        /// <param name="rules"> Collection of RouteFilterRules contained within a route filter. </param>
 27        /// <param name="peerings"> A collection of references to express route circuit peerings. </param>
 28        /// <param name="ipv6Peerings"> A collection of references to express route circuit ipv6 peerings. </param>
 29        /// <param name="provisioningState"> The provisioning state of the route filter resource. </param>
 030        internal PatchRouteFilter(string id, string name, string etag, string type, IDictionary<string, string> tags, IL
 31        {
 032            Name = name;
 033            Etag = etag;
 034            Type = type;
 035            Tags = tags;
 036            Rules = rules;
 037            Peerings = peerings;
 038            Ipv6Peerings = ipv6Peerings;
 039            ProvisioningState = provisioningState;
 040        }
 41
 42        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 043        public string Name { get; }
 44        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 045        public string Etag { get; }
 46        /// <summary> Resource type. </summary>
 047        public string Type { get; }
 48        /// <summary> Resource tags. </summary>
 049        public IDictionary<string, string> Tags { get; set; }
 50        /// <summary> Collection of RouteFilterRules contained within a route filter. </summary>
 051        public IList<RouteFilterRule> Rules { get; set; }
 52        /// <summary> A collection of references to express route circuit peerings. </summary>
 053        public IList<ExpressRouteCircuitPeering> Peerings { get; }
 54        /// <summary> A collection of references to express route circuit ipv6 peerings. </summary>
 055        public IList<ExpressRouteCircuitPeering> Ipv6Peerings { get; }
 56        /// <summary> The provisioning state of the route filter resource. </summary>
 057        public ProvisioningState? ProvisioningState { get; }
 58    }
 59}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PatchRouteFilter.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 PatchRouteFilter : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Name != null)
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            if (Etag != null)
 25            {
 026                writer.WritePropertyName("etag");
 027                writer.WriteStringValue(Etag);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Tags != null)
 35            {
 036                writer.WritePropertyName("tags");
 037                writer.WriteStartObject();
 038                foreach (var item in Tags)
 39                {
 040                    writer.WritePropertyName(item.Key);
 041                    writer.WriteStringValue(item.Value);
 42                }
 043                writer.WriteEndObject();
 44            }
 045            if (Id != null)
 46            {
 047                writer.WritePropertyName("id");
 048                writer.WriteStringValue(Id);
 49            }
 050            writer.WritePropertyName("properties");
 051            writer.WriteStartObject();
 052            if (Rules != null)
 53            {
 054                writer.WritePropertyName("rules");
 055                writer.WriteStartArray();
 056                foreach (var item in Rules)
 57                {
 058                    writer.WriteObjectValue(item);
 59                }
 060                writer.WriteEndArray();
 61            }
 062            if (Peerings != null)
 63            {
 064                writer.WritePropertyName("peerings");
 065                writer.WriteStartArray();
 066                foreach (var item in Peerings)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (Ipv6Peerings != null)
 73            {
 074                writer.WritePropertyName("ipv6Peerings");
 075                writer.WriteStartArray();
 076                foreach (var item in Ipv6Peerings)
 77                {
 078                    writer.WriteObjectValue(item);
 79                }
 080                writer.WriteEndArray();
 81            }
 082            if (ProvisioningState != null)
 83            {
 084                writer.WritePropertyName("provisioningState");
 085                writer.WriteStringValue(ProvisioningState.Value.ToString());
 86            }
 087            writer.WriteEndObject();
 088            writer.WriteEndObject();
 089        }
 90
 91        internal static PatchRouteFilter DeserializePatchRouteFilter(JsonElement element)
 92        {
 093            string name = default;
 094            string etag = default;
 095            string type = default;
 096            IDictionary<string, string> tags = default;
 097            string id = default;
 098            IList<RouteFilterRule> rules = default;
 099            IList<ExpressRouteCircuitPeering> peerings = default;
 0100            IList<ExpressRouteCircuitPeering> ipv6Peerings = default;
 0101            ProvisioningState? provisioningState = default;
 0102            foreach (var property in element.EnumerateObject())
 103            {
 0104                if (property.NameEquals("name"))
 105                {
 0106                    if (property.Value.ValueKind == JsonValueKind.Null)
 107                    {
 108                        continue;
 109                    }
 0110                    name = property.Value.GetString();
 0111                    continue;
 112                }
 0113                if (property.NameEquals("etag"))
 114                {
 0115                    if (property.Value.ValueKind == JsonValueKind.Null)
 116                    {
 117                        continue;
 118                    }
 0119                    etag = property.Value.GetString();
 0120                    continue;
 121                }
 0122                if (property.NameEquals("type"))
 123                {
 0124                    if (property.Value.ValueKind == JsonValueKind.Null)
 125                    {
 126                        continue;
 127                    }
 0128                    type = property.Value.GetString();
 0129                    continue;
 130                }
 0131                if (property.NameEquals("tags"))
 132                {
 0133                    if (property.Value.ValueKind == JsonValueKind.Null)
 134                    {
 135                        continue;
 136                    }
 0137                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0138                    foreach (var property0 in property.Value.EnumerateObject())
 139                    {
 0140                        if (property0.Value.ValueKind == JsonValueKind.Null)
 141                        {
 0142                            dictionary.Add(property0.Name, null);
 143                        }
 144                        else
 145                        {
 0146                            dictionary.Add(property0.Name, property0.Value.GetString());
 147                        }
 148                    }
 0149                    tags = dictionary;
 0150                    continue;
 151                }
 0152                if (property.NameEquals("id"))
 153                {
 0154                    if (property.Value.ValueKind == JsonValueKind.Null)
 155                    {
 156                        continue;
 157                    }
 0158                    id = property.Value.GetString();
 0159                    continue;
 160                }
 0161                if (property.NameEquals("properties"))
 162                {
 0163                    foreach (var property0 in property.Value.EnumerateObject())
 164                    {
 0165                        if (property0.NameEquals("rules"))
 166                        {
 0167                            if (property0.Value.ValueKind == JsonValueKind.Null)
 168                            {
 169                                continue;
 170                            }
 0171                            List<RouteFilterRule> array = new List<RouteFilterRule>();
 0172                            foreach (var item in property0.Value.EnumerateArray())
 173                            {
 0174                                if (item.ValueKind == JsonValueKind.Null)
 175                                {
 0176                                    array.Add(null);
 177                                }
 178                                else
 179                                {
 0180                                    array.Add(RouteFilterRule.DeserializeRouteFilterRule(item));
 181                                }
 182                            }
 0183                            rules = array;
 0184                            continue;
 185                        }
 0186                        if (property0.NameEquals("peerings"))
 187                        {
 0188                            if (property0.Value.ValueKind == JsonValueKind.Null)
 189                            {
 190                                continue;
 191                            }
 0192                            List<ExpressRouteCircuitPeering> array = new List<ExpressRouteCircuitPeering>();
 0193                            foreach (var item in property0.Value.EnumerateArray())
 194                            {
 0195                                if (item.ValueKind == JsonValueKind.Null)
 196                                {
 0197                                    array.Add(null);
 198                                }
 199                                else
 200                                {
 0201                                    array.Add(ExpressRouteCircuitPeering.DeserializeExpressRouteCircuitPeering(item));
 202                                }
 203                            }
 0204                            peerings = array;
 0205                            continue;
 206                        }
 0207                        if (property0.NameEquals("ipv6Peerings"))
 208                        {
 0209                            if (property0.Value.ValueKind == JsonValueKind.Null)
 210                            {
 211                                continue;
 212                            }
 0213                            List<ExpressRouteCircuitPeering> array = new List<ExpressRouteCircuitPeering>();
 0214                            foreach (var item in property0.Value.EnumerateArray())
 215                            {
 0216                                if (item.ValueKind == JsonValueKind.Null)
 217                                {
 0218                                    array.Add(null);
 219                                }
 220                                else
 221                                {
 0222                                    array.Add(ExpressRouteCircuitPeering.DeserializeExpressRouteCircuitPeering(item));
 223                                }
 224                            }
 0225                            ipv6Peerings = array;
 0226                            continue;
 227                        }
 0228                        if (property0.NameEquals("provisioningState"))
 229                        {
 0230                            if (property0.Value.ValueKind == JsonValueKind.Null)
 231                            {
 232                                continue;
 233                            }
 0234                            provisioningState = new ProvisioningState(property0.Value.GetString());
 235                            continue;
 236                        }
 237                    }
 238                    continue;
 239                }
 240            }
 0241            return new PatchRouteFilter(id, name, etag, type, tags, rules, peerings, ipv6Peerings, provisioningState);
 242        }
 243    }
 244}