< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_ProvisioningState()-0%100%
get_RuleSetType()-0%100%
get_RuleSetVersion()-0%100%
get_RuleGroups()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayFirewallRuleSet(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallRuleSet.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> A web application firewall rule set. </summary>
 13    public partial class ApplicationGatewayFirewallRuleSet : Resource
 14    {
 15        /// <summary> Initializes a new instance of ApplicationGatewayFirewallRuleSet. </summary>
 016        public ApplicationGatewayFirewallRuleSet()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of ApplicationGatewayFirewallRuleSet. </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="provisioningState"> The provisioning state of the web application firewall rule set. </param>
 27        /// <param name="ruleSetType"> The type of the web application firewall rule set. </param>
 28        /// <param name="ruleSetVersion"> The version of the web application firewall rule set type. </param>
 29        /// <param name="ruleGroups"> The rule groups of the web application firewall rule set. </param>
 030        internal ApplicationGatewayFirewallRuleSet(string id, string name, string type, string location, IDictionary<str
 31        {
 032            ProvisioningState = provisioningState;
 033            RuleSetType = ruleSetType;
 034            RuleSetVersion = ruleSetVersion;
 035            RuleGroups = ruleGroups;
 036        }
 37
 38        /// <summary> The provisioning state of the web application firewall rule set. </summary>
 039        public ProvisioningState? ProvisioningState { get; }
 40        /// <summary> The type of the web application firewall rule set. </summary>
 041        public string RuleSetType { get; set; }
 42        /// <summary> The version of the web application firewall rule set type. </summary>
 043        public string RuleSetVersion { get; set; }
 44        /// <summary> The rule groups of the web application firewall rule set. </summary>
 045        public IList<ApplicationGatewayFirewallRuleGroup> RuleGroups { get; set; }
 46    }
 47}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallRuleSet.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 ApplicationGatewayFirewallRuleSet : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Id != null)
 20            {
 021                writer.WritePropertyName("id");
 022                writer.WriteStringValue(Id);
 23            }
 024            if (Name != null)
 25            {
 026                writer.WritePropertyName("name");
 027                writer.WriteStringValue(Name);
 28            }
 029            if (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Location != null)
 35            {
 036                writer.WritePropertyName("location");
 037                writer.WriteStringValue(Location);
 38            }
 039            if (Tags != null)
 40            {
 041                writer.WritePropertyName("tags");
 042                writer.WriteStartObject();
 043                foreach (var item in Tags)
 44                {
 045                    writer.WritePropertyName(item.Key);
 046                    writer.WriteStringValue(item.Value);
 47                }
 048                writer.WriteEndObject();
 49            }
 050            writer.WritePropertyName("properties");
 051            writer.WriteStartObject();
 052            if (ProvisioningState != null)
 53            {
 054                writer.WritePropertyName("provisioningState");
 055                writer.WriteStringValue(ProvisioningState.Value.ToString());
 56            }
 057            if (RuleSetType != null)
 58            {
 059                writer.WritePropertyName("ruleSetType");
 060                writer.WriteStringValue(RuleSetType);
 61            }
 062            if (RuleSetVersion != null)
 63            {
 064                writer.WritePropertyName("ruleSetVersion");
 065                writer.WriteStringValue(RuleSetVersion);
 66            }
 067            if (RuleGroups != null)
 68            {
 069                writer.WritePropertyName("ruleGroups");
 070                writer.WriteStartArray();
 071                foreach (var item in RuleGroups)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 077            writer.WriteEndObject();
 078            writer.WriteEndObject();
 079        }
 80
 81        internal static ApplicationGatewayFirewallRuleSet DeserializeApplicationGatewayFirewallRuleSet(JsonElement eleme
 82        {
 083            string id = default;
 084            string name = default;
 085            string type = default;
 086            string location = default;
 087            IDictionary<string, string> tags = default;
 088            ProvisioningState? provisioningState = default;
 089            string ruleSetType = default;
 090            string ruleSetVersion = default;
 091            IList<ApplicationGatewayFirewallRuleGroup> ruleGroups = default;
 092            foreach (var property in element.EnumerateObject())
 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("name"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    name = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("type"))
 113                {
 0114                    if (property.Value.ValueKind == JsonValueKind.Null)
 115                    {
 116                        continue;
 117                    }
 0118                    type = property.Value.GetString();
 0119                    continue;
 120                }
 0121                if (property.NameEquals("location"))
 122                {
 0123                    if (property.Value.ValueKind == JsonValueKind.Null)
 124                    {
 125                        continue;
 126                    }
 0127                    location = property.Value.GetString();
 0128                    continue;
 129                }
 0130                if (property.NameEquals("tags"))
 131                {
 0132                    if (property.Value.ValueKind == JsonValueKind.Null)
 133                    {
 134                        continue;
 135                    }
 0136                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0137                    foreach (var property0 in property.Value.EnumerateObject())
 138                    {
 0139                        if (property0.Value.ValueKind == JsonValueKind.Null)
 140                        {
 0141                            dictionary.Add(property0.Name, null);
 142                        }
 143                        else
 144                        {
 0145                            dictionary.Add(property0.Name, property0.Value.GetString());
 146                        }
 147                    }
 0148                    tags = dictionary;
 0149                    continue;
 150                }
 0151                if (property.NameEquals("properties"))
 152                {
 0153                    foreach (var property0 in property.Value.EnumerateObject())
 154                    {
 0155                        if (property0.NameEquals("provisioningState"))
 156                        {
 0157                            if (property0.Value.ValueKind == JsonValueKind.Null)
 158                            {
 159                                continue;
 160                            }
 0161                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0162                            continue;
 163                        }
 0164                        if (property0.NameEquals("ruleSetType"))
 165                        {
 0166                            if (property0.Value.ValueKind == JsonValueKind.Null)
 167                            {
 168                                continue;
 169                            }
 0170                            ruleSetType = property0.Value.GetString();
 0171                            continue;
 172                        }
 0173                        if (property0.NameEquals("ruleSetVersion"))
 174                        {
 0175                            if (property0.Value.ValueKind == JsonValueKind.Null)
 176                            {
 177                                continue;
 178                            }
 0179                            ruleSetVersion = property0.Value.GetString();
 0180                            continue;
 181                        }
 0182                        if (property0.NameEquals("ruleGroups"))
 183                        {
 0184                            if (property0.Value.ValueKind == JsonValueKind.Null)
 185                            {
 186                                continue;
 187                            }
 0188                            List<ApplicationGatewayFirewallRuleGroup> array = new List<ApplicationGatewayFirewallRuleGro
 0189                            foreach (var item in property0.Value.EnumerateArray())
 190                            {
 0191                                if (item.ValueKind == JsonValueKind.Null)
 192                                {
 0193                                    array.Add(null);
 194                                }
 195                                else
 196                                {
 0197                                    array.Add(ApplicationGatewayFirewallRuleGroup.DeserializeApplicationGatewayFirewallR
 198                                }
 199                            }
 0200                            ruleGroups = array;
 201                            continue;
 202                        }
 203                    }
 204                    continue;
 205                }
 206            }
 0207            return new ApplicationGatewayFirewallRuleSet(id, name, type, location, tags, provisioningState, ruleSetType,
 208        }
 209    }
 210}