public async Task <ApiResponse <DatasetValidationErrorSasUrlResponseModel> > GetValidateDatasetValidationErrorSasUrl(
            DatasetValidationErrorRequestModel requestModel)
        {
            Guard.ArgumentNotNull(requestModel, nameof(requestModel));

            return(await PostAsync <DatasetValidationErrorSasUrlResponseModel, DatasetValidationErrorRequestModel>(
                       DataSetsUriFor("get-validate-dataset-error-url"), requestModel));
        }
        public IActionResult GetValidateDatasetValidationErrorUrl([FromBody] DatasetValidationErrorRequestModel requestModel)
        {
            if (string.IsNullOrWhiteSpace(requestModel?.JobId))
            {
                return(new BadRequestObjectResult($"Missing {nameof(requestModel.JobId)} details"));
            }

            return(_datasetService.GetValidateDatasetValidationErrorSasUrl(requestModel));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> DownloadValidateDatasetValidationErrorSasUrl([FromRoute] string jobId)
        {
            Guard.IsNullOrWhiteSpace(jobId, nameof(jobId));

            DatasetValidationErrorRequestModel requestModel = new DatasetValidationErrorRequestModel
            {
                JobId = jobId
            };

            ApiResponse <DatasetValidationErrorSasUrlResponseModel> apiResponse = await _datasetApiClient.GetValidateDatasetValidationErrorSasUrl(requestModel);

            if (apiResponse.StatusCode == HttpStatusCode.OK && !string.IsNullOrWhiteSpace(apiResponse.Content?.ValidationErrorFileUrl))
            {
                return(new OkObjectResult(apiResponse.Content.ValidationErrorFileUrl));
            }

            return(new NotFoundResult());
        }