public RequestMethodMatchConditionDefinition(RequestMethodMatchConditionType typeDefinition, RequestMethodOperator @operator) { TypeDefinition = typeDefinition; Operator = @operator; Transforms = new ChangeTrackingList <PreTransformCategory>(); MatchValues = new ChangeTrackingList <RequestMethodMatchConditionDefinitionMatchValue>(); }
public RequestMethodMatchCondition(RequestMethodMatchConditionType conditionType, RequestMethodOperator requestMethodOperator) { ConditionType = conditionType; RequestMethodOperator = requestMethodOperator; Transforms = new ChangeTrackingList <PreTransformCategory>(); MatchValues = new ChangeTrackingList <RequestMethodMatchConditionMatchValue>(); }
internal RequestMethodMatchConditionDefinition(RequestMethodMatchConditionType typeDefinition, RequestMethodOperator @operator, bool?negateCondition, IList <PreTransformCategory> transforms, IList <RequestMethodMatchConditionDefinitionMatchValue> matchValues) { TypeDefinition = typeDefinition; Operator = @operator; NegateCondition = negateCondition; Transforms = transforms; MatchValues = matchValues; }
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 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))); }