< Summary

Class:Azure.ResourceManager.Network.Models.FirewallPolicyRuleGroup
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleGroup.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleGroup.Serialization.cs
Covered lines:0
Uncovered lines:89
Coverable lines:89
Total lines:213
Line coverage:0% (0 of 89)
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_Type()-0%100%
get_Priority()-0%100%
get_Rules()-0%100%
get_ProvisioningState()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFirewallPolicyRuleGroup(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleGroup.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> Rule Group resource. </summary>
 13    public partial class FirewallPolicyRuleGroup : SubResource
 14    {
 15        /// <summary> Initializes a new instance of FirewallPolicyRuleGroup. </summary>
 016        public FirewallPolicyRuleGroup()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FirewallPolicyRuleGroup. </summary>
 21        /// <param name="id"> Resource ID. </param>
 22        /// <param name="name"> The name of the resource that is unique within a resource group. This name can be used t
 23        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 24        /// <param name="type"> Rule Group type. </param>
 25        /// <param name="priority"> Priority of the Firewall Policy Rule Group resource. </param>
 26        /// <param name="rules"> Group of Firewall Policy rules. </param>
 27        /// <param name="provisioningState"> The provisioning state of the firewall policy rule group resource. </param>
 028        internal FirewallPolicyRuleGroup(string id, string name, string etag, string type, int? priority, IList<Firewall
 29        {
 030            Name = name;
 031            Etag = etag;
 032            Type = type;
 033            Priority = priority;
 034            Rules = rules;
 035            ProvisioningState = provisioningState;
 036        }
 37
 38        /// <summary> The name of the resource that is unique within a resource group. This name can be used to access t
 039        public string Name { get; set; }
 40        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 041        public string Etag { get; }
 42        /// <summary> Rule Group type. </summary>
 043        public string Type { get; }
 44        /// <summary> Priority of the Firewall Policy Rule Group resource. </summary>
 045        public int? Priority { get; set; }
 46        /// <summary> Group of Firewall Policy rules. </summary>
 047        public IList<FirewallPolicyRule> Rules { get; set; }
 48        /// <summary> The provisioning state of the firewall policy rule group resource. </summary>
 049        public ProvisioningState? ProvisioningState { get; }
 50    }
 51}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleGroup.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 FirewallPolicyRuleGroup : 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 (Type != null)
 30            {
 031                writer.WritePropertyName("type");
 032                writer.WriteStringValue(Type);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            writer.WritePropertyName("properties");
 040            writer.WriteStartObject();
 041            if (Priority != null)
 42            {
 043                writer.WritePropertyName("priority");
 044                writer.WriteNumberValue(Priority.Value);
 45            }
 046            if (Rules != null)
 47            {
 048                writer.WritePropertyName("rules");
 049                writer.WriteStartArray();
 050                foreach (var item in Rules)
 51                {
 052                    writer.WriteObjectValue(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 FirewallPolicyRuleGroup DeserializeFirewallPolicyRuleGroup(JsonElement element)
 66        {
 067            string name = default;
 068            string etag = default;
 069            string type = default;
 070            string id = default;
 071            int? priority = default;
 072            IList<FirewallPolicyRule> rules = 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("type"))
 95                {
 096                    if (property.Value.ValueKind == JsonValueKind.Null)
 97                    {
 98                        continue;
 99                    }
 0100                    type = property.Value.GetString();
 0101                    continue;
 102                }
 0103                if (property.NameEquals("id"))
 104                {
 0105                    if (property.Value.ValueKind == JsonValueKind.Null)
 106                    {
 107                        continue;
 108                    }
 0109                    id = property.Value.GetString();
 0110                    continue;
 111                }
 0112                if (property.NameEquals("properties"))
 113                {
 0114                    foreach (var property0 in property.Value.EnumerateObject())
 115                    {
 0116                        if (property0.NameEquals("priority"))
 117                        {
 0118                            if (property0.Value.ValueKind == JsonValueKind.Null)
 119                            {
 120                                continue;
 121                            }
 0122                            priority = property0.Value.GetInt32();
 0123                            continue;
 124                        }
 0125                        if (property0.NameEquals("rules"))
 126                        {
 0127                            if (property0.Value.ValueKind == JsonValueKind.Null)
 128                            {
 129                                continue;
 130                            }
 0131                            List<FirewallPolicyRule> array = new List<FirewallPolicyRule>();
 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(FirewallPolicyRule.DeserializeFirewallPolicyRule(item));
 141                                }
 142                            }
 0143                            rules = 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 FirewallPolicyRuleGroup(id, name, etag, type, priority, rules, provisioningState);
 160        }
 161    }
 162}