< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Etag()-0%100%
get_Access()-0%100%
get_RouteFilterRuleType()-0%100%
get_Communities()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializePatchRouteFilterRule(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PatchRouteFilterRule.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 Rule Resource. </summary>
 13    public partial class PatchRouteFilterRule : SubResource
 14    {
 15        /// <summary> Initializes a new instance of PatchRouteFilterRule. </summary>
 016        public PatchRouteFilterRule()
 17        {
 018            RouteFilterRuleType = "Community";
 019        }
 20
 21        /// <summary> Initializes a new instance of PatchRouteFilterRule. </summary>
 22        /// <param name="id"> Resource ID. </param>
 23        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 24        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 25        /// <param name="access"> The access type of the rule. </param>
 26        /// <param name="routeFilterRuleType"> The rule type of the rule. </param>
 27        /// <param name="communities"> The collection for bgp community values to filter on. e.g. [&apos;12076:5010&apos
 28        /// <param name="provisioningState"> The provisioning state of the route filter rule resource. </param>
 029        internal PatchRouteFilterRule(string id, string name, string etag, Access? access, string routeFilterRuleType, I
 30        {
 031            Name = name;
 032            Etag = etag;
 033            Access = access;
 034            RouteFilterRuleType = routeFilterRuleType;
 035            Communities = communities;
 036            ProvisioningState = provisioningState;
 037        }
 38
 39        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 040        public string Name { get; }
 41        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 042        public string Etag { get; }
 43        /// <summary> The access type of the rule. </summary>
 044        public Access? Access { get; set; }
 45        /// <summary> The rule type of the rule. </summary>
 046        public string RouteFilterRuleType { get; set; }
 47        /// <summary> The collection for bgp community values to filter on. e.g. [&apos;12076:5010&apos;,&apos;12076:502
 048        public IList<string> Communities { get; set; }
 49        /// <summary> The provisioning state of the route filter rule resource. </summary>
 050        public ProvisioningState? ProvisioningState { get; }
 51    }
 52}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\PatchRouteFilterRule.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 PatchRouteFilterRule : 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 (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            writer.WritePropertyName("properties");
 035            writer.WriteStartObject();
 036            if (Access != null)
 37            {
 038                writer.WritePropertyName("access");
 039                writer.WriteStringValue(Access.Value.ToString());
 40            }
 041            if (RouteFilterRuleType != null)
 42            {
 043                writer.WritePropertyName("routeFilterRuleType");
 044                writer.WriteStringValue(RouteFilterRuleType);
 45            }
 046            if (Communities != null)
 47            {
 048                writer.WritePropertyName("communities");
 049                writer.WriteStartArray();
 050                foreach (var item in Communities)
 51                {
 052                    writer.WriteStringValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 056            if (ProvisioningState != null)
 57            {
 058                writer.WritePropertyName("provisioningState");
 059                writer.WriteStringValue(ProvisioningState.Value.ToString());
 60            }
 061            writer.WriteEndObject();
 062            writer.WriteEndObject();
 063        }
 64
 65        internal static PatchRouteFilterRule DeserializePatchRouteFilterRule(JsonElement element)
 66        {
 067            string name = default;
 068            string etag = default;
 069            string id = default;
 070            Access? access = default;
 071            string routeFilterRuleType = default;
 072            IList<string> communities = default;
 073            ProvisioningState? provisioningState = default;
 074            foreach (var property in element.EnumerateObject())
 75            {
 076                if (property.NameEquals("name"))
 77                {
 078                    if (property.Value.ValueKind == JsonValueKind.Null)
 79                    {
 80                        continue;
 81                    }
 082                    name = property.Value.GetString();
 083                    continue;
 84                }
 085                if (property.NameEquals("etag"))
 86                {
 087                    if (property.Value.ValueKind == JsonValueKind.Null)
 88                    {
 89                        continue;
 90                    }
 091                    etag = property.Value.GetString();
 092                    continue;
 93                }
 094                if (property.NameEquals("id"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    id = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("properties"))
 104                {
 0105                    foreach (var property0 in property.Value.EnumerateObject())
 106                    {
 0107                        if (property0.NameEquals("access"))
 108                        {
 0109                            if (property0.Value.ValueKind == JsonValueKind.Null)
 110                            {
 111                                continue;
 112                            }
 0113                            access = new Access(property0.Value.GetString());
 0114                            continue;
 115                        }
 0116                        if (property0.NameEquals("routeFilterRuleType"))
 117                        {
 0118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 0122                            routeFilterRuleType = property0.Value.GetString();
 0123                            continue;
 124                        }
 0125                        if (property0.NameEquals("communities"))
 126                        {
 0127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 0131                            List<string> array = new List<string>();
 0132                            foreach (var item in property0.Value.EnumerateArray())
 133                            {
 0134                                if (item.ValueKind == JsonValueKind.Null)
 135                                {
 0136                                    array.Add(null);
 137                                }
 138                                else
 139                                {
 0140                                    array.Add(item.GetString());
 141                                }
 142                            }
 0143                            communities = array;
 0144                            continue;
 145                        }
 0146                        if (property0.NameEquals("provisioningState"))
 147                        {
 0148                            if (property0.Value.ValueKind == JsonValueKind.Null)
 149                            {
 150                                continue;
 151                            }
 0152                            provisioningState = new ProvisioningState(property0.Value.GetString());
 153                            continue;
 154                        }
 155                    }
 156                    continue;
 157                }
 158            }
 0159            return new PatchRouteFilterRule(id, name, etag, access, routeFilterRuleType, communities, provisioningState)
 160        }
 161    }
 162}