public RequestSchemeMatchConditionParameters(RequestSchemeMatchConditionParametersTypeName typeName, RequestSchemeMatchConditionParametersOperator @operator)
 {
     TypeName    = typeName;
     Operator    = @operator;
     Transforms  = new ChangeTrackingList <TransformCategory>();
     MatchValues = new ChangeTrackingList <RequestSchemeMatchConditionParametersMatchValuesItem>();
 }
 internal RequestSchemeMatchConditionParameters(RequestSchemeMatchConditionParametersTypeName typeName, RequestSchemeMatchConditionParametersOperator @operator, bool?negateCondition, IList <TransformCategory> transforms, IList <RequestSchemeMatchConditionParametersMatchValuesItem> matchValues)
 {
     TypeName        = typeName;
     Operator        = @operator;
     NegateCondition = negateCondition;
     Transforms      = transforms;
     MatchValues     = matchValues;
 }
Exemplo n.º 3
0
        internal static RequestSchemeMatchConditionParameters DeserializeRequestSchemeMatchConditionParameters(JsonElement element)
        {
            RequestSchemeMatchConditionParametersTypeName typeName  = default;
            RequestSchemeMatchConditionParametersOperator @operator = default;
            Optional <bool> negateCondition = default;
            Optional <IList <TransformCategory> > transforms = default;
            Optional <IList <RequestSchemeMatchConditionParametersMatchValuesItem> > matchValues = default;

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