< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Name()-0%100%
get_Description()-0%100%
get_RuleConditionType()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFirewallPolicyRuleCondition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleCondition.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
 8namespace Azure.ResourceManager.Network.Models
 9{
 10    /// <summary> Properties of a rule. </summary>
 11    public partial class FirewallPolicyRuleCondition
 12    {
 13        /// <summary> Initializes a new instance of FirewallPolicyRuleCondition. </summary>
 014        public FirewallPolicyRuleCondition()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of FirewallPolicyRuleCondition. </summary>
 19        /// <param name="name"> Name of the rule condition. </param>
 20        /// <param name="description"> Description of the rule condition. </param>
 21        /// <param name="ruleConditionType"> Rule Condition Type. </param>
 022        internal FirewallPolicyRuleCondition(string name, string description, FirewallPolicyRuleConditionType ruleCondit
 23        {
 024            Name = name;
 025            Description = description;
 026            RuleConditionType = ruleConditionType;
 027        }
 28
 29        /// <summary> Name of the rule condition. </summary>
 030        public string Name { get; set; }
 31        /// <summary> Description of the rule condition. </summary>
 032        public string Description { get; set; }
 33        /// <summary> Rule Condition Type. </summary>
 034        internal FirewallPolicyRuleConditionType RuleConditionType { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\FirewallPolicyRuleCondition.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.ResourceManager.Network.Models
 12{
 13    public partial class FirewallPolicyRuleCondition : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (Name != null)
 19            {
 020                writer.WritePropertyName("name");
 021                writer.WriteStringValue(Name);
 22            }
 023            if (Description != null)
 24            {
 025                writer.WritePropertyName("description");
 026                writer.WriteStringValue(Description);
 27            }
 028            writer.WritePropertyName("ruleConditionType");
 029            writer.WriteStringValue(RuleConditionType.ToString());
 030            writer.WriteEndObject();
 031        }
 32
 33        internal static FirewallPolicyRuleCondition DeserializeFirewallPolicyRuleCondition(JsonElement element)
 34        {
 035            if (element.TryGetProperty("ruleConditionType", out JsonElement discriminator))
 36            {
 037                switch (discriminator.GetString())
 38                {
 039                    case "ApplicationRuleCondition": return ApplicationRuleCondition.DeserializeApplicationRuleCondition
 040                    case "NatRuleCondition": return NatRuleCondition.DeserializeNatRuleCondition(element);
 041                    case "NetworkRuleCondition": return NetworkRuleCondition.DeserializeNetworkRuleCondition(element);
 42                }
 43            }
 044            string name = default;
 045            string description = default;
 046            FirewallPolicyRuleConditionType ruleConditionType = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("name"))
 50                {
 051                    if (property.Value.ValueKind == JsonValueKind.Null)
 52                    {
 53                        continue;
 54                    }
 055                    name = property.Value.GetString();
 056                    continue;
 57                }
 058                if (property.NameEquals("description"))
 59                {
 060                    if (property.Value.ValueKind == JsonValueKind.Null)
 61                    {
 62                        continue;
 63                    }
 064                    description = property.Value.GetString();
 065                    continue;
 66                }
 067                if (property.NameEquals("ruleConditionType"))
 68                {
 069                    ruleConditionType = new FirewallPolicyRuleConditionType(property.Value.GetString());
 70                    continue;
 71                }
 72            }
 073            return new FirewallPolicyRuleCondition(name, description, ruleConditionType);
 74        }
 75    }
 76}