internal RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersOdataType odataType, RequestMethodOperator @operator, bool?negateCondition, IList <RequestMethodMatchConditionParametersMatchValuesItem> matchValues) { OdataType = odataType; Operator = @operator; NegateCondition = negateCondition; MatchValues = matchValues; }
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))); }
public RequestMethodMatchConditionParameters(RequestMethodMatchConditionParametersOdataType odataType, RequestMethodOperator @operator) { OdataType = odataType; Operator = @operator; MatchValues = new ChangeTrackingList <RequestMethodMatchConditionParametersMatchValuesItem>(); }