public IActionResult Post([FromBody] DocumentSampleSettings sampleSettings) { if (!(sampleSettings.Size > 0 || sampleSettings.Percent > 0)) { return(HttpErrorResult(StatusCodes.Status400BadRequest, DocumentResources.ValidSampleSizeOrPercentIsRequired)); } if (sampleSettings.FieldList != null) { var validateResult = documentService.ValidateFieldFilterFields(dataSetName, sampleSettings.FieldList); if (validateResult.IsFailure) { return(HttpErrorResult(StatusCodes.Status400BadRequest, validateResult.Error)); } } var results = sampleSettings.Size > 0 ? documentService.Sample(dataSetName, sampleSettings.Id, sampleSettings.TagIdList, sampleSettings.Size, sampleSettings?.FieldList) : documentService.Sample(dataSetName, sampleSettings.Id, sampleSettings.TagIdList, sampleSettings.Percent, sampleSettings?.FieldList); return(new OkObjectResult(results)); }
public async Task <ClientResponseWithObject <PaginatedList <object> > > GetSampleDocumentsAsync(DocumentSampleSettings sampleSettings) { var client = new ApiClient(_configuration, SampleEndpoint); return(await client.SendAsync <PaginatedList <object> >(System.Net.Http.HttpMethod.Post, sampleSettings, null, null, Headers, true)); }
public Task <ClientResponseWithObject <PaginatedList <object> > > GetSampleDocumentsAsync(DocumentSampleSettings sampleSettings) { throw new NotImplementedException(); }