public RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersTypeName typeName, RequestMethodOperator @operator) { TypeName = typeName; Operator = @operator; Transforms = new ChangeTrackingList <TransformCategory>(); MatchValues = new ChangeTrackingList <RequestMethodMatchConditionParametersMatchValuesItem>(); }
internal RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersTypeName typeName, RequestMethodOperator @operator, bool?negateCondition, IList <TransformCategory> transforms, IList <RequestMethodMatchConditionParametersMatchValuesItem> matchValues) { TypeName = typeName; Operator = @operator; NegateCondition = negateCondition; Transforms = transforms; MatchValues = matchValues; }
internal static RequestMethodMatchConditionParameters DeserializeRequestMethodMatchConditionParameters(JsonElement element) { RequestMethodMatchConditionParametersTypeName typeName = default; RequestMethodOperator @operator = default; Optional <bool> negateCondition = default; Optional <IList <TransformCategory> > transforms = default; Optional <IList <RequestMethodMatchConditionParametersMatchValuesItem> > matchValues = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("typeName")) { typeName = new RequestMethodMatchConditionParametersTypeName(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 <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 <RequestMethodMatchConditionParametersMatchValuesItem> array = new List <RequestMethodMatchConditionParametersMatchValuesItem>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(new RequestMethodMatchConditionParametersMatchValuesItem(item.GetString())); } matchValues = array; continue; } } return(new RequestMethodMatchConditionParameters(typeName, @operator, Optional.ToNullable(negateCondition), Optional.ToList(transforms), Optional.ToList(matchValues))); }