< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_RuleGroupName()-0%100%
get_Rules()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeApplicationGatewayFirewallDisabledRuleGroup(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallDisabledRuleGroup.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;
 9using System.Collections.Generic;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    /// <summary> Allows to disable rules within a rule group or an entire rule group. </summary>
 14    public partial class ApplicationGatewayFirewallDisabledRuleGroup
 15    {
 16        /// <summary> Initializes a new instance of ApplicationGatewayFirewallDisabledRuleGroup. </summary>
 17        /// <param name="ruleGroupName"> The name of the rule group that will be disabled. </param>
 018        public ApplicationGatewayFirewallDisabledRuleGroup(string ruleGroupName)
 19        {
 020            if (ruleGroupName == null)
 21            {
 022                throw new ArgumentNullException(nameof(ruleGroupName));
 23            }
 24
 025            RuleGroupName = ruleGroupName;
 026        }
 27
 28        /// <summary> Initializes a new instance of ApplicationGatewayFirewallDisabledRuleGroup. </summary>
 29        /// <param name="ruleGroupName"> The name of the rule group that will be disabled. </param>
 30        /// <param name="rules"> The list of rules that will be disabled. If null, all rules of the rule group will be d
 031        internal ApplicationGatewayFirewallDisabledRuleGroup(string ruleGroupName, IList<int> rules)
 32        {
 033            RuleGroupName = ruleGroupName;
 034            Rules = rules;
 035        }
 36
 37        /// <summary> The name of the rule group that will be disabled. </summary>
 038        public string RuleGroupName { get; set; }
 39        /// <summary> The list of rules that will be disabled. If null, all rules of the rule group will be disabled. </
 040        public IList<int> Rules { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallDisabledRuleGroup.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 ApplicationGatewayFirewallDisabledRuleGroup : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("ruleGroupName");
 020            writer.WriteStringValue(RuleGroupName);
 021            if (Rules != null)
 22            {
 023                writer.WritePropertyName("rules");
 024                writer.WriteStartArray();
 025                foreach (var item in Rules)
 26                {
 027                    writer.WriteNumberValue(item);
 28                }
 029                writer.WriteEndArray();
 30            }
 031            writer.WriteEndObject();
 032        }
 33
 34        internal static ApplicationGatewayFirewallDisabledRuleGroup DeserializeApplicationGatewayFirewallDisabledRuleGro
 35        {
 036            string ruleGroupName = default;
 037            IList<int> rules = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("ruleGroupName"))
 41                {
 042                    ruleGroupName = property.Value.GetString();
 043                    continue;
 44                }
 045                if (property.NameEquals("rules"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    List<int> array = new List<int>();
 052                    foreach (var item in property.Value.EnumerateArray())
 53                    {
 054                        array.Add(item.GetInt32());
 55                    }
 056                    rules = array;
 57                    continue;
 58                }
 59            }
 060            return new ApplicationGatewayFirewallDisabledRuleGroup(ruleGroupName, rules);
 61        }
 62    }
 63}