< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Zones()-0%100%
get_Etag()-0%100%
get_ApplicationRuleCollections()-0%100%
get_NatRuleCollections()-0%100%
get_NetworkRuleCollections()-0%100%
get_IpConfigurations()-0%100%
get_ManagementIpConfiguration()-0%100%
get_ProvisioningState()-0%100%
get_ThreatIntelMode()-0%100%
get_VirtualHub()-0%100%
get_FirewallPolicy()-0%100%
get_HubIpAddresses()-0%100%
get_IpGroups()-0%100%
get_Sku()-0%100%
get_AdditionalProperties()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureFirewall(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewall.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> Azure Firewall resource. </summary>
 13    public partial class AzureFirewall : Resource
 14    {
 15        /// <summary> Initializes a new instance of AzureFirewall. </summary>
 016        public AzureFirewall()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of AzureFirewall. </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="zones"> A list of availability zones denoting where the resource needs to come from. </param>
 27        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
 28        /// <param name="applicationRuleCollections"> Collection of application rule collections used by Azure Firewall.
 29        /// <param name="natRuleCollections"> Collection of NAT rule collections used by Azure Firewall. </param>
 30        /// <param name="networkRuleCollections"> Collection of network rule collections used by Azure Firewall. </param
 31        /// <param name="ipConfigurations"> IP configuration of the Azure Firewall resource. </param>
 32        /// <param name="managementIpConfiguration"> IP configuration of the Azure Firewall used for management traffic.
 33        /// <param name="provisioningState"> The provisioning state of the Azure firewall resource. </param>
 34        /// <param name="threatIntelMode"> The operation mode for Threat Intelligence. </param>
 35        /// <param name="virtualHub"> The virtualHub to which the firewall belongs. </param>
 36        /// <param name="firewallPolicy"> The firewallPolicy associated with this azure firewall. </param>
 37        /// <param name="hubIpAddresses"> IP addresses associated with AzureFirewall. </param>
 38        /// <param name="ipGroups"> IpGroups associated with AzureFirewall. </param>
 39        /// <param name="sku"> The Azure Firewall Resource SKU. </param>
 40        /// <param name="additionalProperties"> The additional properties used to further config this azure firewall. </
 041        internal AzureFirewall(string id, string name, string type, string location, IDictionary<string, string> tags, I
 42        {
 043            Zones = zones;
 044            Etag = etag;
 045            ApplicationRuleCollections = applicationRuleCollections;
 046            NatRuleCollections = natRuleCollections;
 047            NetworkRuleCollections = networkRuleCollections;
 048            IpConfigurations = ipConfigurations;
 049            ManagementIpConfiguration = managementIpConfiguration;
 050            ProvisioningState = provisioningState;
 051            ThreatIntelMode = threatIntelMode;
 052            VirtualHub = virtualHub;
 053            FirewallPolicy = firewallPolicy;
 054            HubIpAddresses = hubIpAddresses;
 055            IpGroups = ipGroups;
 056            Sku = sku;
 057            AdditionalProperties = additionalProperties;
 058        }
 59
 60        /// <summary> A list of availability zones denoting where the resource needs to come from. </summary>
 061        public IList<string> Zones { get; set; }
 62        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
 063        public string Etag { get; }
 64        /// <summary> Collection of application rule collections used by Azure Firewall. </summary>
 065        public IList<AzureFirewallApplicationRuleCollection> ApplicationRuleCollections { get; set; }
 66        /// <summary> Collection of NAT rule collections used by Azure Firewall. </summary>
 067        public IList<AzureFirewallNatRuleCollection> NatRuleCollections { get; set; }
 68        /// <summary> Collection of network rule collections used by Azure Firewall. </summary>
 069        public IList<AzureFirewallNetworkRuleCollection> NetworkRuleCollections { get; set; }
 70        /// <summary> IP configuration of the Azure Firewall resource. </summary>
 071        public IList<AzureFirewallIPConfiguration> IpConfigurations { get; set; }
 72        /// <summary> IP configuration of the Azure Firewall used for management traffic. </summary>
 073        public AzureFirewallIPConfiguration ManagementIpConfiguration { get; set; }
 74        /// <summary> The provisioning state of the Azure firewall resource. </summary>
 075        public ProvisioningState? ProvisioningState { get; }
 76        /// <summary> The operation mode for Threat Intelligence. </summary>
 077        public AzureFirewallThreatIntelMode? ThreatIntelMode { get; set; }
 78        /// <summary> The virtualHub to which the firewall belongs. </summary>
 079        public SubResource VirtualHub { get; set; }
 80        /// <summary> The firewallPolicy associated with this azure firewall. </summary>
 081        public SubResource FirewallPolicy { get; set; }
 82        /// <summary> IP addresses associated with AzureFirewall. </summary>
 083        public HubIPAddresses HubIpAddresses { get; }
 84        /// <summary> IpGroups associated with AzureFirewall. </summary>
 085        public IList<AzureFirewallIpGroups> IpGroups { get; }
 86        /// <summary> The Azure Firewall Resource SKU. </summary>
 087        public AzureFirewallSku Sku { get; set; }
 88        /// <summary> The additional properties used to further config this azure firewall. </summary>
 089        public IDictionary<string, string> AdditionalProperties { get; set; }
 90    }
 91}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureFirewall.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 AzureFirewall : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Zones != null)
 20            {
 021                writer.WritePropertyName("zones");
 022                writer.WriteStartArray();
 023                foreach (var item in Zones)
 24                {
 025                    writer.WriteStringValue(item);
 26                }
 027                writer.WriteEndArray();
 28            }
 029            if (Etag != null)
 30            {
 031                writer.WritePropertyName("etag");
 032                writer.WriteStringValue(Etag);
 33            }
 034            if (Id != null)
 35            {
 036                writer.WritePropertyName("id");
 037                writer.WriteStringValue(Id);
 38            }
 039            if (Name != null)
 40            {
 041                writer.WritePropertyName("name");
 042                writer.WriteStringValue(Name);
 43            }
 044            if (Type != null)
 45            {
 046                writer.WritePropertyName("type");
 047                writer.WriteStringValue(Type);
 48            }
 049            if (Location != null)
 50            {
 051                writer.WritePropertyName("location");
 052                writer.WriteStringValue(Location);
 53            }
 054            if (Tags != null)
 55            {
 056                writer.WritePropertyName("tags");
 057                writer.WriteStartObject();
 058                foreach (var item in Tags)
 59                {
 060                    writer.WritePropertyName(item.Key);
 061                    writer.WriteStringValue(item.Value);
 62                }
 063                writer.WriteEndObject();
 64            }
 065            writer.WritePropertyName("properties");
 066            writer.WriteStartObject();
 067            if (ApplicationRuleCollections != null)
 68            {
 069                writer.WritePropertyName("applicationRuleCollections");
 070                writer.WriteStartArray();
 071                foreach (var item in ApplicationRuleCollections)
 72                {
 073                    writer.WriteObjectValue(item);
 74                }
 075                writer.WriteEndArray();
 76            }
 077            if (NatRuleCollections != null)
 78            {
 079                writer.WritePropertyName("natRuleCollections");
 080                writer.WriteStartArray();
 081                foreach (var item in NatRuleCollections)
 82                {
 083                    writer.WriteObjectValue(item);
 84                }
 085                writer.WriteEndArray();
 86            }
 087            if (NetworkRuleCollections != null)
 88            {
 089                writer.WritePropertyName("networkRuleCollections");
 090                writer.WriteStartArray();
 091                foreach (var item in NetworkRuleCollections)
 92                {
 093                    writer.WriteObjectValue(item);
 94                }
 095                writer.WriteEndArray();
 96            }
 097            if (IpConfigurations != null)
 98            {
 099                writer.WritePropertyName("ipConfigurations");
 0100                writer.WriteStartArray();
 0101                foreach (var item in IpConfigurations)
 102                {
 0103                    writer.WriteObjectValue(item);
 104                }
 0105                writer.WriteEndArray();
 106            }
 0107            if (ManagementIpConfiguration != null)
 108            {
 0109                writer.WritePropertyName("managementIpConfiguration");
 0110                writer.WriteObjectValue(ManagementIpConfiguration);
 111            }
 0112            if (ProvisioningState != null)
 113            {
 0114                writer.WritePropertyName("provisioningState");
 0115                writer.WriteStringValue(ProvisioningState.Value.ToString());
 116            }
 0117            if (ThreatIntelMode != null)
 118            {
 0119                writer.WritePropertyName("threatIntelMode");
 0120                writer.WriteStringValue(ThreatIntelMode.Value.ToString());
 121            }
 0122            if (VirtualHub != null)
 123            {
 0124                writer.WritePropertyName("virtualHub");
 0125                writer.WriteObjectValue(VirtualHub);
 126            }
 0127            if (FirewallPolicy != null)
 128            {
 0129                writer.WritePropertyName("firewallPolicy");
 0130                writer.WriteObjectValue(FirewallPolicy);
 131            }
 0132            if (HubIpAddresses != null)
 133            {
 0134                writer.WritePropertyName("hubIpAddresses");
 0135                writer.WriteObjectValue(HubIpAddresses);
 136            }
 0137            if (IpGroups != null)
 138            {
 0139                writer.WritePropertyName("ipGroups");
 0140                writer.WriteStartArray();
 0141                foreach (var item in IpGroups)
 142                {
 0143                    writer.WriteObjectValue(item);
 144                }
 0145                writer.WriteEndArray();
 146            }
 0147            if (Sku != null)
 148            {
 0149                writer.WritePropertyName("sku");
 0150                writer.WriteObjectValue(Sku);
 151            }
 0152            if (AdditionalProperties != null)
 153            {
 0154                writer.WritePropertyName("additionalProperties");
 0155                writer.WriteStartObject();
 0156                foreach (var item in AdditionalProperties)
 157                {
 0158                    writer.WritePropertyName(item.Key);
 0159                    writer.WriteStringValue(item.Value);
 160                }
 0161                writer.WriteEndObject();
 162            }
 0163            writer.WriteEndObject();
 0164            writer.WriteEndObject();
 0165        }
 166
 167        internal static AzureFirewall DeserializeAzureFirewall(JsonElement element)
 168        {
 0169            IList<string> zones = default;
 0170            string etag = default;
 0171            string id = default;
 0172            string name = default;
 0173            string type = default;
 0174            string location = default;
 0175            IDictionary<string, string> tags = default;
 0176            IList<AzureFirewallApplicationRuleCollection> applicationRuleCollections = default;
 0177            IList<AzureFirewallNatRuleCollection> natRuleCollections = default;
 0178            IList<AzureFirewallNetworkRuleCollection> networkRuleCollections = default;
 0179            IList<AzureFirewallIPConfiguration> ipConfigurations = default;
 0180            AzureFirewallIPConfiguration managementIpConfiguration = default;
 0181            ProvisioningState? provisioningState = default;
 0182            AzureFirewallThreatIntelMode? threatIntelMode = default;
 0183            SubResource virtualHub = default;
 0184            SubResource firewallPolicy = default;
 0185            HubIPAddresses hubIpAddresses = default;
 0186            IList<AzureFirewallIpGroups> ipGroups = default;
 0187            AzureFirewallSku sku = default;
 0188            IDictionary<string, string> additionalProperties = default;
 0189            foreach (var property in element.EnumerateObject())
 190            {
 0191                if (property.NameEquals("zones"))
 192                {
 0193                    if (property.Value.ValueKind == JsonValueKind.Null)
 194                    {
 195                        continue;
 196                    }
 0197                    List<string> array = new List<string>();
 0198                    foreach (var item in property.Value.EnumerateArray())
 199                    {
 0200                        if (item.ValueKind == JsonValueKind.Null)
 201                        {
 0202                            array.Add(null);
 203                        }
 204                        else
 205                        {
 0206                            array.Add(item.GetString());
 207                        }
 208                    }
 0209                    zones = array;
 0210                    continue;
 211                }
 0212                if (property.NameEquals("etag"))
 213                {
 0214                    if (property.Value.ValueKind == JsonValueKind.Null)
 215                    {
 216                        continue;
 217                    }
 0218                    etag = property.Value.GetString();
 0219                    continue;
 220                }
 0221                if (property.NameEquals("id"))
 222                {
 0223                    if (property.Value.ValueKind == JsonValueKind.Null)
 224                    {
 225                        continue;
 226                    }
 0227                    id = property.Value.GetString();
 0228                    continue;
 229                }
 0230                if (property.NameEquals("name"))
 231                {
 0232                    if (property.Value.ValueKind == JsonValueKind.Null)
 233                    {
 234                        continue;
 235                    }
 0236                    name = property.Value.GetString();
 0237                    continue;
 238                }
 0239                if (property.NameEquals("type"))
 240                {
 0241                    if (property.Value.ValueKind == JsonValueKind.Null)
 242                    {
 243                        continue;
 244                    }
 0245                    type = property.Value.GetString();
 0246                    continue;
 247                }
 0248                if (property.NameEquals("location"))
 249                {
 0250                    if (property.Value.ValueKind == JsonValueKind.Null)
 251                    {
 252                        continue;
 253                    }
 0254                    location = property.Value.GetString();
 0255                    continue;
 256                }
 0257                if (property.NameEquals("tags"))
 258                {
 0259                    if (property.Value.ValueKind == JsonValueKind.Null)
 260                    {
 261                        continue;
 262                    }
 0263                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0264                    foreach (var property0 in property.Value.EnumerateObject())
 265                    {
 0266                        if (property0.Value.ValueKind == JsonValueKind.Null)
 267                        {
 0268                            dictionary.Add(property0.Name, null);
 269                        }
 270                        else
 271                        {
 0272                            dictionary.Add(property0.Name, property0.Value.GetString());
 273                        }
 274                    }
 0275                    tags = dictionary;
 0276                    continue;
 277                }
 0278                if (property.NameEquals("properties"))
 279                {
 0280                    foreach (var property0 in property.Value.EnumerateObject())
 281                    {
 0282                        if (property0.NameEquals("applicationRuleCollections"))
 283                        {
 0284                            if (property0.Value.ValueKind == JsonValueKind.Null)
 285                            {
 286                                continue;
 287                            }
 0288                            List<AzureFirewallApplicationRuleCollection> array = new List<AzureFirewallApplicationRuleCo
 0289                            foreach (var item in property0.Value.EnumerateArray())
 290                            {
 0291                                if (item.ValueKind == JsonValueKind.Null)
 292                                {
 0293                                    array.Add(null);
 294                                }
 295                                else
 296                                {
 0297                                    array.Add(AzureFirewallApplicationRuleCollection.DeserializeAzureFirewallApplication
 298                                }
 299                            }
 0300                            applicationRuleCollections = array;
 0301                            continue;
 302                        }
 0303                        if (property0.NameEquals("natRuleCollections"))
 304                        {
 0305                            if (property0.Value.ValueKind == JsonValueKind.Null)
 306                            {
 307                                continue;
 308                            }
 0309                            List<AzureFirewallNatRuleCollection> array = new List<AzureFirewallNatRuleCollection>();
 0310                            foreach (var item in property0.Value.EnumerateArray())
 311                            {
 0312                                if (item.ValueKind == JsonValueKind.Null)
 313                                {
 0314                                    array.Add(null);
 315                                }
 316                                else
 317                                {
 0318                                    array.Add(AzureFirewallNatRuleCollection.DeserializeAzureFirewallNatRuleCollection(i
 319                                }
 320                            }
 0321                            natRuleCollections = array;
 0322                            continue;
 323                        }
 0324                        if (property0.NameEquals("networkRuleCollections"))
 325                        {
 0326                            if (property0.Value.ValueKind == JsonValueKind.Null)
 327                            {
 328                                continue;
 329                            }
 0330                            List<AzureFirewallNetworkRuleCollection> array = new List<AzureFirewallNetworkRuleCollection
 0331                            foreach (var item in property0.Value.EnumerateArray())
 332                            {
 0333                                if (item.ValueKind == JsonValueKind.Null)
 334                                {
 0335                                    array.Add(null);
 336                                }
 337                                else
 338                                {
 0339                                    array.Add(AzureFirewallNetworkRuleCollection.DeserializeAzureFirewallNetworkRuleColl
 340                                }
 341                            }
 0342                            networkRuleCollections = array;
 0343                            continue;
 344                        }
 0345                        if (property0.NameEquals("ipConfigurations"))
 346                        {
 0347                            if (property0.Value.ValueKind == JsonValueKind.Null)
 348                            {
 349                                continue;
 350                            }
 0351                            List<AzureFirewallIPConfiguration> array = new List<AzureFirewallIPConfiguration>();
 0352                            foreach (var item in property0.Value.EnumerateArray())
 353                            {
 0354                                if (item.ValueKind == JsonValueKind.Null)
 355                                {
 0356                                    array.Add(null);
 357                                }
 358                                else
 359                                {
 0360                                    array.Add(AzureFirewallIPConfiguration.DeserializeAzureFirewallIPConfiguration(item)
 361                                }
 362                            }
 0363                            ipConfigurations = array;
 0364                            continue;
 365                        }
 0366                        if (property0.NameEquals("managementIpConfiguration"))
 367                        {
 0368                            if (property0.Value.ValueKind == JsonValueKind.Null)
 369                            {
 370                                continue;
 371                            }
 0372                            managementIpConfiguration = AzureFirewallIPConfiguration.DeserializeAzureFirewallIPConfigura
 0373                            continue;
 374                        }
 0375                        if (property0.NameEquals("provisioningState"))
 376                        {
 0377                            if (property0.Value.ValueKind == JsonValueKind.Null)
 378                            {
 379                                continue;
 380                            }
 0381                            provisioningState = new ProvisioningState(property0.Value.GetString());
 0382                            continue;
 383                        }
 0384                        if (property0.NameEquals("threatIntelMode"))
 385                        {
 0386                            if (property0.Value.ValueKind == JsonValueKind.Null)
 387                            {
 388                                continue;
 389                            }
 0390                            threatIntelMode = new AzureFirewallThreatIntelMode(property0.Value.GetString());
 0391                            continue;
 392                        }
 0393                        if (property0.NameEquals("virtualHub"))
 394                        {
 0395                            if (property0.Value.ValueKind == JsonValueKind.Null)
 396                            {
 397                                continue;
 398                            }
 0399                            virtualHub = SubResource.DeserializeSubResource(property0.Value);
 0400                            continue;
 401                        }
 0402                        if (property0.NameEquals("firewallPolicy"))
 403                        {
 0404                            if (property0.Value.ValueKind == JsonValueKind.Null)
 405                            {
 406                                continue;
 407                            }
 0408                            firewallPolicy = SubResource.DeserializeSubResource(property0.Value);
 0409                            continue;
 410                        }
 0411                        if (property0.NameEquals("hubIpAddresses"))
 412                        {
 0413                            if (property0.Value.ValueKind == JsonValueKind.Null)
 414                            {
 415                                continue;
 416                            }
 0417                            hubIpAddresses = HubIPAddresses.DeserializeHubIPAddresses(property0.Value);
 0418                            continue;
 419                        }
 0420                        if (property0.NameEquals("ipGroups"))
 421                        {
 0422                            if (property0.Value.ValueKind == JsonValueKind.Null)
 423                            {
 424                                continue;
 425                            }
 0426                            List<AzureFirewallIpGroups> array = new List<AzureFirewallIpGroups>();
 0427                            foreach (var item in property0.Value.EnumerateArray())
 428                            {
 0429                                if (item.ValueKind == JsonValueKind.Null)
 430                                {
 0431                                    array.Add(null);
 432                                }
 433                                else
 434                                {
 0435                                    array.Add(AzureFirewallIpGroups.DeserializeAzureFirewallIpGroups(item));
 436                                }
 437                            }
 0438                            ipGroups = array;
 0439                            continue;
 440                        }
 0441                        if (property0.NameEquals("sku"))
 442                        {
 0443                            if (property0.Value.ValueKind == JsonValueKind.Null)
 444                            {
 445                                continue;
 446                            }
 0447                            sku = AzureFirewallSku.DeserializeAzureFirewallSku(property0.Value);
 0448                            continue;
 449                        }
 0450                        if (property0.NameEquals("additionalProperties"))
 451                        {
 0452                            if (property0.Value.ValueKind == JsonValueKind.Null)
 453                            {
 454                                continue;
 455                            }
 0456                            Dictionary<string, string> dictionary = new Dictionary<string, string>();
 0457                            foreach (var property1 in property0.Value.EnumerateObject())
 458                            {
 0459                                if (property1.Value.ValueKind == JsonValueKind.Null)
 460                                {
 0461                                    dictionary.Add(property1.Name, null);
 462                                }
 463                                else
 464                                {
 0465                                    dictionary.Add(property1.Name, property1.Value.GetString());
 466                                }
 467                            }
 0468                            additionalProperties = dictionary;
 469                            continue;
 470                        }
 471                    }
 472                    continue;
 473                }
 474            }
 0475            return new AzureFirewall(id, name, type, location, tags, zones, etag, applicationRuleCollections, natRuleCol
 476        }
 477    }
 478}