public RequestMethodMatchConditionDefinition(RequestMethodMatchConditionType typeDefinition, RequestMethodOperator @operator)
 {
     TypeDefinition = typeDefinition;
     Operator       = @operator;
     Transforms     = new ChangeTrackingList <PreTransformCategory>();
     MatchValues    = new ChangeTrackingList <RequestMethodMatchConditionDefinitionMatchValue>();
 }
Beispiel #2
0
 public RequestMethodMatchCondition(RequestMethodMatchConditionType conditionType, RequestMethodOperator requestMethodOperator)
 {
     ConditionType         = conditionType;
     RequestMethodOperator = requestMethodOperator;
     Transforms            = new ChangeTrackingList <PreTransformCategory>();
     MatchValues           = new ChangeTrackingList <RequestMethodMatchConditionMatchValue>();
 }
Beispiel #3
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("typeName");
     writer.WriteStringValue(ConditionType.ToString());
     writer.WritePropertyName("operator");
     writer.WriteStringValue(RequestMethodOperator.ToString());
     if (Optional.IsDefined(NegateCondition))
     {
         writer.WritePropertyName("negateCondition");
         writer.WriteBooleanValue(NegateCondition.Value);
     }
     if (Optional.IsCollectionDefined(Transforms))
     {
         writer.WritePropertyName("transforms");
         writer.WriteStartArray();
         foreach (var item in Transforms)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     if (Optional.IsCollectionDefined(MatchValues))
     {
         writer.WritePropertyName("matchValues");
         writer.WriteStartArray();
         foreach (var item in MatchValues)
         {
             writer.WriteStringValue(item.ToString());
         }
         writer.WriteEndArray();
     }
     writer.WriteEndObject();
 }
 public RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersTypeName typeName, RequestMethodOperator @operator)
 {
     TypeName    = typeName;
     Operator    = @operator;
     Transforms  = new ChangeTrackingList <TransformCategory>();
     MatchValues = new ChangeTrackingList <RequestMethodMatchConditionParametersMatchValuesItem>();
 }
 internal RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersOdataType odataType, RequestMethodOperator @operator, bool?negateCondition, IList <RequestMethodMatchConditionParametersMatchValuesItem> matchValues)
 {
     OdataType       = odataType;
     Operator        = @operator;
     NegateCondition = negateCondition;
     MatchValues     = matchValues;
 }
 internal RequestMethodMatchConditionDefinition(RequestMethodMatchConditionType typeDefinition, RequestMethodOperator @operator, bool?negateCondition, IList <PreTransformCategory> transforms, IList <RequestMethodMatchConditionDefinitionMatchValue> matchValues)
 {
     TypeDefinition  = typeDefinition;
     Operator        = @operator;
     NegateCondition = negateCondition;
     Transforms      = transforms;
     MatchValues     = matchValues;
 }
Beispiel #7
0
 internal RequestMethodMatchCondition(RequestMethodMatchConditionType conditionType, RequestMethodOperator requestMethodOperator, bool?negateCondition, IList <PreTransformCategory> transforms, IList <RequestMethodMatchConditionMatchValue> matchValues)
 {
     ConditionType         = conditionType;
     RequestMethodOperator = requestMethodOperator;
     NegateCondition       = negateCondition;
     Transforms            = transforms;
     MatchValues           = matchValues;
 }
 internal RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersTypeName typeName, RequestMethodOperator @operator, bool?negateCondition, IList <TransformCategory> transforms, IList <RequestMethodMatchConditionParametersMatchValuesItem> matchValues)
 {
     TypeName        = typeName;
     Operator        = @operator;
     NegateCondition = negateCondition;
     Transforms      = transforms;
     MatchValues     = matchValues;
 }
Beispiel #9
0
        internal static RequestMethodMatchConditionParameters DeserializeRequestMethodMatchConditionParameters(JsonElement element)
        {
            RequestMethodMatchConditionParametersOdataType odataType = default;
            RequestMethodOperator @operator       = default;
            Optional <bool>       negateCondition = default;
            Optional <IList <RequestMethodMatchConditionParametersMatchValuesItem> > matchValues = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("@odata.type"))
                {
                    odataType = new RequestMethodMatchConditionParametersOdataType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new RequestMethodOperator(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 <RequestMethodMatchConditionParametersMatchValuesItem> array = new List <RequestMethodMatchConditionParametersMatchValuesItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new RequestMethodMatchConditionParametersMatchValuesItem(item.GetString()));
                    }
                    matchValues = array;
                    continue;
                }
            }
            return(new RequestMethodMatchConditionParameters(odataType, @operator, Optional.ToNullable(negateCondition), Optional.ToList(matchValues)));
        }
Beispiel #10
0
        internal static RequestMethodMatchCondition DeserializeRequestMethodMatchCondition(JsonElement element)
        {
            RequestMethodMatchConditionType typeName            = default;
            RequestMethodOperator           @operator           = default;
            Optional <bool> negateCondition                     = default;
            Optional <IList <PreTransformCategory> > transforms = default;
            Optional <IList <RequestMethodMatchConditionMatchValue> > matchValues = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new RequestMethodMatchConditionType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("operator"))
                {
                    @operator = new RequestMethodOperator(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 <RequestMethodMatchConditionMatchValue> array = new List <RequestMethodMatchConditionMatchValue>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new RequestMethodMatchConditionMatchValue(item.GetString()));
                    }
                    matchValues = array;
                    continue;
                }
            }
            return(new RequestMethodMatchCondition(typeName, @operator, Optional.ToNullable(negateCondition), Optional.ToList(transforms), Optional.ToList(matchValues)));
        }
 public RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersOdataType odataType, RequestMethodOperator @operator)
 {
     OdataType   = odataType;
     Operator    = @operator;
     MatchValues = new ChangeTrackingList <RequestMethodMatchConditionParametersMatchValuesItem>();
 }