internal static FirewallPolicyFilterRule DeserializeFirewallPolicyFilterRule(JsonElement element)
        {
            FirewallPolicyFilterRuleAction      action         = default;
            IList <FirewallPolicyRuleCondition> ruleConditions = default;
            FirewallPolicyRuleType ruleType = default;
            string name     = default;
            int?   priority = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("action"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    action = FirewallPolicyFilterRuleAction.DeserializeFirewallPolicyFilterRuleAction(property.Value);
                    continue;
                }
                if (property.NameEquals("ruleConditions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <FirewallPolicyRuleCondition> array = new List <FirewallPolicyRuleCondition>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(FirewallPolicyRuleCondition.DeserializeFirewallPolicyRuleCondition(item));
                        }
                    }
                    ruleConditions = array;
                    continue;
                }
                if (property.NameEquals("ruleType"))
                {
                    ruleType = new FirewallPolicyRuleType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("priority"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    priority = property.Value.GetInt32();
                    continue;
                }
            }
            return(new FirewallPolicyFilterRule(ruleType, name, priority, action, ruleConditions));
        }
        internal static FirewallPolicyNatRule DeserializeFirewallPolicyNatRule(JsonElement element)
        {
            FirewallPolicyNatRuleAction action = default;
            string translatedAddress           = default;
            string translatedPort = default;
            FirewallPolicyRuleCondition ruleCondition = default;
            FirewallPolicyRuleType      ruleType      = default;
            string name     = default;
            int?   priority = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("action"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    action = FirewallPolicyNatRuleAction.DeserializeFirewallPolicyNatRuleAction(property.Value);
                    continue;
                }
                if (property.NameEquals("translatedAddress"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    translatedAddress = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("translatedPort"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    translatedPort = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("ruleCondition"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    ruleCondition = FirewallPolicyRuleCondition.DeserializeFirewallPolicyRuleCondition(property.Value);
                    continue;
                }
                if (property.NameEquals("ruleType"))
                {
                    ruleType = new FirewallPolicyRuleType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("priority"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    priority = property.Value.GetInt32();
                    continue;
                }
            }
            return(new FirewallPolicyNatRule(ruleType, name, priority, action, translatedAddress, translatedPort, ruleCondition));
        }