< Summary

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

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%
DeserializeManagedRuleGroupOverride(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedRuleGroupOverride.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> Defines a managed rule group override setting. </summary>
 14    public partial class ManagedRuleGroupOverride
 15    {
 16        /// <summary> Initializes a new instance of ManagedRuleGroupOverride. </summary>
 17        /// <param name="ruleGroupName"> The managed rule group to override. </param>
 018        public ManagedRuleGroupOverride(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 ManagedRuleGroupOverride. </summary>
 29        /// <param name="ruleGroupName"> The managed rule group to override. </param>
 30        /// <param name="rules"> List of rules that will be disabled. If none specified, all rules in the group will be 
 031        internal ManagedRuleGroupOverride(string ruleGroupName, IList<ManagedRuleOverride> rules)
 32        {
 033            RuleGroupName = ruleGroupName;
 034            Rules = rules;
 035        }
 36
 37        /// <summary> The managed rule group to override. </summary>
 038        public string RuleGroupName { get; set; }
 39        /// <summary> List of rules that will be disabled. If none specified, all rules in the group will be disabled. <
 040        public IList<ManagedRuleOverride> Rules { get; set; }
 41    }
 42}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ManagedRuleGroupOverride.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 ManagedRuleGroupOverride : 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.WriteObjectValue(item);
 28                }
 029                writer.WriteEndArray();
 30            }
 031            writer.WriteEndObject();
 032        }
 33
 34        internal static ManagedRuleGroupOverride DeserializeManagedRuleGroupOverride(JsonElement element)
 35        {
 036            string ruleGroupName = default;
 037            IList<ManagedRuleOverride> 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<ManagedRuleOverride> array = new List<ManagedRuleOverride>();
 052                    foreach (var item in property.Value.EnumerateArray())
 53                    {
 054                        if (item.ValueKind == JsonValueKind.Null)
 55                        {
 056                            array.Add(null);
 57                        }
 58                        else
 59                        {
 060                            array.Add(ManagedRuleOverride.DeserializeManagedRuleOverride(item));
 61                        }
 62                    }
 063                    rules = array;
 64                    continue;
 65                }
 66            }
 067            return new ManagedRuleGroupOverride(ruleGroupName, rules);
 68        }
 69    }
 70}