/// <summary> /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="body">evalution batch request</param> /// <returns>Task of ApiResponse (EvaluationBatchResponse)</returns> public async Task <ApiResponse <EvalResult> > PostEvaluationAsync(EvalContext body) { if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling EvaluationApi->PostEvaluationBatch"); } return(await _httpClient.PostAsync("evaluation").WithBody((x) => x.Model(body)).AsApiResponse <EvalResult>()); }
/// <summary> /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="body">create a flag</param> /// <returns>Task of ApiResponse (Flag)</returns> public async Task <ApiResponse <Flag> > CreateFlagAsync(CreateFlagRequest body) { if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling FlagApi->CreateFlag"); } return(await _httpClient.PostAsync("flags").WithBody((x) => x.Model(body)).AsApiResponse <Flag>()); }
/// <summary> /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="flagID">numeric ID of the flag to get</param> /// <param name="body">create a segment under a flag</param> /// <returns>Task of ApiResponse (Segment)</returns> public async Task <ApiResponse <Segment> > CreateSegmentAsync(long flagID, CreateSegmentRequest body) { if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling SegmentApi->CreateSegment"); } return(await _httpClient.PostAsync($"flags/{flagID}/segments").WithBody((x) => x.Model(body)).AsApiResponse <Segment>()); }
/// <summary> /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="flagID">numeric ID of the flag</param> /// <param name="segmentID">numeric ID of the segment</param> /// <param name="body">create a constraint</param> /// <returns>Task of ApiResponse (Constraint)</returns> public async Task <ApiResponse <Constraint> > CreateConstraintAsync(long flagID, long segmentID, CreateConstraintRequest body) { if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling ConstraintApi->CreateConstraint"); } return(await _httpClient.PostAsync($"flags/{flagID}/segments/{segmentID}/constraints").AsApiResponse <Constraint>()); }