void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("matchVariable");
     writer.WriteStringValue(MatchVariable.ToString());
     writer.WritePropertyName("selectorMatchOperator");
     writer.WriteStringValue(SelectorMatchOperator.ToString());
     writer.WritePropertyName("selector");
     writer.WriteStringValue(Selector);
     writer.WriteEndObject();
 }
        internal static MatchCondition DeserializeMatchCondition(JsonElement element)
        {
            IList <MatchVariable>          matchVariables = default;
            WebApplicationFirewallOperator @operator      = default;
            Optional <bool> negationConditon = default;
            IList <string>  matchValues      = default;
            Optional <IList <WebApplicationFirewallTransform> > transforms = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("matchVariables"))
                {
                    List <MatchVariable> array = new List <MatchVariable>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(MatchVariable.DeserializeMatchVariable(item));
                    }
                    matchVariables = array;
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new WebApplicationFirewallOperator(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("negationConditon"))
                {
                    negationConditon = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("matchValues"))
                {
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    matchValues = array;
                    continue;
                }
                if (property.NameEquals("transforms"))
                {
                    List <WebApplicationFirewallTransform> array = new List <WebApplicationFirewallTransform>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new WebApplicationFirewallTransform(item.GetString()));
                    }
                    transforms = array;
                    continue;
                }
            }
            return(new MatchCondition(matchVariables, @operator, Optional.ToNullable(negationConditon), matchValues, Optional.ToList(transforms)));
        }