internal static FirewallPolicyRuleConditionApplicationProtocol DeserializeFirewallPolicyRuleConditionApplicationProtocol(JsonElement element)
        {
            Optional <FirewallPolicyRuleConditionApplicationProtocolType> protocolType = default;
            Optional <int> port = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("protocolType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    protocolType = new FirewallPolicyRuleConditionApplicationProtocolType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("port"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    port = property.Value.GetInt32();
                    continue;
                }
            }
            return(new FirewallPolicyRuleConditionApplicationProtocol(Optional.ToNullable(protocolType), Optional.ToNullable(port)));
        }
        internal static FirewallPolicyRuleConditionApplicationProtocol DeserializeFirewallPolicyRuleConditionApplicationProtocol(JsonElement element)
        {
            FirewallPolicyRuleConditionApplicationProtocolType?protocolType = default;
            int?port = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("protocolType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    protocolType = new FirewallPolicyRuleConditionApplicationProtocolType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("port"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    port = property.Value.GetInt32();
                    continue;
                }
            }
            return(new FirewallPolicyRuleConditionApplicationProtocol(protocolType, port));
        }