< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Etag()-0%100%
get_Identity()-0%100%
get_RuleGroups()-0%100%
get_ProvisioningState()-0%100%
get_BasePolicy()-0%100%
get_Firewalls()-0%100%
get_ChildPolicies()-0%100%
get_ThreatIntelMode()-0%100%
get_ThreatIntelWhitelist()-0%100%
get_IntrusionSystemMode()-0%100%
get_TransportSecurity()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFirewallPolicy(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicy.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> FirewallPolicy Resource. </summary>
 13    public partial class FirewallPolicy : Resource
 14    {
 15        /// <summary> Initializes a new instance of FirewallPolicy. </summary>
 016        public FirewallPolicy()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FirewallPolicy. </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="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 27        /// <param name="identity"> The identity of the firewall policy. </param>
 28        /// <param name="ruleGroups"> List of references to FirewallPolicyRuleGroups. </param>
 29        /// <param name="provisioningState"> The provisioning state of the firewall policy resource. </param>
 30        /// <param name="basePolicy"> The parent firewall policy from which rules are inherited. </param>
 31        /// <param name="firewalls"> List of references to Azure Firewalls that this Firewall Policy is associated with.
 32        /// <param name="childPolicies"> List of references to Child Firewall Policies. </param>
 33        /// <param name="threatIntelMode"> The operation mode for Threat Intelligence. </param>
 34        /// <param name="threatIntelWhitelist"> ThreatIntel Whitelist for Firewall Policy. </param>
 35        /// <param name="intrusionSystemMode"> The operation mode for Intrusion system. </param>
 36        /// <param name="transportSecurity"> TLS Configuration definition. </param>
 037        internal FirewallPolicy(string id, string name, string type, string location, IDictionary<string, string> tags, 
 38        {
 039            Etag = etag;
 040            Identity = identity;
 041            RuleGroups = ruleGroups;
 042            ProvisioningState = provisioningState;
 043            BasePolicy = basePolicy;
 044            Firewalls = firewalls;
 045            ChildPolicies = childPolicies;
 046            ThreatIntelMode = threatIntelMode;
 047            ThreatIntelWhitelist = threatIntelWhitelist;
 048            IntrusionSystemMode = intrusionSystemMode;
 049            TransportSecurity = transportSecurity;
 050        }
 51
 52        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 053        public string Etag { get; }
 54        /// <summary> The identity of the firewall policy. </summary>
 055        public ManagedServiceIdentity Identity { get; set; }
 56        /// <summary> List of references to FirewallPolicyRuleGroups. </summary>
 057        public IList<SubResource> RuleGroups { get; }
 58        /// <summary> The provisioning state of the firewall policy resource. </summary>
 059        public ProvisioningState? ProvisioningState { get; }
 60        /// <summary> The parent firewall policy from which rules are inherited. </summary>
 061        public SubResource BasePolicy { get; set; }
 62        /// <summary> List of references to Azure Firewalls that this Firewall Policy is associated with. </summary>
 063        public IList<SubResource> Firewalls { get; }
 64        /// <summary> List of references to Child Firewall Policies. </summary>
 065        public IList<SubResource> ChildPolicies { get; }
 66        /// <summary> The operation mode for Threat Intelligence. </summary>
 067        public AzureFirewallThreatIntelMode? ThreatIntelMode { get; set; }
 68        /// <summary> ThreatIntel Whitelist for Firewall Policy. </summary>
 069        public FirewallPolicyThreatIntelWhitelist ThreatIntelWhitelist { get; set; }
 70        /// <summary> The operation mode for Intrusion system. </summary>
 071        public FirewallPolicyIntrusionSystemMode? IntrusionSystemMode { get; set; }
 72        /// <summary> TLS Configuration definition. </summary>
 073        public FirewallPolicyTransportSecurity TransportSecurity { get; set; }
 74    }
 75}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicy.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 FirewallPolicy : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Etag != null)
 20            {
 021                writer.WritePropertyName("etag");
 022                writer.WriteStringValue(Etag);
 23            }
 024            if (Identity != null)
 25            {
 026                writer.WritePropertyName("identity");
 027                writer.WriteObjectValue(Identity);
 28            }
 029            if (Id != null)
 30            {
 031                writer.WritePropertyName("id");
 032                writer.WriteStringValue(Id);
 33            }
 034            if (Name != null)
 35            {
 036                writer.WritePropertyName("name");
 037                writer.WriteStringValue(Name);
 38            }
 039            if (Type != null)
 40            {
 041                writer.WritePropertyName("type");
 042                writer.WriteStringValue(Type);
 43            }
 044            if (Location != null)
 45            {
 046                writer.WritePropertyName("location");
 047                writer.WriteStringValue(Location);
 48            }
 049            if (Tags != null)
 50            {
 051                writer.WritePropertyName("tags");
 052                writer.WriteStartObject();
 053                foreach (var item in Tags)
 54                {
 055                    writer.WritePropertyName(item.Key);
 056                    writer.WriteStringValue(item.Value);
 57                }
 058                writer.WriteEndObject();
 59            }
 060            writer.WritePropertyName("properties");
 061            writer.WriteStartObject();
 062            if (RuleGroups != null)
 63            {
 064                writer.WritePropertyName("ruleGroups");
 065                writer.WriteStartArray();
 066                foreach (var item in RuleGroups)
 67                {
 068                    writer.WriteObjectValue(item);
 69                }
 070                writer.WriteEndArray();
 71            }
 072            if (ProvisioningState != null)
 73            {
 074                writer.WritePropertyName("provisioningState");
 075                writer.WriteStringValue(ProvisioningState.Value.ToString());
 76            }
 077            if (BasePolicy != null)
 78            {
 079                writer.WritePropertyName("basePolicy");
 080                writer.WriteObjectValue(BasePolicy);
 81            }
 082            if (Firewalls != null)
 83            {
 084                writer.WritePropertyName("firewalls");
 085                writer.WriteStartArray();
 086                foreach (var item in Firewalls)
 87                {
 088                    writer.WriteObjectValue(item);
 89                }
 090                writer.WriteEndArray();
 91            }
 092            if (ChildPolicies != null)
 93            {
 094                writer.WritePropertyName("childPolicies");
 095                writer.WriteStartArray();
 096                foreach (var item in ChildPolicies)
 97                {
 098                    writer.WriteObjectValue(item);
 99                }
 0100                writer.WriteEndArray();
 101            }
 0102            if (ThreatIntelMode != null)
 103            {
 0104                writer.WritePropertyName("threatIntelMode");
 0105                writer.WriteStringValue(ThreatIntelMode.Value.ToString());
 106            }
 0107            if (ThreatIntelWhitelist != null)
 108            {
 0109                writer.WritePropertyName("threatIntelWhitelist");
 0110                writer.WriteObjectValue(ThreatIntelWhitelist);
 111            }
 0112            if (IntrusionSystemMode != null)
 113            {
 0114                writer.WritePropertyName("intrusionSystemMode");
 0115                writer.WriteStringValue(IntrusionSystemMode.Value.ToString());
 116            }
 0117            if (TransportSecurity != null)
 118            {
 0119                writer.WritePropertyName("transportSecurity");
 0120                writer.WriteObjectValue(TransportSecurity);
 121            }
 0122            writer.WriteEndObject();
 0123            writer.WriteEndObject();
 0124        }
 125
 126        internal static FirewallPolicy DeserializeFirewallPolicy(JsonElement element)
 127        {
 0128            string etag = default;
 0129            ManagedServiceIdentity identity = default;
 0130            string id = default;
 0131            string name = default;
 0132            string type = default;
 0133            string location = default;
 0134            IDictionary<string, string> tags = default;
 0135            IList<SubResource> ruleGroups = default;
 0136            ProvisioningState? provisioningState = default;
 0137            SubResource basePolicy = default;
 0138            IList<SubResource> firewalls = default;
 0139            IList<SubResource> childPolicies = default;
 0140            AzureFirewallThreatIntelMode? threatIntelMode = default;
 0141            FirewallPolicyThreatIntelWhitelist threatIntelWhitelist = default;
 0142            FirewallPolicyIntrusionSystemMode? intrusionSystemMode = default;
 0143            FirewallPolicyTransportSecurity transportSecurity = default;
 0144            foreach (var property in element.EnumerateObject())
 145            {
 0146                if (property.NameEquals("etag"))
 147                {
 0148                    if (property.Value.ValueKind == JsonValueKind.Null)
 149                    {
 150                        continue;
 151                    }
 0152                    etag = property.Value.GetString();
 0153                    continue;
 154                }
 0155                if (property.NameEquals("identity"))
 156                {
 0157                    if (property.Value.ValueKind == JsonValueKind.Null)
 158                    {
 159                        continue;
 160                    }
 0161                    identity = ManagedServiceIdentity.DeserializeManagedServiceIdentity(property.Value);
 0162                    continue;
 163                }
 0164                if (property.NameEquals("id"))
 165                {
 0166                    if (property.Value.ValueKind == JsonValueKind.Null)
 167                    {
 168                        continue;
 169                    }
 0170                    id = property.Value.GetString();
 0171                    continue;
 172                }
 0173                if (property.NameEquals("name"))
 174                {
 0175                    if (property.Value.ValueKind == JsonValueKind.Null)
 176                    {
 177                        continue;
 178                    }
 0179                    name = property.Value.GetString();
 0180                    continue;
 181                }
 0182                if (property.NameEquals("type"))
 183                {
 0184                    if (property.Value.ValueKind == JsonValueKind.Null)
 185                    {
 186                        continue;
 187                    }
 0188                    type = property.Value.GetString();
 0189                    continue;
 190                }
 0191                if (property.NameEquals("location"))
 192                {
 0193                    if (property.Value.ValueKind == JsonValueKind.Null)
 194                    {
 195                        continue;
 196                    }
 0197                    location = property.Value.GetString();
 0198                    continue;
 199                }
 0200                if (property.NameEquals("tags"))
 201                {
 0202                    if (property.Value.ValueKind == JsonValueKind.Null)
 203                    {
 204                        continue;
 205                    }
 0206                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0207                    foreach (var property0 in property.Value.EnumerateObject())
 208                    {
 0209                        if (property0.Value.ValueKind == JsonValueKind.Null)
 210                        {
 0211                            dictionary.Add(property0.Name, null);
 212                        }
 213                        else
 214                        {
 0215                            dictionary.Add(property0.Name, property0.Value.GetString());
 216                        }
 217                    }
 0218                    tags = dictionary;
 0219                    continue;
 220                }
 0221                if (property.NameEquals("properties"))
 222                {
 0223                    foreach (var property0 in property.Value.EnumerateObject())
 224                    {
 0225                        if (property0.NameEquals("ruleGroups"))
 226                        {
 0227                            if (property0.Value.ValueKind == JsonValueKind.Null)
 228                            {
 229                                continue;
 230                            }
 0231                            List<SubResource> array = new List<SubResource>();
 0232                            foreach (var item in property0.Value.EnumerateArray())
 233                            {
 0234                                if (item.ValueKind == JsonValueKind.Null)
 235                                {
 0236                                    array.Add(null);
 237                                }
 238                                else
 239                                {
 0240                                    array.Add(SubResource.DeserializeSubResource(item));
 241                                }
 242                            }
 0243                            ruleGroups = array;
 0244                            continue;
 245                        }
 0246                        if (property0.NameEquals("provisioningState"))
 247                        {
 0248                            if (property0.Value.ValueKind == JsonValueKind.Null)
 249                            {
 250                                continue;
 251                            }
 0252                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0253                            continue;
 254                        }
 0255                        if (property0.NameEquals("basePolicy"))
 256                        {
 0257                            if (property0.Value.ValueKind == JsonValueKind.Null)
 258                            {
 259                                continue;
 260                            }
 0261                            basePolicy = SubResource.DeserializeSubResource(property0.Value);
 0262                            continue;
 263                        }
 0264                        if (property0.NameEquals("firewalls"))
 265                        {
 0266                            if (property0.Value.ValueKind == JsonValueKind.Null)
 267                            {
 268                                continue;
 269                            }
 0270                            List<SubResource> array = new List<SubResource>();
 0271                            foreach (var item in property0.Value.EnumerateArray())
 272                            {
 0273                                if (item.ValueKind == JsonValueKind.Null)
 274                                {
 0275                                    array.Add(null);
 276                                }
 277                                else
 278                                {
 0279                                    array.Add(SubResource.DeserializeSubResource(item));
 280                                }
 281                            }
 0282                            firewalls = array;
 0283                            continue;
 284                        }
 0285                        if (property0.NameEquals("childPolicies"))
 286                        {
 0287                            if (property0.Value.ValueKind == JsonValueKind.Null)
 288                            {
 289                                continue;
 290                            }
 0291                            List<SubResource> array = new List<SubResource>();
 0292                            foreach (var item in property0.Value.EnumerateArray())
 293                            {
 0294                                if (item.ValueKind == JsonValueKind.Null)
 295                                {
 0296                                    array.Add(null);
 297                                }
 298                                else
 299                                {
 0300                                    array.Add(SubResource.DeserializeSubResource(item));
 301                                }
 302                            }
 0303                            childPolicies = array;
 0304                            continue;
 305                        }
 0306                        if (property0.NameEquals("threatIntelMode"))
 307                        {
 0308                            if (property0.Value.ValueKind == JsonValueKind.Null)
 309                            {
 310                                continue;
 311                            }
 0312                            threatIntelMode = new AzureFirewallThreatIntelMode(property0.Value.GetString());
 0313                            continue;
 314                        }
 0315                        if (property0.NameEquals("threatIntelWhitelist"))
 316                        {
 0317                            if (property0.Value.ValueKind == JsonValueKind.Null)
 318                            {
 319                                continue;
 320                            }
 0321                            threatIntelWhitelist = FirewallPolicyThreatIntelWhitelist.DeserializeFirewallPolicyThreatInt
 0322                            continue;
 323                        }
 0324                        if (property0.NameEquals("intrusionSystemMode"))
 325                        {
 0326                            if (property0.Value.ValueKind == JsonValueKind.Null)
 327                            {
 328                                continue;
 329                            }
 0330                            intrusionSystemMode = new FirewallPolicyIntrusionSystemMode(property0.Value.GetString());
 0331                            continue;
 332                        }
 0333                        if (property0.NameEquals("transportSecurity"))
 334                        {
 0335                            if (property0.Value.ValueKind == JsonValueKind.Null)
 336                            {
 337                                continue;
 338                            }
 0339                            transportSecurity = FirewallPolicyTransportSecurity.DeserializeFirewallPolicyTransportSecuri
 340                            continue;
 341                        }
 342                    }
 343                    continue;
 344                }
 345            }
 0346            return new FirewallPolicy(id, name, type, location, tags, etag, identity, ruleGroups, provisioningState, bas
 347        }
 348    }
 349}