public QueryStringMatchConditionDefinition(QueryStringMatchConditionType typeDefinition, QueryStringOperator @operator)
 {
     TypeDefinition = typeDefinition;
     Operator       = @operator;
     MatchValues    = new ChangeTrackingList <string>();
     Transforms     = new ChangeTrackingList <PreTransformCategory>();
 }
Exemple #2
0
 public QueryStringMatchCondition(QueryStringMatchConditionType conditionType, QueryStringOperator queryStringOperator)
 {
     ConditionType       = conditionType;
     QueryStringOperator = queryStringOperator;
     MatchValues         = new ChangeTrackingList <string>();
     Transforms          = new ChangeTrackingList <PreTransformCategory>();
 }
 public QueryStringMatchConditionParameters(QueryStringMatchConditionParametersOdataType odataType, QueryStringOperator @operator)
 {
     OdataType   = odataType;
     Operator    = @operator;
     MatchValues = new ChangeTrackingList <string>();
     Transforms  = new ChangeTrackingList <TransformCategory>();
 }
Exemple #4
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("typeName");
     writer.WriteStringValue(ConditionType.ToString());
     writer.WritePropertyName("operator");
     writer.WriteStringValue(QueryStringOperator.ToString());
     if (Optional.IsDefined(NegateCondition))
     {
         writer.WritePropertyName("negateCondition");
         writer.WriteBooleanValue(NegateCondition.Value);
     }
     if (Optional.IsCollectionDefined(MatchValues))
     {
         writer.WritePropertyName("matchValues");
         writer.WriteStartArray();
         foreach (var item in MatchValues)
         {
             writer.WriteStringValue(item);
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(Transforms))
     {
         writer.WritePropertyName("transforms");
         writer.WriteStartArray();
         foreach (var item in Transforms)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
 }
 internal QueryStringMatchConditionDefinition(QueryStringMatchConditionType typeDefinition, QueryStringOperator @operator, bool?negateCondition, IList <string> matchValues, IList <PreTransformCategory> transforms)
 {
     TypeDefinition  = typeDefinition;
     Operator        = @operator;
     NegateCondition = negateCondition;
     MatchValues     = matchValues;
     Transforms      = transforms;
 }
Exemple #6
0
 internal QueryStringMatchCondition(QueryStringMatchConditionType conditionType, QueryStringOperator queryStringOperator, bool?negateCondition, IList <string> matchValues, IList <PreTransformCategory> transforms)
 {
     ConditionType       = conditionType;
     QueryStringOperator = queryStringOperator;
     NegateCondition     = negateCondition;
     MatchValues         = matchValues;
     Transforms          = transforms;
 }
 internal QueryStringMatchConditionParameters(QueryStringMatchConditionParametersOdataType odataType, QueryStringOperator @operator, bool?negateCondition, IList <string> matchValues, IList <TransformCategory> transforms)
 {
     OdataType       = odataType;
     Operator        = @operator;
     NegateCondition = negateCondition;
     MatchValues     = matchValues;
     Transforms      = transforms;
 }
        internal static QueryStringMatchConditionParameters DeserializeQueryStringMatchConditionParameters(JsonElement element)
        {
            QueryStringMatchConditionParametersTypeName typeName  = default;
            QueryStringOperator                   @operator       = default;
            Optional <bool>                       negateCondition = default;
            Optional <IList <string> >            matchValues     = default;
            Optional <IList <TransformCategory> > transforms      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new QueryStringMatchConditionParametersTypeName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new QueryStringOperator(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("negateCondition"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    negateCondition = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("matchValues"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    matchValues = array;
                    continue;
                }
                if (property.NameEquals("transforms"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <TransformCategory> array = new List <TransformCategory>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new TransformCategory(item.GetString()));
                    }
                    transforms = array;
                    continue;
                }
            }
            return(new QueryStringMatchConditionParameters(typeName, @operator, Optional.ToNullable(negateCondition), Optional.ToList(matchValues), Optional.ToList(transforms)));
        }