Example #1
0
 public PostArgsMatchConditionParameters(PostArgsMatchConditionParametersOdataType odataType, PostArgsOperator @operator)
 {
     OdataType   = odataType;
     Operator    = @operator;
     MatchValues = new ChangeTrackingList <string>();
     Transforms  = new ChangeTrackingList <TransformCategory>();
 }
Example #2
0
 internal PostArgsMatchConditionParameters(PostArgsMatchConditionParametersOdataType odataType, string selector, PostArgsOperator @operator, bool?negateCondition, IList <string> matchValues, IList <TransformCategory> transforms)
 {
     OdataType       = odataType;
     Selector        = selector;
     Operator        = @operator;
     NegateCondition = negateCondition;
     MatchValues     = matchValues;
     Transforms      = transforms;
 }
Example #3
0
        internal static PostArgsMatchConditionParameters DeserializePostArgsMatchConditionParameters(JsonElement element)
        {
            PostArgsMatchConditionParametersOdataType odataType   = default;
            Optional <string>                     selector        = default;
            PostArgsOperator                      @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("@odata.type"))
                {
                    odataType = new PostArgsMatchConditionParametersOdataType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("selector"))
                {
                    selector = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new PostArgsOperator(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 PostArgsMatchConditionParameters(odataType, selector.Value, @operator, Optional.ToNullable(negateCondition), Optional.ToList(matchValues), Optional.ToList(transforms)));
        }