< Summary

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

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallRuleGroup.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;
 10using System.Linq;
 11
 12namespace Azure.ResourceManager.Network.Models
 13{
 14    /// <summary> A web application firewall rule group. </summary>
 15    public partial class ApplicationGatewayFirewallRuleGroup
 16    {
 17        /// <summary> Initializes a new instance of ApplicationGatewayFirewallRuleGroup. </summary>
 18        /// <param name="ruleGroupName"> The name of the web application firewall rule group. </param>
 19        /// <param name="rules"> The rules of the web application firewall rule group. </param>
 020        public ApplicationGatewayFirewallRuleGroup(string ruleGroupName, IEnumerable<ApplicationGatewayFirewallRule> rul
 21        {
 022            if (ruleGroupName == null)
 23            {
 024                throw new ArgumentNullException(nameof(ruleGroupName));
 25            }
 026            if (rules == null)
 27            {
 028                throw new ArgumentNullException(nameof(rules));
 29            }
 30
 031            RuleGroupName = ruleGroupName;
 032            Rules = rules.ToList();
 033        }
 34
 35        /// <summary> Initializes a new instance of ApplicationGatewayFirewallRuleGroup. </summary>
 36        /// <param name="ruleGroupName"> The name of the web application firewall rule group. </param>
 37        /// <param name="description"> The description of the web application firewall rule group. </param>
 38        /// <param name="rules"> The rules of the web application firewall rule group. </param>
 039        internal ApplicationGatewayFirewallRuleGroup(string ruleGroupName, string description, IList<ApplicationGatewayF
 40        {
 041            RuleGroupName = ruleGroupName;
 042            Description = description;
 043            Rules = rules ?? new List<ApplicationGatewayFirewallRule>();
 044        }
 45
 46        /// <summary> The name of the web application firewall rule group. </summary>
 047        public string RuleGroupName { get; set; }
 48        /// <summary> The description of the web application firewall rule group. </summary>
 049        public string Description { get; set; }
 50        /// <summary> The rules of the web application firewall rule group. </summary>
 051        public IList<ApplicationGatewayFirewallRule> Rules { get; }
 52    }
 53}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\ApplicationGatewayFirewallRuleGroup.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 ApplicationGatewayFirewallRuleGroup : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("ruleGroupName");
 020            writer.WriteStringValue(RuleGroupName);
 021            if (Description != null)
 22            {
 023                writer.WritePropertyName("description");
 024                writer.WriteStringValue(Description);
 25            }
 026            writer.WritePropertyName("rules");
 027            writer.WriteStartArray();
 028            foreach (var item in Rules)
 29            {
 030                writer.WriteObjectValue(item);
 31            }
 032            writer.WriteEndArray();
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static ApplicationGatewayFirewallRuleGroup DeserializeApplicationGatewayFirewallRuleGroup(JsonElement e
 37        {
 038            string ruleGroupName = default;
 039            string description = default;
 040            IList<ApplicationGatewayFirewallRule> rules = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("ruleGroupName"))
 44                {
 045                    ruleGroupName = property.Value.GetString();
 046                    continue;
 47                }
 048                if (property.NameEquals("description"))
 49                {
 050                    if (property.Value.ValueKind == JsonValueKind.Null)
 51                    {
 52                        continue;
 53                    }
 054                    description = property.Value.GetString();
 055                    continue;
 56                }
 057                if (property.NameEquals("rules"))
 58                {
 059                    List<ApplicationGatewayFirewallRule> array = new List<ApplicationGatewayFirewallRule>();
 060                    foreach (var item in property.Value.EnumerateArray())
 61                    {
 062                        if (item.ValueKind == JsonValueKind.Null)
 63                        {
 064                            array.Add(null);
 65                        }
 66                        else
 67                        {
 068                            array.Add(ApplicationGatewayFirewallRule.DeserializeApplicationGatewayFirewallRule(item));
 69                        }
 70                    }
 071                    rules = array;
 72                    continue;
 73                }
 74            }
 075            return new ApplicationGatewayFirewallRuleGroup(ruleGroupName, description, rules);
 76        }
 77    }
 78}