示例#1
0
 public RequestSchemeMatchCondition(RequestSchemeMatchConditionType conditionType, RequestSchemeOperator requestSchemeOperator)
 {
     ConditionType         = conditionType;
     RequestSchemeOperator = requestSchemeOperator;
     Transforms            = new ChangeTrackingList <PreTransformCategory>();
     MatchValues           = new ChangeTrackingList <RequestSchemeMatchConditionMatchValue>();
 }
示例#2
0
 public RequestSchemeMatchConditionDefinition(RequestSchemeMatchConditionType typeDefinition, RequestSchemeOperator @operator)
 {
     TypeDefinition = typeDefinition;
     Operator       = @operator;
     Transforms     = new ChangeTrackingList <PreTransformCategory>();
     MatchValues    = new ChangeTrackingList <RequestSchemeMatchConditionDefinitionMatchValue>();
 }
示例#3
0
 internal RequestSchemeMatchCondition(RequestSchemeMatchConditionType conditionType, RequestSchemeOperator requestSchemeOperator, bool?negateCondition, IList <PreTransformCategory> transforms, IList <RequestSchemeMatchConditionMatchValue> matchValues)
 {
     ConditionType         = conditionType;
     RequestSchemeOperator = requestSchemeOperator;
     NegateCondition       = negateCondition;
     Transforms            = transforms;
     MatchValues           = matchValues;
 }
示例#4
0
 internal RequestSchemeMatchConditionDefinition(RequestSchemeMatchConditionType typeDefinition, RequestSchemeOperator @operator, bool?negateCondition, IList <PreTransformCategory> transforms, IList <RequestSchemeMatchConditionDefinitionMatchValue> matchValues)
 {
     TypeDefinition  = typeDefinition;
     Operator        = @operator;
     NegateCondition = negateCondition;
     Transforms      = transforms;
     MatchValues     = matchValues;
 }
示例#5
0
        internal static RequestSchemeMatchCondition DeserializeRequestSchemeMatchCondition(JsonElement element)
        {
            RequestSchemeMatchConditionType typeName            = default;
            RequestSchemeOperator           @operator           = default;
            Optional <bool> negateCondition                     = default;
            Optional <IList <PreTransformCategory> > transforms = default;
            Optional <IList <RequestSchemeMatchConditionMatchValue> > matchValues = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new RequestSchemeMatchConditionType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new RequestSchemeOperator(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("transforms"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <PreTransformCategory> array = new List <PreTransformCategory>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new PreTransformCategory(item.GetString()));
                    }
                    transforms = array;
                    continue;
                }
                if (property.NameEquals("matchValues"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <RequestSchemeMatchConditionMatchValue> array = new List <RequestSchemeMatchConditionMatchValue>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new RequestSchemeMatchConditionMatchValue(item.GetString()));
                    }
                    matchValues = array;
                    continue;
                }
            }
            return(new RequestSchemeMatchCondition(typeName, @operator, Optional.ToNullable(negateCondition), Optional.ToList(transforms), Optional.ToList(matchValues)));
        }